Skip to content

Commit dc5d9a2

Browse files
committed
Version 1.1
1 parent cbb563e commit dc5d9a2

31 files changed

+9006
-7633
lines changed

Main.lua

Lines changed: 101 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
_G.VoidUI = _G.VoidUI or {}
22
VoidUI.Warning = 0
3+
VoidUI.loaded = false
34
VoidUI.mod_path = ModPath
45
VoidUI.options_path = SavePath .. "VoidUI.txt"
56
VoidUI.options = {}
7+
VoidUI.menus = {}
68
VoidUI.hook_files = {
79
["lib/managers/hudmanager"] = {"HudManager.lua"},
810
["lib/managers/hud/hudteammate"] = {"HudTeammate.lua"},
@@ -13,8 +15,9 @@ VoidUI.hook_files = {
1315
["lib/managers/hudmanagerpd2"] = {"HudManager.lua", "HudScoreboard.lua"},
1416
["lib/units/beings/player/huskplayermovement"] = {"HudPlayerDowned.lua"},
1517
["lib/units/beings/player/states/playerbleedout"] = {"HudPlayerDowned.lua"},
16-
["lib/network/handlers/unitnetworkhandler"] = {"HudPlayerDowned.lua", "Jokers.lua"},
18+
["lib/network/handlers/unitnetworkhandler"] = {"HudPlayerDowned.lua", "jokers.lua"},
1719
["lib/units/equipment/doctor_bag/doctorbagbase"] = {"HudPlayerDowned.lua"},
20+
["lib/states/ingamemaskoff"] = {"HudManager.lua"},
1821
["lib/managers/hud/hudplayerdowned"] = {"HudPlayerDowned.lua"},
1922
["lib/managers/hud/hudobjectives"] = {"HudObjectives.lua"},
2023
["lib/managers/hud/hudheisttimer"] = {"HudHeistTimer.lua"},
@@ -26,7 +29,7 @@ VoidUI.hook_files = {
2629
["lib/managers/hud/hudinteraction"] = {"HudInteraction.lua"},
2730
["lib/managers/hud/hudchat"] = {"HudChat.lua"},
2831
["lib/managers/hud/hudassaultcorner"] = {"HudAssaultCorner.lua"},
29-
["lib/managers/group_ai_states/groupaistatebase"] = {"HudAssaultCorner.lua", "Jokers.lua"},
32+
["lib/managers/group_ai_states/groupaistatebase"] = {"HudAssaultCorner.lua", "jokers.lua"},
3033
["lib/managers/objectinteractionmanager"] = {"HudAssaultCorner.lua"},
3134
["lib/units/equipment/ecm_jammer/ecmjammerbase"] = {"HudAssaultCorner.lua"},
3235
["lib/units/contourext"] = {"Jokers.lua"},
@@ -37,28 +40,8 @@ VoidUI.hook_files = {
3740
["core/lib/managers/subtitle/coresubtitlepresenter"] = {"HudManager.lua"},
3841
["lib/managers/hud/hudwaitinglegend"] = {"HudManager.lua"},
3942
["lib/units/civilians/civiliandamage"] = {"HudScoreboard.lua"},
40-
["lib/managers/hud/hudstatsscreen"] = {"HudScoreboard.lua"}
41-
}
42-
VoidUI.disable_list = {
43-
["anim_badge"] = "show_badge",
44-
["health_jokers"] = "label_jokers",
45-
["label_minscale"] = "label_minmode",
46-
["label_minrank"] = "label_minmode",
47-
["label_minmode_dist"] = "label_minmode",
48-
["label_minmode_dot"] = "label_minmode",
49-
["scoreboard_character"] = "scoreboard",
50-
["scoreboard_skills"] = "scoreboard",
51-
["scoreboard_kills"] = "scoreboard",
52-
["scoreboard_specials"] = "scoreboard",
53-
["scoreboard_civs"] = "scoreboard",
54-
["scoreboard_downs"] = "scoreboard",
55-
["scoreboard_weapons"] = "scoreboard",
56-
["scoreboard_skins"] = "scoreboard",
57-
["scoreboard_armor"] = "scoreboard",
58-
["scoreboard_perk"] = "scoreboard",
59-
["scoreboard_playtime"] = "scoreboard",
60-
["scoreboard_ping"] = "scoreboard",
61-
["ping_frequency"] = "scoreboard"
43+
["lib/managers/hud/hudstatsscreen"] = {"HudScoreboard.lua"},
44+
["lib/units/player_team/teamaiinventory"] = {"HudManager.lua"},
6245
}
6346

6447
function VoidUI:Save()
@@ -105,6 +88,32 @@ Hooks:Add("LocalizationManagerPostInit", "VoidUI_Localization", function(loc)
10588
end)
10689
function VoidUI:DefaultConfig()
10790
VoidUI.options = {
91+
hud_scale = 1,
92+
hud_main_scale = 1,
93+
hud_mate_scale = 1,
94+
hud_chat_scale = 1,
95+
scoreboard_scale = 1,
96+
hud_assault_scale = 1,
97+
hud_objectives_scale = 1,
98+
presenter_scale = 1,
99+
suspicion_scale = 1,
100+
interact_scale = 1,
101+
hint_scale = 1,
102+
label_scale = 1,
103+
waypoint_scale = 0.8,
104+
subtitle_scale = 0.9,
105+
teammate_panels = true,
106+
enable_interact = true,
107+
enable_suspicion = true,
108+
enable_assault = true,
109+
enable_chat = true,
110+
enable_labels = true,
111+
enable_timer = true,
112+
enable_objectives = true,
113+
enable_presenter = true,
114+
enable_hint = true,
115+
enable_blackscreen = true,
116+
enable_subtitles = true,
108117
totalammo = true,
109118
main_loud = true,
110119
main_stealth = true,
@@ -119,6 +128,8 @@ function VoidUI:DefaultConfig()
119128
label_jokers = true,
120129
label_minmode = true,
121130
label_minrank = true,
131+
label_upper = false,
132+
mate_upper = false,
122133
label_waypoint_offscreen = true,
123134
chat_mouse = true,
124135
mate_interact = true,
@@ -130,7 +141,9 @@ function VoidUI:DefaultConfig()
130141
health_jokers = true,
131142
show_interact = true,
132143
scoreboard_blur = true,
144+
enable_stats = true,
133145
scoreboard = true,
146+
scoreboard_accuracy = true,
134147
scoreboard_character = true,
135148
scoreboard_skills = true,
136149
scoreboard_specials = true,
@@ -143,23 +156,19 @@ function VoidUI:DefaultConfig()
143156
scoreboard_ping = true,
144157
trophies = true,
145158
save_warning = false,
159+
presenter_sound = false,
160+
hint_color = true,
161+
hint_anim = true,
146162
scoreboard_skins = 2,
147163
scoreboard_kills = 3,
164+
show_objectives = 3,
165+
subtitles_bg = 2,
166+
show_timer = 3,
148167
ping_frequency = 2,
149168
jammers = 2,
150-
hud_scale = 1,
151-
hud_main_scale = 1,
152-
hud_mate_scale = 1,
153-
hud_chat_scale = 1,
154-
scoreboard_scale = 1,
155-
hud_assault_scale = 1,
156-
hud_objectives_scale = 1,
157-
suspicion_scale = 1,
158-
interact_scale = 1,
159-
waypoint_scale = 0.8,
160169
label_minscale = 1,
161-
label_scale = 1,
162170
hud_objective_history = 3,
171+
presenter_buffer = 5,
163172
label_minmode_dist = 7,
164173
label_minmode_dot = 1,
165174
chat_copy = 5,
@@ -171,27 +180,54 @@ function VoidUI:DefaultConfig()
171180
assault_lines = 3,
172181
waypoint_radius = 200,
173182
suspicion_y = 160,
174-
interact_y = 40
183+
interact_y = 40,
184+
main_anim_time = 0.2,
185+
mate_anim_time = 0.2
175186
}
176187

177188
end
178189

190+
if not VoidUI.loaded then
191+
VoidUI.loaded = true
192+
VoidUI:DefaultConfig()
193+
VoidUI:Load()
194+
VoidUI:LoadTextures()
195+
end
196+
197+
VoidUI.disable_list = {
198+
["show_badge"] = 1 ,
199+
["enable_assault"] = 6,
200+
["enable_chat"] = 5,
201+
["chat_mouse"] = 1,
202+
["teammate_panels"] = 21,
203+
["enable_interact"] = 3,
204+
["enable_suspicion"] = 2,
205+
["enable_labels"] = 9,
206+
["label_minmode"] = 4,
207+
["enable_timer"] = 4,
208+
["enable_objectives"] = 2,
209+
["enable_presenter"] = 3,
210+
["enable_hint"] = 3,
211+
["enable_stats"] = 17,
212+
["scoreboard"] = 14,
213+
["enable_subtitles"] = 2,
214+
}
215+
179216
function VoidUI:UpdateMenu()
180-
for _, file in pairs(SystemFS:list(VoidUI.mod_path.. "menu/")) do
181-
local menu_name = "VoidUI_".. file:gsub(".json", "")
182-
for _, item in pairs(MenuHelper:GetMenu(menu_name)._items_list) do
183-
if VoidUI.disable_list[item:parameters().name] then
184-
local disable_list_entry = VoidUI.disable_list[item:parameters().name]
185-
item:set_enabled(VoidUI.options[disable_list_entry])
217+
for _, menu_name in pairs(VoidUI.menus) do
218+
local menu_list = MenuHelper:GetMenu(menu_name)._items_list
219+
for key, item in pairs(menu_list) do
220+
if item:enabled() and VoidUI.disable_list[item:parameters().name] then
221+
for i = key + 1, key + VoidUI.disable_list[item:parameters().name] do
222+
if menu_list[i]._type ~= "divider" then menu_list[i]:set_enabled(VoidUI.options[item:parameters().name]) end
223+
end
186224
end
187225
if item._type == "slider" then
188-
local value = VoidUI.options[item:parameters().name]
189226
local step = item:parameters().step
190-
if step >= 1 and value ~= nil and step ~= nil then
191-
if value % step ~= 0 then
192-
item:set_value(value + (value % step >= 0.5 and 1 - value % step or -(value % step)))
193-
end
194-
end
227+
local decimals = 0
228+
if string.find(tostring(step), "0.") ~= nil then decimals = utf8.len(step) - 2 end
229+
item:set_decimal_count(decimals)
230+
item:set_value(item:raw_value_string())
195231
end
196232
end
197233
end
@@ -200,38 +236,19 @@ end
200236
Hooks:Add("MenuManagerInitialize", "MenuManagerInitialize_VoidUI", function(menu_manager)
201237
MenuCallbackHandler.callback_VoidUI_hudscale = function(self, item)
202238
VoidUI.options.hud_scale = item:value()
203-
VoidUI.options.hud_main_scale = item:value()
204-
VoidUI.options.hud_mate_scale = item:value()
205-
VoidUI.options.hud_objectives_scale = item:value()
206-
VoidUI.options.hud_assault_scale = item:value()
207-
VoidUI.options.hud_chat_scale = item:value()
208-
local hudteammate = MenuHelper:GetMenu("VoidUI_hudteammate")
209-
if hudteammate then
210-
hudteammate._items_list[2]:set_value(item:value())
211-
hudteammate._items_list[11]:set_value(item:value())
212-
end
213-
local objectives = MenuHelper:GetMenu("VoidUI_objectives")
214-
if objectives then
215-
objectives._items_list[1]:set_value(item:value())
216-
end
217-
local assault = MenuHelper:GetMenu("VoidUI_assault")
218-
if assault then
219-
assault._items_list[1]:set_value(item:value())
220-
end
221-
local chat = MenuHelper:GetMenu("VoidUI_chat")
222-
if assault then
223-
chat._items_list[1]:set_value(item:value())
224-
end
225-
local interact = MenuHelper:GetMenu("VoidUI_interact")
226-
if interact then
227-
interact._items_list[2]:set_value(item:value())
228-
interact._items_list[7]:set_value(item:value())
229-
end
230-
local scoreboard = MenuHelper:GetMenu("VoidUI_scoreboard")
231-
if scoreboard then
232-
scoreboard._items_list[1]:set_value(item:value())
239+
local scales = {"hud_main_scale", "hud_mate_scale", "hud_objectives_scale", "hud_assault_scale", "hud_chat_scale", "scoreboard_scale", "presenter_scale", "hint_scale", "suspicion_scale", "interact_scale"}
240+
for _, menu_name in pairs(VoidUI.menus) do
241+
for _, menu_item in pairs(MenuHelper:GetMenu(menu_name)._items_list) do
242+
for _, v in pairs(scales) do
243+
if v == menu_item:parameters().name then
244+
menu_item:set_value(item:value())
245+
VoidUI.options[menu_item:parameters().name] = item:value()
246+
end
247+
end
248+
end
233249
end
234250
if VoidUI.Warning == 0 then VoidUI.Warning = 1 end
251+
VoidUI:UpdateMenu()
235252
end
236253
MenuCallbackHandler.basic_option_clbk = function(self, item)
237254
VoidUI.options[item:parameters().name] = item:value()
@@ -251,8 +268,7 @@ Hooks:Add("MenuManagerInitialize", "MenuManagerInitialize_VoidUI", function(menu
251268
text = managers.localization:text("dialog_yes"),
252269
callback = function(self, item)
253270
VoidUI:DefaultConfig()
254-
for _, file in pairs(SystemFS:list(VoidUI.mod_path.. "menu/")) do
255-
local menu_name = "VoidUI_".. file:gsub(".json", "")
271+
for _, menu_name in pairs(VoidUI.menus) do
256272
for _, item in pairs(MenuHelper:GetMenu(menu_name)._items_list) do
257273
local value = VoidUI.options[item:parameters().name]
258274
if value then
@@ -296,19 +312,17 @@ Hooks:Add("MenuManagerInitialize", "MenuManagerInitialize_VoidUI", function(menu
296312
QuickMenu:new(managers.localization:text("VoidUI_warning_title"), managers.localization:text("VoidUI_warning_desc"), buttons, true )
297313
end
298314
end
299-
300-
VoidUI:DefaultConfig()
301-
VoidUI:Load()
302-
315+
local menus = SystemFS:list(VoidUI.mod_path.. "menu/")
303316
MenuHelper:LoadFromJsonFile(VoidUI.mod_path .. "menu/options.json", VoidUI, VoidUI.options)
304-
for _, file in pairs(SystemFS:list(VoidUI.mod_path.. "menu/")) do
305-
MenuHelper:LoadFromJsonFile(VoidUI.mod_path .. "menu/"..file, VoidUI, VoidUI.options)
317+
table.insert(VoidUI.menus, "VoidUI_options")
318+
for i=#menus, 1, -1 do
319+
MenuHelper:LoadFromJsonFile(VoidUI.mod_path .. "menu/"..menus[i], VoidUI, VoidUI.options)
320+
table.insert(VoidUI.menus, "VoidUI_"..menus[i]:gsub(".json", ""))
306321
end
307322
end )
308323

309324
Hooks:Add("MenuManagerBuildCustomMenus", "MenuManagerBuildCustomMenus_VoidUI", function(menu_manager, nodes)
310325
VoidUI:UpdateMenu()
311-
VoidUI:LoadTextures()
312326
end)
313327

314328
function MenuManager:toggle_chatinput()

changelog.txt

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
1-
Version 1.0
1+
Version 1.1 (2017.10.15)
2+
- Modified how the icons panel of the assault ticker works for better addon support
3+
- Added the option to disable hud elements
4+
- Added main player accuracy to scoreboard panel
5+
- Added the option to change the speed of the health gain/loss animation
6+
- Added the option to hide the timer and objective panels or only show them when the tabpanel is open
7+
- Added the option to show names in uppercase
8+
- Added notification and hint text options
9+
- Added subtitle options
10+
- Added Russian localization made by Skyfrost
11+
- Added French localization made by Esawo
12+
- Added compatibility with Press2Hold
13+
- Added compatibility with Big Lobby
14+
- Added compatibility with Assault States
15+
- Added compatibility with Burst Fire
16+
- Added compatibility with Death Wish+
17+
- Improved options menu
18+
- Fixed bot loadout sometimes not showing correctly
19+
- Fixed textures and default options not loading when another mod breaks the options menu
20+
- Fixed a crash related to the assault panel
21+
- Fixed the hostages panel sometimes not playing the assault end animation
22+
- Fixed a rare crash related to beardlib custom music
23+
- Fixed chat messages not being colored correctly when the heister names are turned off
24+
- Fixed teammates bleedout timers and interaction texts not being effected by hud scale
25+
- Fixed mutators list on the tab panel not being affected by hud scale
26+
- Fixed the heist timer going nuts after the one hour mark when the panel is scaled
27+
- Fixed waypoints being infront of some parts of the assault panel
28+
- Fixed police badge appearing after you kill the captain when the badge is turned off
29+
30+
Version 1.0 (2017.09.29)
231
- Civilian kills now increment the normal kill counter as well
332
- Fixed ex-president heal bar being retarded
433
- Fixed scoreboard panels not being correctly aligned when there are no bots

0 commit comments

Comments
 (0)