Skip to content

Commit 146b79d

Browse files
committed
Set some relevant and some potentially relevant CUS settings.
1 parent 2814fb9 commit 146b79d

2 files changed

Lines changed: 88 additions & 0 deletions

File tree

LuaIntro/main.lua

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
--------------------------------------------------------------------------------
2+
--------------------------------------------------------------------------------
3+
--
4+
-- file: main.lua
5+
-- brief: the entry point from LuaUI
6+
-- author: jK
7+
--
8+
-- Copyright (C) 2011-2013.
9+
-- Licensed under the terms of the GNU GPL, v2 or later.
10+
--
11+
--------------------------------------------------------------------------------
12+
--------------------------------------------------------------------------------
13+
14+
LUA_NAME = Script.GetName()
15+
LUA_DIRNAME = Script.GetName() .. "/"
16+
LUA_VERSION = Script.GetName() .. " v1.0"
17+
18+
_G[("%s_DIRNAME"):format(LUA_NAME:upper())] = LUA_DIRNAME -- creates LUAUI_DIRNAME
19+
_G[("%s_VERSION"):format(LUA_NAME:upper())] = LUA_VERSION -- creates LUAUI_VERSION
20+
21+
VFS.DEF_MODE = VFS.RAW_FIRST
22+
23+
24+
-------------------------------------------------------------------------------
25+
-------------------------------------------------------------------------------
26+
--
27+
-- Initialize the Lua LogSection (else messages with level "info" wouldn't been shown)
28+
--
29+
30+
if Spring.SetLogSectionFilterLevel then
31+
Spring.SetLogSectionFilterLevel(LUA_NAME, "info")
32+
else
33+
-- backward compatibility
34+
local origSpringLog = Spring.Log
35+
36+
Spring.Log = function(name, level, ...)
37+
if (type(level) == "string")and(level == "info") then
38+
Spring.Echo(("[%s]"):format(name), ...)
39+
else
40+
origSpringLog(name, level, ...)
41+
end
42+
end
43+
end
44+
45+
46+
-------------------------------------------------------------------------------
47+
-------------------------------------------------------------------------------
48+
--
49+
-- Load
50+
--
51+
52+
VFS.Include("LuaHandler/Utilities/utils.lua", nil, VFS.DEF_MODE)
53+
54+
--// the addon handler
55+
include "LuaHandler/handler.lua"
56+
57+
--// print Lua & LuaUI version
58+
Spring.Log(LUA_NAME, "info", LUA_VERSION .. " (" .. _VERSION .. ")")
59+
60+
-------------------------------------------------------------------------------
61+
-------------------------------------------------------------------------------
62+
63+
include "springconfig.lua"

LuaIntro/springconfig.lua

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--------------------------------------------------------------------------------------------
2+
--- set some spring settings before the game/engine is really loaded yet
3+
--------------------------------------------------------------------------------------------
4+
5+
-- set default unit rendering vars
6+
Spring.SetConfigFloat("tonemapA", 4.75)
7+
Spring.SetConfigFloat("tonemapB", 0.75)
8+
Spring.SetConfigFloat("tonemapC", 3.5)
9+
Spring.SetConfigFloat("tonemapD", 0.85)
10+
Spring.SetConfigFloat("tonemapE", 1.0)
11+
Spring.SetConfigFloat("envAmbient", 0.25)
12+
Spring.SetConfigFloat("unitSunMult", 1.0)
13+
Spring.SetConfigFloat("unitExposureMult", 1.0)
14+
Spring.SetConfigFloat("modelGamma", 1.0)
15+
16+
-- Sets necessary spring configuration parameters, so shaded units look the way they should (pbr gadget also does this)
17+
Spring.SetConfigInt("CubeTexGenerateMipMaps", 1)
18+
Spring.SetConfigInt("CubeTexSizeReflection", 1024)
19+
20+
-- disable grass
21+
Spring.SetConfigInt("GrassDetail", 0)
22+
23+
-- Revert BAR breaking the small font (which it doesn't seem to even draw anywhere)
24+
Spring.SetConfigInt("SmallFontSize", 14) -- Engine default
25+
Spring.SetConfigInt("UnitIconsAsUI", 0)

0 commit comments

Comments
 (0)