refact: do a full reèarchitecture of the lua

This commit is contained in:
Linventif 2025-04-17 03:22:36 +00:00
parent d6a378ec45
commit a605d9fbe7
50 changed files with 9 additions and 10 deletions

View File

@ -1,6 +1,6 @@
if game.SinglePlayer() then return print("Gmod Integration is not supported in Singleplayer!") end
gmInte = gmInte || {}
gmInte.version = "0.4.9"
gmInte.version = "0.5.0"
gmInte.config = {}
gmInte.materials = {}
local function loadServerConfig()

View File

@ -1,9 +1,3 @@
hook.Add("InitPostEntity", "gmInte:Ply:Ready", function()
gmInte.SendNet("ready", {
["branch"] = LocalPlayer():gmInteGetBranch()
})
end)
hook.Add("OnPlayerChat", "gmInte:OnPlayerChat:AdminCmd", function(ply, strText, bTeamOnly, bPlayerIsDead)
if ply != LocalPlayer() then return end
strText = string.lower(strText)

View File

@ -1,4 +1,4 @@
local default = include("gmod_integration/shared/languages/sh_en.lua")
local default = include("gmod_integration/languages/sh_en.lua")
local translationTable = default
function gmInte.getTranslation(key, defaultTranslation, ...)
local translation = translationTable[key]
@ -16,8 +16,8 @@ function gmInte.loadTranslations()
if lang == "en" then
translationTable = default
else
if file.Exists("gmod_integration/shared/languages/sh_" .. lang .. ".lua", "LUA") then
translationTable = include("gmod_integration/shared/languages/sh_" .. lang .. ".lua")
if file.Exists("gmod_integration/languages/sh_" .. lang .. ".lua", "LUA") then
translationTable = include("gmod_integration/languages/sh_" .. lang .. ".lua")
else
print("Unknown Language")
return

View File

@ -0,0 +1,5 @@
hook.Add("InitPostEntity", "gmInte:Ply:Ready", function()
gmInte.SendNet("ready", {
["branch"] = LocalPlayer():gmInteGetBranch()
})
end)