mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
XML saving and minor fixes + code refactoring.
Signed-off-by: otfallen <f.fallen45@gmail.com>
This commit is contained in:
@@ -66,6 +66,7 @@ void Application::registerLuaFunctions()
|
||||
g_lua.bindGlobalFunction("iptostring", [](int v) { return stdext::ip_to_string(v); });
|
||||
g_lua.bindGlobalFunction("stringtoip", [](const std::string& v) { return stdext::string_to_ip(v); });
|
||||
g_lua.bindGlobalFunction("listSubnetAddresses", [](uint32 a, uint8 b) { return stdext::listSubnetAddresses(a, b); });
|
||||
g_lua.bindGlobalFunction("ucwords", [](std::string s) { return stdext::ucwords(s); });
|
||||
|
||||
// Application
|
||||
g_lua.registerSingletonClass("g_app");
|
||||
@@ -154,6 +155,7 @@ void Application::registerLuaFunctions()
|
||||
g_lua.bindSingletonFunction("g_resources", "searchAndAddPackages", &ResourceManager::searchAndAddPackages, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "removeSearchPath", &ResourceManager::removeSearchPath, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "fileExists", &ResourceManager::fileExists, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "directoryExists", &ResourceManager::directoryExists, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "getRealDir", &ResourceManager::getRealDir, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "getWorkDir", &ResourceManager::getWorkDir, &g_resources);
|
||||
g_lua.bindSingletonFunction("g_resources", "getSearchPaths", &ResourceManager::getSearchPaths, &g_resources);
|
||||
|
@@ -43,6 +43,7 @@ distribution.
|
||||
#include <framework/const.h>
|
||||
#include <otclient/position.h>
|
||||
#include <framework/stdext/cast.h>
|
||||
#include <framework/stdext/string.h>
|
||||
|
||||
// Help out windows:
|
||||
#if defined( _DEBUG ) && !defined( DEBUG )
|
||||
@@ -51,7 +52,7 @@ distribution.
|
||||
|
||||
#ifdef TIXML_USE_STL
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#define TIXML_STRING std::string
|
||||
#else
|
||||
@@ -1005,6 +1006,7 @@ public:
|
||||
std::string Attribute( const std::string& name, double* d ) const;
|
||||
|
||||
void SetAttribute( const std::string& name, const std::string& _value );
|
||||
void SetAttribute( const std::string& name, int _value) { SetAttribute(name, stdext::to_string(_value)); }
|
||||
|
||||
void RemoveAttribute( const std::string& name );
|
||||
|
||||
|
Reference in New Issue
Block a user