Code: Select all
function widget:GetInfo()
return {
name = "Reset widgets and settings",
desc = "Reset settings and widgets to fit the mod",
author = "zwzsg",
date = "March 5th, 2009",
license = "Public Domain",
layer = 0,
enabled = true,
handler = true,
}
end
local function WidgetWhiteList()
Spring.Echo("Enable some widgets")
for n,w in pairs(widgetHandler.knownWidgets) do
if n=="AdvPlayersList"
or n=="Autoquit"
or n=="CustomFormations2"
or n=="HealthBars"
or n=="HighlightSelectedUnits"
or n=="Select n Center!"
or n=="Start Point Remover"
or n=="MiniMap Start Boxes"
or n=="Action Finder"
or n=="Music"
or n=="Write GameState"
or n=="Heroes Right Click"
or n=="Hide commands"
or n=="Keep Morpheds Selected"
or n=="Automatic Tip Dispenser"
or n=="Build Bar"
or n=="Console Commands"
or n=="Default Commands"
or n=="Hotkeys"
or n=="Spring Direct Launch 2"
or n=="noResBar NoMoveWarnings" then
widgetHandler:EnableWidget(n)
else
widgetHandler:DisableWidget(n)
end
end
end
function widget:Initialize()
WidgetWhiteList()
-- Don't do that! People are gonna hate you if you change their settings!
Spring.SendCommands({"movewarnings 0","buildwarnings 0"})
Spring.SendCommands({"volume 100"})
Spring.SetConfigInt("AdvUnitShading",0)
Spring.SetConfigInt("MoveWarnings",0)
Spring.SetConfigInt("BuildWarnings",0)
Spring.SetConfigInt("LuaAutoModWidgets",1)
Spring.SetConfigInt("LuaModUICtrl",1)
Spring.SetConfigInt("LuaUI",1)
Spring.SetConfigInt("GroundDecals",1)
Spring.SetConfigInt("CamMode",1)
Spring.SetConfigInt("CrossSize",6)
Spring.SetConfigInt("DynamicSky",0)
Spring.SetConfigInt("AdvSky",0)
Spring.SetConfigInt("UnitIconDist",500)
Spring.SetConfigInt("UnitLodDist",500)
Spring.SetConfigInt("SoundVolume",100)
widgetHandler:DisableWidget(self:GetInfo().name)
end