diff --git a/lua/background_npcs_core/global/sv_dynamic_movement_mesh.lua b/lua/background_npcs_core/global/sv_dynamic_movement_mesh.lua index e55c781e..d88fc719 100644 --- a/lua/background_npcs_core/global/sv_dynamic_movement_mesh.lua +++ b/lua/background_npcs_core/global/sv_dynamic_movement_mesh.lua @@ -1,4 +1,4 @@ -async.Add('bgNPC_MovementMapDynamicGenerator', function(yield, wait) +async.AddDedic('bgNPC_MovementMapDynamicGenerator', function(yield, wait) local cvar_bgn_generator_restict = GetConVar('bgn_enable_dynamic_nodes_only_when_mesh_not_exists') local cvar_bgn_dynamic_nodes = GetConVar('bgn_dynamic_nodes') local cvar_bgn_dynamic_nodes_type = GetConVar('bgn_dynamic_nodes_type') @@ -294,7 +294,7 @@ async.Add('bgNPC_MovementMapDynamicGenerator', function(yield, wait) PassYield() end - -- MsgN('New mesh generated') + -- player.GetAll()[1]:ChatPrint('New mesh generated' .. ' ' .. tostring(CurTime())) BGN_NODE:SetMap(map_points) diff --git a/lua/background_npcs_core/tool_options/cl_lang.lua b/lua/background_npcs_core/tool_options/cl_lang.lua index c4fa67b9..ff93baec 100644 --- a/lua/background_npcs_core/tool_options/cl_lang.lua +++ b/lua/background_npcs_core/tool_options/cl_lang.lua @@ -1,7 +1,8 @@ -local ru_lang = include('lang/cl_ru.lua') -local en_lang = include('lang/cl_en.lua') +local lang = slib.language({ + ['default'] = bgNPC.LANGUAGES['english'], + ['russian'] = bgNPC.LANGUAGES['russian'] +}) -local lang = GetConVar('cl_language'):GetString() == 'russian' and ru_lang or en_lang for k, v in pairs(lang) do language.Add(k, v) end \ No newline at end of file diff --git a/lua/background_npcs_core/tool_options/lang/cl_en.lua b/lua/background_npcs_core/tool_options/lang/sh_en.lua similarity index 84% rename from lua/background_npcs_core/tool_options/lang/cl_en.lua rename to lua/background_npcs_core/tool_options/lang/sh_en.lua index 27503588..8861f1a4 100644 --- a/lua/background_npcs_core/tool_options/lang/cl_en.lua +++ b/lua/background_npcs_core/tool_options/lang/sh_en.lua @@ -1,5 +1,7 @@ local target_directory = 'background_npcs_core/tool_options/lang/' -slib.usingDirectory(target_directory .. 'en') +slib.usingDirectory(target_directory .. 'en', nil, true) + +if SERVER then return end local lang = {} @@ -12,4 +14,4 @@ table.Merge(lang, include(target_directory .. 'en/cl_workshop.lua')) table.Merge(lang, include(target_directory .. 'en/cl_actors.lua')) table.Merge(lang, include(target_directory .. 'en/cl_modules.lua')) -return lang \ No newline at end of file +bgNPC.LANGUAGES['english'] = lang \ No newline at end of file diff --git a/lua/background_npcs_core/tool_options/lang/cl_ru.lua b/lua/background_npcs_core/tool_options/lang/sh_ru.lua similarity index 84% rename from lua/background_npcs_core/tool_options/lang/cl_ru.lua rename to lua/background_npcs_core/tool_options/lang/sh_ru.lua index 4da6a615..260e626b 100644 --- a/lua/background_npcs_core/tool_options/lang/cl_ru.lua +++ b/lua/background_npcs_core/tool_options/lang/sh_ru.lua @@ -1,5 +1,7 @@ local target_directory = 'background_npcs_core/tool_options/lang/' -slib.usingDirectory(target_directory .. 'ru') +slib.usingDirectory(target_directory .. 'ru', nil, true) + +if SERVER then return end local lang = {} @@ -12,4 +14,4 @@ table.Merge(lang, include(target_directory .. 'ru/cl_workshop.lua')) table.Merge(lang, include(target_directory .. 'ru/cl_actors.lua')) table.Merge(lang, include(target_directory .. 'ru/cl_modules.lua')) -return lang \ No newline at end of file +bgNPC.LANGUAGES['russian'] = lang \ No newline at end of file diff --git a/lua/slib_autoloader/sh_background_npcs.lua b/lua/slib_autoloader/sh_background_npcs.lua index 76bbee56..26c9c355 100644 --- a/lua/slib_autoloader/sh_background_npcs.lua +++ b/lua/slib_autoloader/sh_background_npcs.lua @@ -14,9 +14,10 @@ if SERVER then end bgNPC = {} -bgNPC.VERSION = '1.8.8' +bgNPC.VERSION = '1.8.9' -- Do not change ------------- +bgNPC.LANGUAGES = {} bgNPC.cfg = {} bgNPC.actors = {} bgNPC.factors = {} @@ -195,8 +196,8 @@ local function ExecutableScripts() script:using('states/sv_random_gesture.lua') script:using('states/sh_dance.lua') - script:using('tool_options/lang/cl_en.lua') - script:using('tool_options/lang/cl_ru.lua') + script:using('tool_options/lang/sh_en.lua') + script:using('tool_options/lang/sh_ru.lua') script:using('tool_options/cl_lang.lua') script:using('tool_options/cl_bgn_settings_menu.lua') diff --git a/version.txt b/version.txt index 8b315b3f..5af131d6 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.8.8 \ No newline at end of file +1.8.9 \ No newline at end of file