Fixing bugs, change dialogue translations

This commit is contained in:
Vladislav Khorev committed 2026-07-15 14:28:31 +03:00
1 parent ca73148f4b
commit 9f17d51fc8
12 files changed
+50 -809

No files matched your search

+21
View File
@@ -5,6 +5,7 @@
#include <unordered_map>
#include "Location.h"
#include "items/ItemRegistry.h"
#include "utils/Utils.h"
#define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>
@@ -87,6 +88,26 @@ namespace ZL {
lua.open_libraries(sol::lib::base, sol::lib::math, sol::lib::string, sol::lib::table);
// --- Переопределение функции print ---
lua.set_function("print", [](sol::this_state ts, sol::variadic_args va) {
sol::state_view lua_view(ts);
sol::function tostring = lua_view["tostring"];
auto& log = logger();
log << "[script] ";
bool first = true;
for (auto arg : va) {
if (!first) log << "\t"; // Разделяем аргументы табуляцией, как в стандартном Lua print
std::string str = tostring(arg);
log << str;
first = false;
}
log << std::endl;
});
// -------------------------------------
auto api = lua.create_named_table("game_api");
// npc_walk_to(index, x, y, z [, on_arrived])