mirror of
https://github.com/gmod-integration/lua.git
synced 2025-04-29 22:15:26 +00:00
refact: do a full reèarchitecture of the lua
This commit is contained in:
parent
d6a378ec45
commit
a605d9fbe7
|
@ -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()
|
||||
|
|
|
@ -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)
|
|
@ -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
|
|
@ -0,0 +1,5 @@
|
|||
hook.Add("InitPostEntity", "gmInte:Ply:Ready", function()
|
||||
gmInte.SendNet("ready", {
|
||||
["branch"] = LocalPlayer():gmInteGetBranch()
|
||||
})
|
||||
end)
|
Loading…
Reference in New Issue
Block a user