Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds extra QoL features to maintain weapon menu + fixes 2 bugs there. #409

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="windows-1251"?>
<string_table>

<string id="ui_mcm_menu_serious_weapon_maintain_features">
<text>Serious maintain features</text>
</string>

<string id="ui_mcm_sld">
<text>SERIOUS Weapon Maintain Features</text>
</string>

<string id="ui_mcm_sld_text">
<text>SERIOUS Weapon Maintain Features</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_cln_prt_cond_min">
<text>Clean all minimum condition</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_cln_prt_cond_min_desc">
<text>Determines the minimum part condition threshold (%) for batch cleaning weapon parts</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_rplc_prt_cond_min">
<text>Replace all minimum condition</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_rplc_prt_cond_min_desc">
<text>Determines the minimum part condition threshold (%) for batch replacing weapon parts</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_disable_maintain_all">
<text>Disable the "maintain all" option</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_disable_maintain_all_desc">
<text>If you never want to use "maintain all" or if you're an avid misclicker then this one is for you!</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_allow_clean_with_rep_kit">
<text>Allow "maintain all" to use repair kits for cleaning</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_allow_clean_with_rep_kit_desc">
<text>Maintain all consists of 3 steps: Clean all, Repair all and Repair uncleaned (When clean kits run out, but there are still parts left to clean)
Allows the "Repair uncleaned" step to consume charges of the repair kit to "replace parts".
The part condition would still have to be below or equal to the "Clean all minimum condition" option.</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_rplc_prio_barrel">
<text>Part replacing should prioritize barrel</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_rplc_prio_barrel_desc">
<text>The barrel will always be the first part to be replaced when batch replacing (if it is below or equal to the condition threshold configured).
"Maintain all" will take this into consideration too!</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_de_clutter_menu">
<text>De-clutter menu</text>
</string>

<string id="ui_mcm_serious_weapon_maintain_features_de_clutter_menu_desc">
<text>Removes the "&lt;= x %" part from the "clean all" and "replace all" menu options</text>
</string>

</string_table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

class "SeriousUICellPropertiesModified" (utils_ui.UICellProperties)

function SeriousUICellPropertiesModified:__init() super()

end

function SeriousUICellPropertiesModified:OnListItemDbClicked()
if self.list_box:GetSize()==0 then return end
local item = self.list_box:GetSelectedItem()
if not (item) then
return
end

if item.func then
if item.params then
pcall(item.func, unpack(item.params))
else
pcall(item.func)
end

self.action_moment = time_continual()
end

if (self:IsShown()) then
self:OnHide()
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function get_config(key)
if ui_mcm then return ui_mcm.get("serious_weapon_maintain_features/"..key) else return defaults[key] end
end

function on_mcm_load()
op = {
id = "serious_weapon_maintain_features",
sh = true,
gr =
{ -- options tree goes here
{ id = "sld", type = "slide", text = "ui_mcm_sld_text", link = "ui_options_slider_gameplay_diff", size = {512, 50}, spacing = 20},
{ id = "cln_prt_cond_min", type = "track", val = 2, min = 60, max = 98, def = 80, step= 1, size = {512, 50}, spacing = 20},
{ id = "rplc_prt_cond_min", type = "track", val = 2, min = 2, max = 59, def = 59, step= 1, size = {512, 50}, spacing = 20},
{ id = "disable_maintain_all", type = "check", val = 1, def = false},
{ id = "allow_clean_with_rep_kit", type = "check", val = 1, def = false},
{ id = "rplc_prio_barrel", type = "check", val = 1, def = true},
{ id = "de_clutter_menu", type = "check", val = 1, def = false},
}
}
return op
end
Loading