mirror of
https://github.com/gmod-integration/lua.git
synced 2025-04-30 07:25:25 +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
|
if game.SinglePlayer() then return print("Gmod Integration is not supported in Singleplayer!") end
|
||||||
gmInte = gmInte || {}
|
gmInte = gmInte || {}
|
||||||
gmInte.version = "0.4.9"
|
gmInte.version = "0.5.0"
|
||||||
gmInte.config = {}
|
gmInte.config = {}
|
||||||
gmInte.materials = {}
|
gmInte.materials = {}
|
||||||
local function loadServerConfig()
|
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)
|
hook.Add("OnPlayerChat", "gmInte:OnPlayerChat:AdminCmd", function(ply, strText, bTeamOnly, bPlayerIsDead)
|
||||||
if ply != LocalPlayer() then return end
|
if ply != LocalPlayer() then return end
|
||||||
strText = string.lower(strText)
|
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
|
local translationTable = default
|
||||||
function gmInte.getTranslation(key, defaultTranslation, ...)
|
function gmInte.getTranslation(key, defaultTranslation, ...)
|
||||||
local translation = translationTable[key]
|
local translation = translationTable[key]
|
||||||
|
@ -16,8 +16,8 @@ function gmInte.loadTranslations()
|
||||||
if lang == "en" then
|
if lang == "en" then
|
||||||
translationTable = default
|
translationTable = default
|
||||||
else
|
else
|
||||||
if file.Exists("gmod_integration/shared/languages/sh_" .. lang .. ".lua", "LUA") then
|
if file.Exists("gmod_integration/languages/sh_" .. lang .. ".lua", "LUA") then
|
||||||
translationTable = include("gmod_integration/shared/languages/sh_" .. lang .. ".lua")
|
translationTable = include("gmod_integration/languages/sh_" .. lang .. ".lua")
|
||||||
else
|
else
|
||||||
print("Unknown Language")
|
print("Unknown Language")
|
||||||
return
|
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