Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

self = false
unused = false
-- unused_args = false
global = false
allow_defined_top = true
max_line_length = false
codes = true

-- Something to think about in the future
-- max_cyclomatic_complexity = 10

-- Lua (unnecessary)
-- "os", "pairs", "math", "pcall", "table", "type", "unpack", "assert",
-- "ipairs", "tostring", "tonumber", "debug", "getfenv", "setfenv",
-- "loadstring", "io", "xpcall", "string", "collectgarbage",
-- "getmetatable", "setmetatable", "next",

-- Default is probably fine, but anyway
std=lua51

globals = {
-- std extensions
"math.round", "math.bit_or",
"table.ifind", "table.show", "table.save", "table.echo", "table.print",
-- Spring
"Spring", "VFS", "gl", "GL", "Game",
"UnitDefs", "UnitDefNames", "FeatureDefs", "FeatureDefNames",
"WeaponDefs", "WeaponDefNames", "LOG", "KEYSYMS", "CMD", "Script",
"SendToUnsynced", "Platform", "include",
-- Gadgets
"GG", "gadgetHandler", "gadget",
-- Widgets
"WG", "widgetHandler", "widget",
-- Chili
"Chili", "Checkbox", "Control", "ComboBox", "Button", "Label",
"Line", "EditBox", "Font", "Window", "ScrollPanel", "LayoutPanel",
"Panel", "StackPanel", "Grid", "TextBox", "Image", "TreeView", "Trackbar",
"DetachableTabPanel", "screen0", "Progressbar",
-- Libs
-- "LCS", "Path", "Table", "Log", "String", "Shaders", "Time", "Array", "StartScript",
}
10 changes: 5 additions & 5 deletions LuaMenu/Addons/timeFunctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ local function FixTimeOutOfBounds(timeTable)
timeTable[i] = timeTable[i] + base[i]
timeTable[i + 1] = timeTable[i + 1] - 1
end
while timeTable[i] > base[i] do
while timeTable[i] >= base[i] do
timeTable[i] = timeTable[i] - base[i]
timeTable[i + 1] = timeTable[i + 1] + 1
end
end

local updated = false
while updated do
repeat
local updated = false
-- Overflow
local daysInThisMonth = monthDays[timeTable[5]] or 31
if timeTable[5] == 2 and IsLeapYear(timeTable[6]) then
Expand Down Expand Up @@ -99,7 +99,7 @@ local function FixTimeOutOfBounds(timeTable)
timeTable[6] = timeTable[6] - 1
updated = true
end
end
until (not updated)

return timeTable
end
Expand Down Expand Up @@ -393,4 +393,4 @@ function Spring.Utilities.GetCompactCurrentUtc()
}

return string.format("%04d%02d%02d_%02d%02d%02d", t[6], t[5], t[4], t[3], t[2], t[1])
end
end
7 changes: 7 additions & 0 deletions LuaMenu/configs/gameConfig/generic/mainConfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ local externalFuncAndData = {
background = background,
minimapOverridePath = minimapOverridePath,
minimapThumbnailPath = minimapThumbnailPath,

ignoreServerVersion = true,
disableBattleListHostButton = true, -- Hides "Host" button as this function is not working as one might imagine
disableSteam = true, -- removes settings related to steam
disablePlanetwars = true, -- removes settings related to planetwars
disableMatchMaking = true, -- removes match making
disableCommunityWindow = true, -- removes Community Window
}

function externalFuncAndData.CheckAvailability()
Expand Down
13 changes: 13 additions & 0 deletions LuaMenu/configs/gameConfig/tc/aiblacklist.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
CppTestAI = true,
E323AI = true,
HughAI = true,
KAIK = true,
NullAI = true,
NullJavaAI = true,
NullOOJavaAI = true,
RAI = true,
Sharddev = true,
Shard = true,
AAI = true,
}
67 changes: 67 additions & 0 deletions LuaMenu/configs/gameConfig/tc/benchmarkFile.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
return [[

[game]
{
[allyteam1]
{
numallies=0;
}
[team1]
{
teamleader=0;
rgbcolor=0.99609375 0.546875 0;
allyteam=1;
}
[ai0]
{
host=0;
name=SkirmishAI(1);
version=<not-versioned>;
isfromdemo=0;
team=0;
shortname=Skirmish AI;
}
[modoptions]
{
}
[allyteam0]
{
numallies=0;
}
[team0]
{
teamleader=0;
rgbcolor=0.99609375 0.546875 0;
allyteam=0;
}
[ai1]
{
host=0;
name=SkirmishAI(2);
version=<not-versioned>;
isfromdemo=0;
team=1;
shortname=Skirmish AI;
}
[player0]
{
spectator=1;
name=Player;
rank=0;
isfromdemo=0;
team=0;
}
numplayers=1;
gamestartdelay=0;
myplayername=Player;
gametype=The Cursed $VERSION;
ishost=1;
hostip=127.0.0.1;
mapname=Barren 2;
startpostype=2;
hostport=0;
numusers=3;
nohelperais=0;
}

]]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"server" : {
"address" : "springrts.com",
"port" : 8200,
"serverName" : "Spring",
"protocol" : "spring"
},
"game" : "tc"
}
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions LuaMenu/configs/gameConfig/tc/defaultsettings/lups.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//==verbose mode?==//ShowWarnings = trueQuality=3 //0=very low,1=low,2=normal,3=high,4=very high//==Distortions==//Distortions = false // force distortions? (you can force it on, too!)//DistortionUpdateSkip = 0 // must be larger zero (larger := better performance)//DistortionCopyDepthBuffer = true // do depthtest? (can increase performance if turned off)//==Force Card Detection==// Vendor = "NVIDIA Corporation"// Renderer= "GeForce 7600"//==Deactivate Specific Classes==DisableFX= { ShockWave = false, UnitCloaker = false, UnitJitter = false, AirJet = __AIR_JET__, Ribbon = __RIBBON__, ShieldSphereColor = __SHIELD_SPHERE_COLOR__,}//==NanoTower FXs==// NanoFxType[0..FACTIONS_COUNT-1] : determines the used particle class// (only NanoLasers and NanoParticles possible)// (Note: NanoParticles doesn't work on all PCs)// NanoFx[0..FACTIONS_COUNT-1] : fx config// note: if you want to make a param dependent on the nano density,// then you can put " " around the param and put any lua code// in it (see core example fx)// (any lua function except math.random(),random(),r() are prohibited)// allowed variables to use are:// count (nano density/strength)// limcount (count scaled between 0..1)// and inverse (->reclaim)NanoFx = {// EXAMPLE CUSTOM ARM NANOFX (freaky!)//arm = {// fxtype = "NanoParticles",// alpha = 0.25,// size = 3,// sizeSpread = 5,// sizeGrowth = 0.35,// rotSpeed = 0.1,// rotSpread = 360,// texture = "bitmaps/Other/Poof.png",// particles = 1.75, // -> count*2.5 particles//}// DEFAULT CORE ONE//core = {// fxtype = "NanoLasers",// alpha = "0.2+count/30",// corealpha = "0.7+count/15",// corethickness = "limcount",// streamThickness = "1+4*limcount",// streamSpeed = "(inversed)and(70-count) or (120-count*3)",//}}
Expand Down
75 changes: 75 additions & 0 deletions LuaMenu/configs/gameConfig/tc/defaultsettings/springsettings.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
AdvUnitShading = 1
AdvMapShading = 1
AllowDeferredMapRendering = 1
AllowDeferredModelRendering = 1
BuildWarnings = 0
BumpWaterAnisotropy = 2
BumpWaterBlurReflection = 1
BumpWaterReflection = 2
BumpWaterRefraction = 1
BumpWaterDepthBits = 32
BumpWaterShoreWaves = 1
BumpWaterTexSizeReflection = 256
CamMode = 1
CamTimeExponent = 4.0
CamTimeFactor = 1.0
CubeTexSizeReflection = 128
CubeTexSizeSpecular = 128
DisplayDebugPrefixConsole = 0
DualScreenMiniMapOnLeft = 1
EdgeMoveDynamic = 0
EdgeMoveWidth = 0.003
FeatureDrawDistance = 600000
FeatureFadeDistance = 600000
FontSize = 18
FPSFOV = 90
FSAALevel = 8
FSAA = 1
GrassDetail = 9
GroundScarAlphaFade = 1
GroundDecals = 5
GroundDetail = 120
HangTimeout = 5
HardwareCursor = 1
InitialNetworkTimeout = 0
LoadingMT = 0
LODScale = 1.000
LODScaleReflection = 1.000
LODScaleRefraction = 1.000
LODScaleShadow = 1.000
Language = en
LinkBandwidth = 0
LogFlush = 0
LuaAutoModWidgets = 1
LuaShaders = 1
MaxParticles = 25000
MaxSounds = 32
MaximumTransmissionUnit = 0
MiddleClickScrollSpeed = -0.001
MiniMapMarker = 0
MinimapOnLeft = 1
MouseDragScrollThreshold = 0
MoveWarnings = 0
NormalMapping = 1
OverheadMaxHeightFactor = 1.4
OverheadScrollSpeed = 50
ReconnectTimeout = 0
ReflectiveWater = 4
RotateLogFiles = 1
ScrollWheelSpeed = -25
Shadows = 1
ShadowMapSize = 8192
ShowClock = 0
SmoothLines = 3
SmoothPoints = 3
SplashScreenDir = ./MenuLoadscreens
TreeRadius = 1500
UnitIconDist = 151
UnitLodDist = 9999
UseDistToGroundForIcons = 1.1
UsePBO = 0
VerboseLevel = 10
Version = 2
Water = 4
WorkerThreadSpinTime = 5
snd_general = 100
Binary file not shown.
89 changes: 89 additions & 0 deletions LuaMenu/configs/gameConfig/tc/gameUnitInformation.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
local nameList = {
}

local categories = {
}

local humanNames = {
}

--------- To Generate ------------
--[[
local inNameList = {}
local nameList = {}
local carrierDefs = VFS.Include("LuaRules/Configs/drone_defs.lua")
local function AddUnit(unitName)
if inNameList[unitName] then
return
end
inNameList[unitName] = true
nameList[#nameList + 1] = unitName

local ud = UnitDefNames[unitName]
if ud.buildOptions then
for i = 1, #ud.buildOptions do
AddUnit(UnitDefs[ud.buildOptions[i] ].name)
end
end

if ud.customParams.morphto then
AddUnit(ud.customParams.morphto)
end

if ud.weapons then
for i = 1, #ud.weapons do
local wd = WeaponDefs[ud.weapons[i].weaponDef]
if wd and wd.customParams and wd.customParams.spawns_name then
AddUnit(wd.customParams.spawns_name)
end
end
end

if carrierDefs[ud.id] then
local data = carrierDefs[ud.id]
for i = 1, #data do
local droneUnitDefID = data[i].drone
if droneUnitDefID and UnitDefs[droneUnitDefID] then
AddUnit(UnitDefs[droneUnitDefID].name)
end
end
end
end

local function GenerateLists()
AddUnit("cloakcon")
local humanNames = {}
for i = 1, #nameList do
humanNames[nameList[i] ] = {
humanName = UnitDefNames[nameList[i] ].humanName,
description = UnitDefNames[nameList[i] ].tooltip,
}
end
Spring.Echo(Spring.Utilities.TableToString(nameList, "nameList"))
Spring.Echo(Spring.Utilities.TableToString(humanNames, "humanNames"))
end

GenerateLists()
--]]

local function UnitOrder(name1, name2)
local data1 = name1 and humanNames[name1]
local data2 = name1 and humanNames[name2]
if not data1 then
return (data2 and true)
end
if not data2 then
return true
end

local category1 = categories[data1.category].order
local category2 = categories[data2.category].order
return category1 < category2 or (category1 == category2 and data1.order < data2.order)
end

return {
nameList = nameList,
humanNames = humanNames,
categories = categories,
UnitOrder = UnitOrder,
}
Loading