Skip to content

Commit

Permalink
Fix Chicken Stats Panel
Browse files Browse the repository at this point in the history
Unload Shardlua bot when not in use
  • Loading branch information
ForbodingAngel committed Dec 2, 2016
1 parent e3e9a4a commit 5cc9c07
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions LuaRules/Gadgets/AILoader.lua
Expand Up @@ -10,6 +10,23 @@ function gadget:GetInfo()
}
end

local teams = Spring.GetTeamList()
for i =1, #teams do
local luaAI = Spring.GetTeamLuaAI(teams[i])
if luaAI ~= "" then
if luaAI == "ShardLua" then
shardEnabled = true
end
end
end

if shardEnabled == true then
Spring.Echo("[AI Loader] ShardLua bot Activated!")
else
Spring.Echo("[AI Loader] ShardLua bot Deactivated!")
return false
end

-- globals
ShardSpringLua = true -- this is the AI Boot gadget, so we're in Spring Lua
VFS.Include("luarules/gadgets/ai/preload/globals.lua")
Expand Down
4 changes: 2 additions & 2 deletions LuaUI/Widgets_Evo/gui_chickenStatsPanel.lua
Expand Up @@ -10,7 +10,7 @@ function widget:GetInfo()
date = "May 04, 2008",
license = "GNU GPL, v2 or later",
layer = -9,
enabled = false -- loaded by default?
enabled = true -- loaded by default?
}
end

Expand Down Expand Up @@ -61,7 +61,7 @@ local math = math
local table = table

local displayList
local fontHandler = loadstring(VFS.LoadFile(LUAUI_DIRNAME.."fonts.lua"))()
local fontHandler = loadstring(VFS.LoadFile(LUAUI_DIRNAME.."modfonts.lua"))()
local panelFont = LUAUI_DIRNAME.."Fonts/FreeSansBold_14"
local waveFont = LUAUI_DIRNAME.."Fonts/Skrawl_40"
local panelTexture = ":n:"..LUAUI_DIRNAME.."Images/panel.tga"
Expand Down
File renamed without changes.

0 comments on commit 5cc9c07

Please sign in to comment.