Added New Mods; Swapped Mods and Removed Some
Removed EGUI in favor of UI Rework by Sota Added in GTR Optimized for higher res textures, over Zone Reality Remade and removed all files that conflicted from ZRR to save storage space.
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
op = {
|
||||
id = "better_stats_bars", sh = true, gr = {
|
||||
{id = "banner", type = "slide", text = "ui_mcm_better_stats_bars_title", size = {512, 50}, spacing = 20},
|
||||
{id = "positive_color_help", type = "desc", clr = {200, 200, 255, 200}, text = "ui_mcm_better_stats_bars_positive_color_help"},
|
||||
{id = "positive_color_a", type = "track", val = 2, min = 0, max = 255, step = 1, def = 255},
|
||||
{id = "positive_color_r", type = "track", val = 2, min = 0, max = 255, step = 1, def = 0},
|
||||
{id = "positive_color_g", type = "track", val = 2, min = 0, max = 255, step = 1, def = 255},
|
||||
{id = "positive_color_b", type = "track", val = 2, min = 0, max = 255, step = 1, def = 0},
|
||||
{id = "divider", type = "line"},
|
||||
{id = "negative_color_help", type = "desc", clr = {200, 200, 255, 200}, text = "ui_mcm_better_stats_bars_negative_color_help"},
|
||||
{id = "negative_color_a", type = "track", val = 2, min = 0, max = 255, step = 1, def = 255},
|
||||
{id = "negative_color_r", type = "track", val = 2, min = 0, max = 255, step = 1, def = 255},
|
||||
{id = "negative_color_g", type = "track", val = 2, min = 0, max = 255, step = 1, def = 0},
|
||||
{id = "negative_color_b", type = "track", val = 2, min = 0, max = 255, step = 1, def = 0},
|
||||
{id = "divider", type = "line"},
|
||||
{id = "neutral_color_help", type = "desc", clr = {200, 200, 255, 200}, text = "ui_mcm_better_stats_bars_neutral_color_help"},
|
||||
{id = "neutral_color_a", type = "track", val = 2, min = 0, max = 255, step = 1, def = 255},
|
||||
{id = "neutral_color_r", type = "track", val = 2, min = 0, max = 255, step = 1, def = 100},
|
||||
{id = "neutral_color_g", type = "track", val = 2, min = 0, max = 255, step = 1, def = 100},
|
||||
{id = "neutral_color_b", type = "track", val = 2, min = 0, max = 255, step = 1, def = 100},
|
||||
{id = "divider", type = "line"},
|
||||
|
||||
{id = "position", type="list", val=0, def="bottom", content={
|
||||
{"bottom", "better_stats_bars_position_bottom"},
|
||||
{"top", "better_stats_bars_position_top"},
|
||||
{"justify", "better_stats_bars_position_justify"},
|
||||
}},
|
||||
{id = "use_game_values", type="list", val=0, def="max", content={
|
||||
{"none", "better_stats_bars_use_game_values_none"},
|
||||
{"max", "better_stats_bars_use_game_values_max"},
|
||||
{"max_no_mines", "better_stats_bars_use_game_values_max_no_mines"},
|
||||
-- {"middle", "better_stats_bars_use_game_values_middle"},
|
||||
-- {"median", "better_stats_bars_use_game_values_median"},
|
||||
}},
|
||||
{id = "arx_compatibility", type = "check", val = 1, def = false},
|
||||
{id = "abf_compatibility", type = "check", val = 1, def = false},
|
||||
{id = "acid_bar_fix", type = "check", val = 1, def = true},
|
||||
{id = "divider", type = "line"},
|
||||
|
||||
{id = "efp_ui_compatibility", type = "check", val = 1, def = false},
|
||||
-- {id = "gamma_ui_compatibility", type = "check", val = 1, def = false},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function on_mcm_load()
|
||||
return op
|
||||
end
|
||||
@@ -0,0 +1,228 @@
|
||||
--[[
|
||||
MCM script made for EFP UI
|
||||
Author: HarukaSai
|
||||
|
||||
08/04/2022
|
||||
]]
|
||||
|
||||
local mcm_id = "efp_ui"
|
||||
local string_format = string.format
|
||||
|
||||
local faction_color_defs = {
|
||||
["stalker"] = { a = 255, r = 228, g = 185, b = 69 },
|
||||
["bandit"] = { a = 255, r = 217, g = 217, b = 217 },
|
||||
["csky"] = { a = 255, r = 0, g = 182, b = 222 },
|
||||
["dolg"] = { a = 255, r = 193, g = 32, b = 38 },
|
||||
["freedom"] = { a = 255, r = 79, g = 162, b = 69 },
|
||||
["killer"] = { a = 255, r = 3, g = 94, b = 168 },
|
||||
["army"] = { a = 255, r = 184, g = 153, b = 84 },
|
||||
["ecolog"] = { a = 255, r = 67, g = 134, b = 120 },
|
||||
["monolith"] = { a = 255, r = 81, g = 231, b = 241 },
|
||||
["renegade"] = { a = 255, r = 30, g = 123, b = 48 },
|
||||
["greh"] = { a = 255, r = 255, g = 93, b = 0 },
|
||||
["isg"] = { a = 255, r = 145, g = 5, b = 0 }
|
||||
}
|
||||
|
||||
local faction_color_text_defs = {
|
||||
["stalker"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["bandit"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["csky"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["dolg"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["freedom"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["killer"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["army"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["ecolog"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["monolith"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["renegade"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["greh"] = { a = 255, r = 255, g = 232, b = 208 },
|
||||
["isg"] = { a = 255, r = 255, g = 232, b = 208 }
|
||||
}
|
||||
|
||||
local stat_defs = {
|
||||
["health"] = { a = 255, r = 255, g = 0, b = 0 },
|
||||
["radia"] = { a = 255, r = 253, g = 208, b = 23 },
|
||||
["acid"] = { a = 255, r = 0, g = 255, b = 0 },
|
||||
["shock"] = { a = 255, r = 255, g = 255, b = 0 },
|
||||
["fire"] = { a = 255, r = 255, g = 0, b = 128 },
|
||||
["psi"] = { a = 255, r = 0, g = 255, b = 255 },
|
||||
["wound"] = { a = 255, r = 255, g = 255, b = 255 },
|
||||
["fire_wound"] = { a = 255, r = 255, g = 128, b = 0 },
|
||||
["power"] = { a = 255, r = 128, g = 255, b = 255 },
|
||||
["hunger"] = { a = 255, r = 165, g = 137, b = 193 },
|
||||
["thirst"] = { a = 255, r = 154, g = 206, b = 223 },
|
||||
["sleep"] = { a = 255, r = 253, g = 222, b = 238 }
|
||||
}
|
||||
|
||||
local slot_cell_defs = { -- base slot = {UI slots to fit in}
|
||||
["belt"] = { string = "belt", a = 255, r = 255, g = 0, b = 147 },
|
||||
["quick"] = { string = "quick", a = 255, r = 21, g = 236, b = 135 },
|
||||
[1] = { string = "knife", a = 255, r = 185, g = 70, b = 255 }, -- Knife
|
||||
[2] = { string = "pistol", a = 255, r = 255, g = 216, b = 0 }, -- Pistol
|
||||
[3] = { string = "rifle", a = 255, r = 255, g = 126, b = 70 }, -- Rifle
|
||||
[4] = { string = "grenade", a = 255, r = 255, g = 0, b = 0 }, -- Grenade
|
||||
[5] = { string = "binoculars", a = 255, r = 75, g = 181, b = 255 }, -- Binoculars
|
||||
[6] = { string = "bolt", a = 255, r = 234, g = 70, b = 150 }, -- Bolt
|
||||
[7] = { string = "outfit", a = 255, r = 70, g = 103, b = 234 }, -- Outfit
|
||||
[8] = { string = "pda", a = 255, r = 0, g = 193, b = 255 }, -- PDA
|
||||
[9] = { string = "detector", a = 255, r = 0, g = 108, b = 255 }, -- Detector
|
||||
[10] = { string = "torch", a = 255, r = 59, g = 244, b = 146 }, -- Torch
|
||||
[12] = { string = "helmet", a = 255, r = 122, g = 0, b = 244 }, -- Helmet
|
||||
[13] = { string = "backpack", a = 255, r = 236, g = 197, b = 32 }, -- Backpack
|
||||
}
|
||||
|
||||
local faction_banner_defs = { a = 255, r = 39, g = 39, b = 160 }
|
||||
local faction_banner_text_defs = { a = 255, r = 255, g = 232, b = 208 }
|
||||
|
||||
function get_faction_color_template(faction)
|
||||
local template = {
|
||||
id = faction, sh = true, gr = {
|
||||
{ id = "title", type= "slide", link= "ui_options_slider_warfare", text= "ui_mcm_menu_" .. mcm_id, size= {512,50},spacing= 20 },
|
||||
{ id = "desc_faction_color", type = "desc", text = "ui_mcm_desc_faction_banner_color"},
|
||||
{ id = "color_red" , hint = mcm_id .. "_red" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_defs[faction].r},
|
||||
{ id = "color_green", hint = mcm_id .. "_green" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_defs[faction].g},
|
||||
{ id = "color_blue" , hint = mcm_id .. "_blue" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_defs[faction].b},
|
||||
{ id = "color_alpha", hint = mcm_id .. "_alpha" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_defs[faction].a},
|
||||
{ id = "divider", type = "line" },
|
||||
{ id = "desc_faction_text_color", type = "desc", text = "ui_mcm_desc_faction_text_color"},
|
||||
{ id = "color_red_text" , hint = mcm_id .. "_red" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_text_defs[faction].r},
|
||||
{ id = "color_green_text", hint = mcm_id .. "_green" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_text_defs[faction].g},
|
||||
{ id = "color_blue_text" , hint = mcm_id .. "_blue" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_text_defs[faction].b},
|
||||
{ id = "color_alpha_text", hint = mcm_id .. "_alpha" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_color_text_defs[faction].a},
|
||||
}
|
||||
}
|
||||
return template
|
||||
end
|
||||
|
||||
function get_stats_color_template(stat)
|
||||
local template = {
|
||||
{ id = "desc" .. stat, type = "desc", text = "ui_mcm_desc_stat_" .. stat},
|
||||
{ id = "color_red" .. stat, hint = mcm_id .. "_red" , type = "track", val = 2, min = 0, max = 255, step = 1, def = stat_defs[stat].r},
|
||||
{ id = "color_green" .. stat, hint = mcm_id .. "_green" , type = "track", val = 2, min = 0, max = 255, step = 1, def = stat_defs[stat].g},
|
||||
{ id = "color_blue" .. stat, hint = mcm_id .. "_blue" , type = "track", val = 2, min = 0, max = 255, step = 1, def = stat_defs[stat].b},
|
||||
{ id = "color_alpha" .. stat, hint = mcm_id .. "_alpha" , type = "track", val = 2, min = 0, max = 255, step = 1, def = stat_defs[stat].a},
|
||||
{ id = "divider", type = "line" }
|
||||
}
|
||||
return template
|
||||
end
|
||||
|
||||
module_settings = {}
|
||||
|
||||
function add_module_settings(t)
|
||||
module_settings[#module_settings + 1] = t
|
||||
end
|
||||
|
||||
function get_module_settings(path)
|
||||
return ui_mcm.get(string_format("%s/modules_settings/%s", mcm_id, path))
|
||||
end
|
||||
|
||||
function get_slot_cell_template(slot)
|
||||
local template = {
|
||||
{ id = "desc" .. slot_cell_defs[slot].string, type = "desc", text = "ui_mcm_desc_cell_" .. slot_cell_defs[slot].string},
|
||||
{ id = "color_red" .. slot, hint = mcm_id .. "_red" , type = "track", val = 2, min = 0, max = 255, step = 1, def = slot_cell_defs[slot].r},
|
||||
{ id = "color_green" .. slot, hint = mcm_id .. "_green" , type = "track", val = 2, min = 0, max = 255, step = 1, def = slot_cell_defs[slot].g},
|
||||
{ id = "color_blue" .. slot, hint = mcm_id .. "_blue" , type = "track", val = 2, min = 0, max = 255, step = 1, def = slot_cell_defs[slot].b},
|
||||
{ id = "color_alpha" .. slot, hint = mcm_id .. "_alpha" , type = "track", val = 2, min = 0, max = 255, step = 1, def = slot_cell_defs[slot].a},
|
||||
{ id = "divider", type = "line" }
|
||||
}
|
||||
return template
|
||||
end
|
||||
|
||||
function on_mcm_load()
|
||||
local options = { id = mcm_id, gr = {{ id = "faction_settings", gr = {} }} }
|
||||
options.gr[1] = { id = "main_settings", sh = true, gr = {
|
||||
{ id = "title", type= "slide", link= "ui_options_slider_warfare", text= "ui_mcm_menu_" .. mcm_id, size= {512,50},spacing = 20 },
|
||||
-- Edited by Sota
|
||||
-- { id = "use_alt_ranks", hint = mcm_id .. "_use_alt_ranks", val = 1, type = "check", def = false},
|
||||
{ id = "use_alt_ranks", hint = mcm_id .. "_use_alt_ranks", type = "list", val = 2, content = { {0, "rank_icons"} , {1, "rank_icons_mui"}, {2, "rank_icons_svui"}, {3, "rank_icons_svui_alt"}}, def = 0},
|
||||
|
||||
}}
|
||||
options.gr[2] = { id = "faction_settings", gr = {} }
|
||||
options.gr[3] = {
|
||||
id = "base_settings", gr = {
|
||||
{id = "slots", sh = true, gr = {
|
||||
{ id = "title", type= "slide", link= "ui_options_slider_warfare", text= "ui_mcm_menu_" .. mcm_id, size= {512,50},spacing = 20 },
|
||||
{ id = "use_faction", hint = mcm_id .. "_use_faction", val = 1, type = "check", def = true },
|
||||
{ id = "divider", type = "line" }
|
||||
}},
|
||||
{id = "stats", sh = true, gr = {
|
||||
{ id = "title", type= "slide", link= "ui_options_slider_warfare", text= "ui_mcm_menu_" .. mcm_id, size= {512,50},spacing = 20 },
|
||||
{ id = "use_faction", hint = mcm_id .. "_use_faction", val = 1, type = "check", def = true },
|
||||
{ id = "divider", type = "line" }
|
||||
}},
|
||||
{id = "faction_banner", sh = true, gr = {
|
||||
{ id = "title", type= "slide", link= "ui_options_slider_warfare", text= "ui_mcm_menu_" .. mcm_id, size= {512,50},spacing = 20 },
|
||||
{ id = "desc_faction_color", type = "desc", text = "ui_mcm_desc_faction_banner_color"},
|
||||
{ id = "use_faction", hint = mcm_id .. "_use_faction", val = 1, type = "check", def = true },
|
||||
{ id = "color_red" , hint = mcm_id .. "_red" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_defs.r},
|
||||
{ id = "color_green", hint = mcm_id .. "_green" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_defs.g},
|
||||
{ id = "color_blue" , hint = mcm_id .. "_blue" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_defs.b},
|
||||
{ id = "color_alpha", hint = mcm_id .. "_alpha" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_defs.a},
|
||||
{ id = "divider", type = "line" },
|
||||
{ id = "desc_faction_text_color", type = "desc", text = "ui_mcm_desc_faction_text_color"},
|
||||
{ id = "use_faction_text", hint = mcm_id .. "_use_faction", val = 1, type = "check", def = true },
|
||||
{ id = "color_red_text" , hint = mcm_id .. "_red" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_text_defs.r},
|
||||
{ id = "color_green_text", hint = mcm_id .. "_green" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_text_defs.g},
|
||||
{ id = "color_blue_text" , hint = mcm_id .. "_blue" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_text_defs.b},
|
||||
{ id = "color_alpha_text", hint = mcm_id .. "_alpha" , type = "track", val = 2, min = 0, max = 255, step = 1, def = faction_banner_text_defs.a},
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
if not is_empty(module_settings) then -- add modules if there's any
|
||||
options.gr[4] = { id = "modules_settings", gr = module_settings }
|
||||
end
|
||||
|
||||
for faction, _ in pairs(faction_color_defs) do
|
||||
options.gr[2].gr[#options.gr[2].gr + 1] = get_faction_color_template(faction)
|
||||
end
|
||||
for slot, _ in pairs(slot_cell_defs) do
|
||||
local slot_template = get_slot_cell_template(slot)
|
||||
for key = 1, #slot_template do
|
||||
options.gr[3].gr[1].gr[#options.gr[3].gr[1].gr + 1] = slot_template[key]
|
||||
end
|
||||
end
|
||||
for stat, _ in pairs(stat_defs) do
|
||||
local stat_template = get_stats_color_template(stat)
|
||||
for key = 1, #stat_template do
|
||||
options.gr[3].gr[2].gr[#options.gr[3].gr[2].gr + 1] = stat_template[key]
|
||||
end
|
||||
end
|
||||
return options
|
||||
end
|
||||
|
||||
function on_option_change()
|
||||
if not ui_mcm then return end
|
||||
for faction, _ in pairs(faction_color_defs) do
|
||||
ui_inventory.faction_color[faction] = get_colors_for_path(string_format("%s/faction_settings/%s", mcm_id, faction), "")
|
||||
ui_inventory.faction_text_colors[faction] = get_colors_for_path(string_format("%s/faction_settings/%s", mcm_id, faction), "_text")
|
||||
end
|
||||
for slot, _ in pairs(slot_cell_defs) do
|
||||
ui_inventory.slot_colors[slot] = get_colors_for_path(string_format("%s/base_settings/slots", mcm_id), slot)
|
||||
end
|
||||
for stat, _ in pairs(stat_defs) do
|
||||
ui_inventory.stat_colors[stat] = get_colors_for_path(string_format("%s/base_settings/stats", mcm_id), stat)
|
||||
end
|
||||
ui_inventory.banner_color = get_colors_for_path(string_format("%s/base_settings/faction_banner", mcm_id), "")
|
||||
ui_inventory.player_faction_color = get_colors_for_path(string_format("%s/base_settings/faction_banner", mcm_id), "_text")
|
||||
ui_inventory.color_settings = {
|
||||
["stat_colors"] = ui_mcm.get(string_format("%s/base_settings/stats/use_faction", mcm_id)),
|
||||
["banner_color"] = ui_mcm.get(string_format("%s/base_settings/faction_banner/use_faction", mcm_id)),
|
||||
["slot_colors"] = ui_mcm.get(string_format("%s/base_settings/slots/use_faction", mcm_id)),
|
||||
["use_alt_ranks"] = ui_mcm.get(string_format("%s/main_settings/use_alt_ranks", mcm_id)),
|
||||
["text_color"] = ui_mcm.get(string_format("%s/base_settings/faction_banner/use_faction_text", mcm_id))
|
||||
}
|
||||
end
|
||||
|
||||
function get_colors_for_path(path, str)
|
||||
return GetARGB(
|
||||
ui_mcm.get(string_format("%s/color_alpha%s", path, str)),
|
||||
ui_mcm.get(string_format("%s/color_red%s", path, str)),
|
||||
ui_mcm.get(string_format("%s/color_green%s", path, str)),
|
||||
ui_mcm.get(string_format("%s/color_blue%s", path, str))
|
||||
)
|
||||
end
|
||||
|
||||
function on_game_start()
|
||||
RegisterScriptCallback("on_option_change", on_option_change)
|
||||
on_option_change()
|
||||
end
|
||||
@@ -0,0 +1,214 @@
|
||||
--[[
|
||||
HUD = nil
|
||||
|
||||
function activate_hud(gui)
|
||||
|
||||
-- open with inventory only
|
||||
if gui ~= "UIInventory" then
|
||||
return
|
||||
end
|
||||
|
||||
-- check for inventory gui
|
||||
if not (ui_inventory and ui_inventory.GUI) then
|
||||
return
|
||||
end
|
||||
|
||||
-- disable inventory power bar
|
||||
if ui_inventory.GUI.stat and ui_inventory.GUI.stat["power"] and ui_inventory.GUI.stat["power"].base then
|
||||
ui_inventory.GUI.stat["power"].base:Show(false)
|
||||
end
|
||||
|
||||
-- show hud
|
||||
if HUD == nil then
|
||||
HUD = hts_tooltips()
|
||||
get_hud():AddDialogToRender(HUD)
|
||||
HUD:Update_Bars(true)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function deactivate_hud(gui)
|
||||
-- if gui ~= "UIInventory" then return end
|
||||
|
||||
if HUD ~= nil then
|
||||
get_hud():RemoveDialogToRender(HUD)
|
||||
HUD = nil
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
class "hts_tooltips" (CUIScriptWnd)
|
||||
function hts_tooltips:__init() super()
|
||||
self:InitControls()
|
||||
end
|
||||
|
||||
function hts_tooltips:InitControls()
|
||||
self:SetWndRect(Frect():set(0,0,1024,768))
|
||||
self:SetAutoDelete(true)
|
||||
|
||||
self.xml = CScriptXmlInit()
|
||||
local xml = self.xml
|
||||
xml:ParseFile("ui_new_bars.xml")
|
||||
|
||||
self.hts_t = {
|
||||
[1] = { "satiety", get_satiety_val },
|
||||
[2] = { "thirst", get_thirst_val },
|
||||
[3] = { "sleep", get_sleep_val },
|
||||
}
|
||||
|
||||
-- timer
|
||||
self.tmr = 0
|
||||
|
||||
-- build elements
|
||||
self.elems = self.elems or {}
|
||||
|
||||
for i = 1, 3 do
|
||||
|
||||
self.elems[i] = self.elems[i] or {}
|
||||
|
||||
-- bars
|
||||
self.elems[i].bar_wnd = xml:InitStatic(self.hts_t[i][1] .. "_wnd", self)
|
||||
self.elems[i].bar = xml:InitStatic(self.hts_t[i][1] .. "_wnd:bar", self.elems[i].bar_wnd)
|
||||
|
||||
-- default bar width, height
|
||||
self.elems[i].width = self.elems[i].bar:GetWidth()
|
||||
self.elems[i].height = self.elems[i].bar:GetHeight()
|
||||
|
||||
-- default bar texture rect (full bar = x2 - x1)
|
||||
self.elems[i].rect_x1 = self.elems[i].bar:GetTextureRect().x1
|
||||
self.elems[i].rect_y1 = self.elems[i].bar:GetTextureRect().y1
|
||||
self.elems[i].rect_x2 = self.elems[i].bar:GetTextureRect().x2
|
||||
self.elems[i].rect_y2 = self.elems[i].bar:GetTextureRect().y2
|
||||
|
||||
-- tooltip
|
||||
self.elems[i].tooltip = xml:InitStatic(self.hts_t[i][1] .. "_wnd:tooltip", self.elems[i].bar_wnd)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function hts_tooltips:Update()
|
||||
CUIScriptWnd.Update(self)
|
||||
|
||||
-- disable bars when in picker window
|
||||
local picker_enabled = ui_inventory.GUI and ui_inventory.GUI.CC and ui_inventory.GUI.CC["picker"] and ui_inventory.GUI.CC["picker"]:IsShown()
|
||||
for i = 1, #self.elems do
|
||||
self.elems[i].bar_wnd:Show( (not picker_enabled) )
|
||||
end
|
||||
|
||||
local tg = time_global()
|
||||
if (tg < self.tmr) then return end
|
||||
self.tmr = tg + 50
|
||||
|
||||
self:Update_Bars()
|
||||
|
||||
end
|
||||
|
||||
function hts_tooltips:Update_Bars()
|
||||
|
||||
local pos = GetCursorPosition()
|
||||
|
||||
for i = 1, #self.elems do
|
||||
|
||||
local elem = self.elems[i]
|
||||
|
||||
-- update bars
|
||||
if elem.bar then
|
||||
-- set new x2 rect
|
||||
local x1 = elem.rect_x1
|
||||
local x2 = x1 + ( (elem.rect_x2 - x1) * self.hts_t[i][2]())
|
||||
self.elems[i].bar:SetTextureRect(Frect():set( x1, elem.rect_y1, x2, elem.rect_y2 ))
|
||||
|
||||
-- set new width
|
||||
local width = elem.width * self.hts_t[i][2]()
|
||||
self.elems[i].bar:SetWndSize(vector2():set( width, elem.height ))
|
||||
end
|
||||
|
||||
-- update tooltip
|
||||
self.elems[i].tooltip:Show(false)
|
||||
if elem.tooltip then
|
||||
local p, w, h = elem.bar_wnd:GetWndPos(), elem.bar_wnd:GetWidth(), elem.bar_wnd:GetHeight()
|
||||
local pos_true = pos.x > p.x and pos.y > p.y and pos.x < (p.x + w) and pos.y < (p.y + h)
|
||||
if pos_true then
|
||||
self.elems[i].tooltip:Show(true)
|
||||
self.elems[i].tooltip:TextControl():SetText( math.ceil(self.hts_t[i][2]() * 100) .. " %" )
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function hts_tooltips:__finalize()
|
||||
end
|
||||
--]]
|
||||
-------------------------- misc --------------------------
|
||||
function get_red_thirst()
|
||||
local max_thirst = get_local_val([[gamedata\scripts\actor_status_thirst.script]], "actor_status_thirst", "local start_blur_4") or 5760
|
||||
return max_thirst
|
||||
end
|
||||
|
||||
function get_red_sleep()
|
||||
local max_sleep = get_local_val([[gamedata\scripts\actor_status_sleep.script]], "actor_status_sleep", "local start_blur_4") or 8750
|
||||
return max_sleep
|
||||
end
|
||||
|
||||
function get_local_val(path, script_name, str_to_find)
|
||||
if _G[script_name] then
|
||||
|
||||
if not file_exists(path) then
|
||||
return
|
||||
end
|
||||
|
||||
for line in io.lines(path) do
|
||||
if string.find(line, str_to_find) then
|
||||
_,_, loc_val = string.find(line, "start_blur_4%s*=%s*(%d+)")
|
||||
if type(tonumber(loc_val)) == "number" then
|
||||
return loc_val
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function file_exists(name)
|
||||
local f = io.open(name, "r")
|
||||
if f ~= nil then
|
||||
io.close(f)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function get_satiety_val()
|
||||
local conditions = db.actor:cast_Actor():conditions()
|
||||
local satiety = conditions:GetSatiety()
|
||||
local red_icon_satiety = conditions:SatietyCritical() * 0.5
|
||||
satiety = normalize(satiety, red_icon_satiety, 1)
|
||||
return satiety
|
||||
end
|
||||
|
||||
function get_thirst_val()
|
||||
local thirst = 1 - actor_status_thirst.get_water_deprivation()
|
||||
local red_icon_thirst = get_red_thirst()
|
||||
red_icon_thirst = 1 - normalize(red_icon_thirst, 0, 10000)
|
||||
thirst = normalize(thirst, red_icon_thirst, 1)
|
||||
return thirst
|
||||
end
|
||||
|
||||
function get_sleep_val()
|
||||
local sleep = 1 - actor_status_sleep.get_sleep_deprivation()
|
||||
local red_icon_sleep = get_red_sleep()
|
||||
red_icon_sleep = 1 - normalize(red_icon_sleep, 0, 10000)
|
||||
sleep = normalize(sleep, red_icon_sleep, 1)
|
||||
return sleep
|
||||
end
|
||||
|
||||
--[[
|
||||
function on_game_start()
|
||||
RegisterScriptCallback("GUI_on_show", activate_hud)
|
||||
RegisterScriptCallback("GUI_on_hide", deactivate_hud)
|
||||
end
|
||||
--]]
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
function on_xml_read()
|
||||
if not utils_ui_demonized_inventory_weights then
|
||||
return
|
||||
end
|
||||
|
||||
RegisterScriptCallback("on_xml_read", function(xml_file_name, xml_obj)
|
||||
if xml_file_name == [[ui\ui_inventory.xml]]
|
||||
or xml_file_name == [[ui\ui_inventory_16.xml]]
|
||||
or xml_file_name == [[ui\ui_inventory_21.xml]]
|
||||
then
|
||||
for i=1,13 do
|
||||
local res = xml_obj:query("equipment > cont_equ > cell_" .. i .. " > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {align="r"})
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,37 @@
|
||||
function on_xml_read()
|
||||
RegisterScriptCallback("on_xml_read", function(xml_file_name, xml_obj)
|
||||
if xml_file_name == [[ui\ui_inventory.xml]]
|
||||
or xml_file_name == [[ui\ui_inventory_16.xml]]
|
||||
or xml_file_name == [[ui\ui_inventory_21.xml]]
|
||||
then
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
|
||||
local res = xml_obj:query("hint_wnd")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=208*ratio})
|
||||
end
|
||||
local res = xml_obj:query("hint_wnd > background")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=208*ratio})
|
||||
end
|
||||
local res = xml_obj:query("hint_wnd > background")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=208*ratio})
|
||||
end
|
||||
local res = xml_obj:query("hint_wnd > background > texture")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setText(el, "ui_icons_PDA_tooltips")
|
||||
end
|
||||
local res = xml_obj:query("hint_wnd > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=10*ratio, y=10, width=188*ratio})
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,28 @@
|
||||
function on_xml_read()
|
||||
if not zzz_dynahud_hud then
|
||||
return
|
||||
end
|
||||
|
||||
RegisterScriptCallback("on_xml_read", function(xml_file_name, xml_obj)
|
||||
if xml_file_name == [[ui\ui_hud.xml]]
|
||||
or xml_file_name == [[ui\ui_hud_16.xml]]
|
||||
or xml_file_name == [[ui\ui_hud_21.xml]]
|
||||
then
|
||||
local res = xml_obj:query("indicators")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=15, y=745, height=30})
|
||||
end
|
||||
local res = xml_obj:query("indicators > static")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=30, height=30})
|
||||
end
|
||||
local res = xml_obj:query("indicators > flashing")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=30, height=30})
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,79 @@
|
||||
function on_xml_read()
|
||||
RegisterScriptCallback("on_xml_read", function(xml_file_name, xml_obj)
|
||||
if xml_file_name == [[ui\ui_inventory.xml]]
|
||||
or xml_file_name == [[ui\ui_inventory_16.xml]]
|
||||
or xml_file_name == [[ui\ui_inventory_21.xml]]
|
||||
then
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
|
||||
-- player cont bags
|
||||
local res = xml_obj:query("player > cont_bag")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {height=592})
|
||||
|
||||
if ratio < 1 then
|
||||
xml_obj:setElementAttr(el, {width=475*ratio})
|
||||
end
|
||||
end
|
||||
local res = xml_obj:query("player > cont_trade")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {height=185})
|
||||
|
||||
if ratio < 1 then
|
||||
xml_obj:setElementAttr(el, {width=475*ratio})
|
||||
end
|
||||
end
|
||||
local res = xml_obj:query("player > cont_trade_bag")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {y=379.75, height=333})
|
||||
|
||||
if ratio < 1 then
|
||||
xml_obj:setElementAttr(el, {width=475*ratio})
|
||||
end
|
||||
end
|
||||
local res = xml_obj:query("player > trade_delimiter")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {y=314.5})
|
||||
end
|
||||
|
||||
-- npc cont bags
|
||||
local res = xml_obj:query("npc > cont_bag")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {height=592})
|
||||
|
||||
if ratio < 1 then
|
||||
xml_obj:setElementAttr(el, {width=475*ratio})
|
||||
end
|
||||
end
|
||||
local res = xml_obj:query("npc > cont_trade")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {height=185})
|
||||
|
||||
if ratio < 1 then
|
||||
xml_obj:setElementAttr(el, {width=475*ratio})
|
||||
end
|
||||
end
|
||||
local res = xml_obj:query("npc > cont_trade_bag")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {y=379.75, height=333})
|
||||
|
||||
if ratio < 1 then
|
||||
xml_obj:setElementAttr(el, {width=475*ratio})
|
||||
end
|
||||
end
|
||||
local res = xml_obj:query("npc > trade_delimiter")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {y=314.5})
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,62 @@
|
||||
function on_xml_read()
|
||||
if not ui_mcm then
|
||||
return
|
||||
end
|
||||
|
||||
RegisterScriptCallback("on_xml_read", function(xml_file_name, xml_obj)
|
||||
if xml_file_name == [[ui\ui_mm_main.xml]]
|
||||
or xml_file_name == [[ui\ui_mm_main_16.xml]]
|
||||
or xml_file_name == [[ui\ui_mm_main_21.xml]]
|
||||
then
|
||||
if is_not_empty(xml_obj:query("menu_main btn[name=btn_mcm]")) then
|
||||
return
|
||||
end
|
||||
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
local mcm_logo =
|
||||
[[
|
||||
<auto_static x="]] .. 1024-(15+(64+5)*3)*ratio .. [[" y="684" width="]] .. 64*ratio .. [[" height="64" stretch="1">
|
||||
<texture>LogoAMCM.dds</texture>
|
||||
</auto_static>
|
||||
]]
|
||||
local mcm_menu = [[<btn name="btn_mcm" caption="ui_mm_menu_mcm"/>]]
|
||||
|
||||
local res = xml_obj:query("background")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:insertFromXMLString(mcm_logo, el, #el.kids)
|
||||
end
|
||||
local res = xml_obj:query("menu_main")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:insertFromXMLString(mcm_menu, el, #el.kids)
|
||||
end
|
||||
local res = xml_obj:query("menu_main_logout")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:insertFromXMLString(mcm_menu, el, #el.kids)
|
||||
end
|
||||
local res = xml_obj:query("menu_main_last_save")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:insertFromXMLString(mcm_menu, el, #el.kids)
|
||||
end
|
||||
local res = xml_obj:query("menu_main_single")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:insertFromXMLString(mcm_menu, el, #el.kids-1)
|
||||
end
|
||||
local res = xml_obj:query("menu_main_single_dead")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:insertFromXMLString(mcm_menu, el, #el.kids-1)
|
||||
end
|
||||
local res = xml_obj:query("menu_main_mm")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:insertFromXMLString(mcm_menu, el, #el.kids-1)
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,210 @@
|
||||
function on_xml_read()
|
||||
RegisterScriptCallback("on_xml_read", function(xml_file_name, xml_obj)
|
||||
-- PDA checkboxes
|
||||
if xml_file_name == [[ui\pda_relations_f9.xml]]
|
||||
or xml_file_name == [[ui\pda_relations_f10.xml]]
|
||||
or xml_file_name == [[ui\pda_relations_f11.xml]]
|
||||
or xml_file_name == [[ui\pda_relations_f12.xml]]
|
||||
or xml_file_name == [[ui\pda_relations_f13.xml]]
|
||||
or xml_file_name == [[ui\pda_relations_f14.xml]]
|
||||
or xml_file_name == [[ui\pda_contacts.xml]]
|
||||
or xml_file_name == [[ui\pda_contacts_16.xml]]
|
||||
or xml_file_name == [[ui\pda_encyclopedia.xml]]
|
||||
or xml_file_name == [[ui\pda_encyclopedia_16.xml]]
|
||||
or xml_file_name == [[ui\pda_logs.xml]]
|
||||
or xml_file_name == [[ui\pda_logs_16.xml]]
|
||||
or xml_file_name == [[ui\pda_relations.xml]]
|
||||
or xml_file_name == [[ui\pda_relations_16.xml]]
|
||||
then
|
||||
-- auto_check
|
||||
local res = xml_obj:query("auto_check")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("auto_check > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=-20, y=2})
|
||||
end
|
||||
|
||||
-- show_all
|
||||
local res = xml_obj:query("show_all")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("show_all > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=-20, y=2})
|
||||
end
|
||||
|
||||
-- image_checkbox
|
||||
local res = xml_obj:query("image_checkbox")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("image_checkbox > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=-20, y=2})
|
||||
end
|
||||
|
||||
-- message_checkbox
|
||||
local res = xml_obj:query("message_checkbox")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("message_checkbox > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=-20, y=2})
|
||||
end
|
||||
|
||||
-- filter_news
|
||||
local res = xml_obj:query("filter_news")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("filter_news > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=-20, y=2})
|
||||
end
|
||||
|
||||
-- filter_talk
|
||||
local res = xml_obj:query("filter_talk")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("filter_talk > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=-20, y=2})
|
||||
end
|
||||
end
|
||||
|
||||
-- PDA upper buttons bg
|
||||
if xml_file_name == [[ui\pda.xml]]
|
||||
or xml_file_name == [[ui\pda_16.xml]]
|
||||
then
|
||||
local res = xml_obj:query("background_static > auto_frameline")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=753})
|
||||
end
|
||||
if res[2] then
|
||||
local el = res[2]
|
||||
xml_obj:setElementAttr(el, {width=0, height=0})
|
||||
end
|
||||
end
|
||||
|
||||
-- PDA small buttons bg
|
||||
if xml_file_name == [[ui\pda_tasks.xml]]
|
||||
or xml_file_name == [[ui\pda_tasks_16.xml]]
|
||||
then
|
||||
local res = xml_obj:query("center_background > auto_static")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=0, height=0, stretch=1})
|
||||
end
|
||||
if res[2] then
|
||||
local el = res[2]
|
||||
xml_obj:setElementAttr(el, {width=0, height=0})
|
||||
end
|
||||
|
||||
local res = xml_obj:query("center_background > auto_frameline")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=0, y=8, width=764, height=19})
|
||||
end
|
||||
|
||||
local res = xml_obj:query("filter_quest_npcs")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=615})
|
||||
end
|
||||
end
|
||||
|
||||
-- iTheon PDA taskboard buttons
|
||||
if xml_file_name == [[ui\pda_taskboard.xml]]
|
||||
or xml_file_name == [[ui\pda_taskboard_16.xml]]
|
||||
then
|
||||
local res = xml_obj:query("btn_accept_task")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("btn_accept_task > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=20, y=1, vert_align="c"})
|
||||
end
|
||||
|
||||
local res = xml_obj:query("btn_next_task")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("btn_next_task > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=20, y=1, vert_align="c"})
|
||||
end
|
||||
|
||||
local res = xml_obj:query("btn_refresh_tasks")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("btn_refresh_tasks > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=20, y=1, vert_align="c"})
|
||||
end
|
||||
end
|
||||
|
||||
if xml_file_name == [[ui\pda_taskboard.xml]]
|
||||
or xml_file_name == [[ui\pda_taskboard_16.xml]]
|
||||
then
|
||||
local res = xml_obj:query("btn_accept_task")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("btn_accept_task > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=20, y=1, vert_align="c"})
|
||||
end
|
||||
|
||||
local res = xml_obj:query("btn_next_task")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("btn_next_task > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=20, y=1, vert_align="c"})
|
||||
end
|
||||
|
||||
local res = xml_obj:query("btn_refresh_tasks")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {width=15})
|
||||
end
|
||||
local res = xml_obj:query("btn_refresh_tasks > text")
|
||||
if res[1] then
|
||||
local el = res[1]
|
||||
xml_obj:setElementAttr(el, {x=20, y=1, vert_align="c"})
|
||||
end
|
||||
end
|
||||
|
||||
end)
|
||||
end
|
||||
@@ -0,0 +1,48 @@
|
||||
XML_bars = CScriptXmlInit()
|
||||
XML_bars:ParseFile("ui_condition_bars.xml")
|
||||
|
||||
local bar_list = {
|
||||
["condition_progess_bar"] = { min= {255,196,18,18,0}, mid= {255,255,255,118,0.5}, max= {255,107,207,119,1}, background= true},
|
||||
["power_progess_bar"] = { def= GetARGB(255,86,196,209), background= true },
|
||||
["uses_progess_bar"] = { def= GetARGB(255,255,255,255), background= false },
|
||||
}
|
||||
|
||||
local lerp_color = utils_xml.lerp_color
|
||||
|
||||
function on_game_start()
|
||||
_Add_ProgressBar = utils_ui.UICellItem.Add_ProgressBar
|
||||
utils_ui.UICellItem.Add_ProgressBar = function(self, xml, obj, sec, clsid)
|
||||
_Add_ProgressBar(self, xml, obj, sec, clsid)
|
||||
|
||||
if (not self.bar) or (self.manual) or (self.alt_bar_set == sec) then return end
|
||||
|
||||
-- Hide all bars
|
||||
self.bar:Show(false)
|
||||
|
||||
local multiuse = IsItem("multiuse",sec)
|
||||
|
||||
self.bar = XML_bars:InitProgressBar(multiuse and "bar_uses" or "bar_cond", self.cell)
|
||||
|
||||
local h_bar = self.bar:GetHeight()
|
||||
self.bar:SetWndPos(vector2():set( 0 , (self.H - h_bar)))
|
||||
|
||||
-- Set progress
|
||||
local cond = multiuse and (obj:get_remaining_uses()/10) or round_idp(obj:condition(), 1)
|
||||
self.bar:SetProgressPos( clamp(cond,0,1) )
|
||||
|
||||
-- Bar properties
|
||||
local str = SYS_GetParam(0,sec, "condition_bar","condition_progess_bar")
|
||||
|
||||
local props = bar_list[str]
|
||||
local color = props.def or lerp_color( cond , props.min , props.mid , props.max )
|
||||
if color then
|
||||
self.bar:SetColor( color )
|
||||
end
|
||||
|
||||
self.bar:ShowBackground(props.background)
|
||||
|
||||
self.bar:Show(true)
|
||||
|
||||
self.alt_bar_set = sec -- so the bars don't constantly reset
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1
@@ -0,0 +1 @@
|
||||
printf("dummy file")
|
||||
+245
@@ -0,0 +1,245 @@
|
||||
--[[
|
||||
|
||||
EverybodyLies
|
||||
03 February 2022
|
||||
|
||||
RELEASE:
|
||||
- Fixed bug in UICellItem:Add_Icon/Add_Shadow functions when icon inside rotated cells is displayed incorrectly.
|
||||
UPD.03/02/2022:
|
||||
- Added UICellItem:Create_Layer() fix from RavenAscendant icon override script.
|
||||
- Fixed compatibility issue then player have an icon override script.
|
||||
- Script renamed to 'utils_ui_icon_rotation_fix_mcm.script' for loading early enough to modify the New Game screens.
|
||||
UPD.11/02/2022:
|
||||
- Upgrade icon in rotated cell is now displayed on the top-right corner.
|
||||
UPD.13/02/2022:
|
||||
- Added shadows for scopes, silencers and grenade launchers! Compatible with icon_override.
|
||||
TODO:
|
||||
+ Add shadows for equipped atachments on weapon.
|
||||
- Add support for custom attachment icon on weapon, not only attachment item icon itself.
|
||||
|
||||
]]--
|
||||
|
||||
-- Credits to RavenAscendant for this fix
|
||||
function utils_ui.UICellItem:Create_Layer(ele, base, sec_m, sec_l, str_x, str_y, str_scale)
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
local grid_size = self.grid_size
|
||||
local x = str_x and SYS_GetParam(2,sec_m, str_x) or 0
|
||||
local y = str_y and SYS_GetParam(2,sec_m, str_y) or 0
|
||||
local w = SYS_GetParam(2,sec_l, "inv_grid_width",1) * grid_size
|
||||
local h = SYS_GetParam(2,sec_l, "inv_grid_height",1) * grid_size
|
||||
local scale = str_scale and SYS_GetParam(2,sec_m, str_scale) or 1
|
||||
local scale_pos = scale * (grid_size/50)
|
||||
|
||||
local rot = ele:GetHeading() > 0
|
||||
local x_s = x * ratio * scale_pos
|
||||
local y_s = y * scale_pos
|
||||
local w_s = w * ratio * scale
|
||||
local h_s = h * scale
|
||||
local w_off = (w_s/2)
|
||||
local h_off = (h_s/2)
|
||||
|
||||
if rot then
|
||||
-- despite rotation, the dimensions of the base icon do not change!
|
||||
-- Move start pos to match the one for rotated base icon
|
||||
-- Base icon rotates on its center. To calculate where the upper left corner went move to the center of the window then move along the rotated image
|
||||
local w_b, h_b = base:GetWidth(), base:GetHeight()
|
||||
local x_st = (w_b/2) - (h_b/2)*ratio --When the engine rotates an image it doesn't get streched. Which means it is efectivly ratio corected and centered, to move out from the center of the window to the top of the gun, we need to ratio corect the old height to get to the new width.
|
||||
local y_st = (h_b/2) + (w_b/2) --no ratio corection here because movement out from the center is along the veritcal axis where no ratio adjustment is needed
|
||||
-- printf("w:%s,h:%s, y:%s,x:%s",w_b, h_b, y_st,x_st)
|
||||
-- On 90 rotation, x and y are inverted, y axis goes negative simulate normal x movement
|
||||
x_s = x_st + (y * ratio * scale_pos)
|
||||
y_s = y_st - (x * scale_pos)
|
||||
w_s = w * scale --window size doesn't change despite rotation so these dimensions don't get swapped. Because the icon is getting rotated ratio corection is moot and would just need to be compensated for in h_off
|
||||
h_s = h * scale
|
||||
w_off = (h_s/2) * ratio --because this is moving along the x axis it needs ratio corection
|
||||
h_off = -(w_s/2)
|
||||
end
|
||||
|
||||
ele:InitTexture( utils_xml.get_icons_texture(sec_l) )
|
||||
ele:SetTextureRect(Frect():set( utils_xml.get_item_axis(sec_l, nil, true) ))
|
||||
ele:SetStretchTexture(true)
|
||||
ele:SetWndPos(vector2():set( x_s + w_off , y_s + h_off ))
|
||||
ele:SetWndSize(vector2():set( w_s , h_s ))
|
||||
ele:Show(true)
|
||||
end
|
||||
|
||||
-------------------------------------------------------------------
|
||||
|
||||
function utils_ui.UICellItem:Add_Attachements(xml, obj, sec, clsid)
|
||||
-- Hide attachments
|
||||
if self.ico_scope then self.ico_scope:Show(false) end
|
||||
if self.shadow_ico_scope then self.shadow_ico_scope:Show(false) end
|
||||
if self.ico_sil then
|
||||
self.ico_sil:Show(false)
|
||||
self.shadow_sil:Show(false)
|
||||
end
|
||||
if self.ico_gl then
|
||||
self.ico_gl:Show(false)
|
||||
self.shadow_gl:Show(false)
|
||||
end
|
||||
|
||||
-- On full stacking, hide counter
|
||||
if self.container.stack_all and (self.childs and is_not_empty(self.childs)) then
|
||||
return
|
||||
end
|
||||
|
||||
-- No attachments on showcase cells
|
||||
if (self.showcase ~= 0) then
|
||||
return
|
||||
end
|
||||
|
||||
-- No attachments for non-firearms
|
||||
local magazined_wpn = IsWeapon(nil,clsid) and (not IsItem("fake_ammo_wpn",sec))
|
||||
if (not magazined_wpn) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Scope
|
||||
local scope = (not utils_item.has_scope(sec)) and utils_item.get_attached_scope(obj)
|
||||
if scope then
|
||||
if (not self.ico_scope) then
|
||||
if (not xml) then
|
||||
xml = self:GetXML()
|
||||
end
|
||||
self.ico_scope = xml:InitStatic(self.path .. ":" .. self.cx .. ":pic", self.ico)
|
||||
self.shadow_ico_scope = xml:InitStatic(self.path .. ":" .. self.cx .. ":pic", self.shadow)
|
||||
end
|
||||
local scopes_sect = utils_item.get_param(sec, obj:id(), "scopes_sect", "string", false)
|
||||
self:Create_Layer(self.ico_scope, self.ico, scopes_sect, scope, "scope_x", "scope_y")
|
||||
self:Print(nil, "Show scope")
|
||||
|
||||
self:Create_Layer(self.shadow_ico_scope, self.shadow, scopes_sect, scope, "scope_x", "scope_y")
|
||||
self.shadow_ico_scope:SetTextureColor( GetARGB(200, 20, 20, 20) )
|
||||
self:Print(nil, "Show scope shadow")
|
||||
end
|
||||
|
||||
-- Silencer
|
||||
local sil = utils_item.get_attached_silencer(obj)
|
||||
if sil then
|
||||
if (not self.ico_sil) then
|
||||
if (not xml) then
|
||||
xml = self:GetXML()
|
||||
end
|
||||
self.ico_sil = xml:InitStatic(self.path .. ":" .. self.cx .. ":pic", self.ico)
|
||||
self.shadow_sil = xml:InitStatic(self.path .. ":" .. self.cx .. ":pic", self.shadow)
|
||||
end
|
||||
self:Create_Layer(self.ico_sil, self.ico, sec, sil, "silencer_x", "silencer_y")
|
||||
self:Print(nil, "Show silencer")
|
||||
|
||||
self:Create_Layer(self.shadow_sil, self.shadow, sec, sil, "silencer_x", "silencer_y")
|
||||
self.shadow_sil:SetTextureColor( GetARGB(200, 20, 20, 20) )
|
||||
self:Print(nil, "Show silencer shadow")
|
||||
end
|
||||
|
||||
-- Grenade Launcher
|
||||
local gl = utils_item.get_attached_gl(obj)
|
||||
if gl then
|
||||
if (not self.ico_gl) then
|
||||
if (not xml) then
|
||||
xml = self:GetXML()
|
||||
end
|
||||
self.ico_gl = xml:InitStatic(self.path .. ":" .. self.cx .. ":pic", self.ico)
|
||||
self.shadow_gl = xml:InitStatic(self.path .. ":" .. self.cx .. ":pic", self.shadow)
|
||||
end
|
||||
self:Create_Layer(self.ico_gl, self.ico, sec, gl, "grenade_launcher_x", "grenade_launcher_y")
|
||||
self:Print(nil, "Show grenade launcher")
|
||||
|
||||
self:Create_Layer(self.shadow_gl, self.shadow, sec, gl, "grenade_launcher_x", "grenade_launcher_y")
|
||||
self.shadow_gl:SetTextureColor( GetARGB(200, 20, 20, 20) )
|
||||
self:Print(nil, "Show grenade launcher shadow")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function utils_ui.UICellItem:Add_Icon(sec, w, h)
|
||||
local rot = self.ico:GetHeading() > 0
|
||||
|
||||
self.ico:InitTexture( utils_xml.get_icons_texture(sec) )
|
||||
self.ico:SetTextureRect(Frect():set( utils_xml.get_item_axis(sec, nil, true) ))
|
||||
self.ico:SetStretchTexture(true)
|
||||
self.ico:SetWndSize(vector2():set( w * (rot and 1 or utils_xml.screen_ratio()) , h ))
|
||||
self.ico:Show(true)
|
||||
utils_xml.align_to_center(self.ico, self.cell)
|
||||
|
||||
self:Print(nil, "Show icon")
|
||||
end
|
||||
|
||||
|
||||
function utils_ui.UICellItem:Add_Shadow(sec, w, h)
|
||||
local rot = self.shadow:GetHeading() > 0
|
||||
|
||||
local shadow_offset_x, shadow_offset_y = 1, 2
|
||||
|
||||
self.shadow:InitTexture( utils_xml.get_icons_texture(sec) )
|
||||
self.shadow:SetTextureRect(Frect():set( utils_xml.get_item_axis(sec, nil, true) ))
|
||||
self.shadow:SetStretchTexture(true)
|
||||
self.shadow:SetWndSize(vector2():set( w * (rot and 1 or utils_xml.screen_ratio()) , h ))
|
||||
self.shadow:Show(true)
|
||||
utils_xml.align_to_center(self.shadow, self.cell)
|
||||
|
||||
local pos = self.ico:GetWndPos()
|
||||
self.shadow:SetWndPos( vector2():set( pos.x + shadow_offset_x , pos.y + shadow_offset_y ) )
|
||||
self.shadow:SetTextureColor( GetARGB(200, 20, 20, 20) )
|
||||
|
||||
self:Print(nil, "Show shadow")
|
||||
end
|
||||
|
||||
|
||||
function utils_ui.UICellItem:Add_Upgrade(xml, obj, sec)
|
||||
|
||||
-- Hide upgrade indicator
|
||||
if self.upgr then
|
||||
self.upgr:Show(false)
|
||||
end
|
||||
|
||||
-- On full stacking, hide upgrade indicator
|
||||
if self.container.stack_all and (self.childs and is_not_empty(self.childs)) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Bar is applied only to upgraded items
|
||||
if (not utils_item.has_upgrades(obj, sec)) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Init if it doesn't exist
|
||||
if (not self.upgr) then
|
||||
if (not xml) then
|
||||
xml = self:GetXML()
|
||||
end
|
||||
self.upgr = xml:InitStatic(self.path .. ":cell:upgrade", self.ico)
|
||||
end
|
||||
|
||||
-- Positioning
|
||||
local ico = self.ico
|
||||
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
local xx = 1 * ratio
|
||||
local yy = 1
|
||||
|
||||
local w_b, h_b = ico:GetWidth(), ico:GetHeight()
|
||||
local w_upgr, h_upgr = self.upgr:GetWidth(), self.upgr:GetHeight()
|
||||
|
||||
local rot = ico:GetHeading() > 0
|
||||
if rot then
|
||||
-- top corners (rot cell)
|
||||
yy = yy - (w_b/2) + (h_b/2)
|
||||
|
||||
if utils_ui_demonized_inventory_weights then
|
||||
-- top-right corner (rot cell)
|
||||
xx = -xx + (w_b/2) + (h_b/2) * ratio - w_upgr
|
||||
else
|
||||
-- top-left corner (rot cell)
|
||||
xx = xx + (w_b/2) - (h_b/2) * ratio
|
||||
end
|
||||
elseif utils_ui_demonized_inventory_weights then
|
||||
-- top-right corner (non rot cell)
|
||||
xx = -xx + w_b - w_upgr
|
||||
end
|
||||
|
||||
self.upgr:SetWndPos(vector2():set( xx , yy ))
|
||||
self.upgr:Show(true)
|
||||
|
||||
self:Print(nil, "Show upgrade indicator")
|
||||
end
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
local XMLP = CScriptXmlInit()
|
||||
XMLP:ParseFile("utils.xml")
|
||||
local small_grid_size = 35
|
||||
|
||||
function utils_ui.UICellItem:__init(container, st, indx, manual)
|
||||
|
||||
-- To define free item cell:
|
||||
-- UICellItem( { path= <string> , xml= <xml_file> , grid_size= <number>, grid_line= <number> } , { path= <string>, base= <xml_element>} )
|
||||
|
||||
self.manual = manual -- manual placement on container, some properties are disabled
|
||||
self.container = container
|
||||
self.path = container.path
|
||||
self.indx = indx
|
||||
self.showcase = 0 -- [0] attached to object / [1] attached to section (showcase) / [2] same as 1 with no cell room adjust
|
||||
self.cx = manual and ("cell_" .. indx) or "cell" -- in manual placement, cells are specified by their index in xml file
|
||||
-- Edited by Sota
|
||||
--self.grid_size = container.grid_size or 41
|
||||
self.grid_size = container.grid_size or small_grid_size
|
||||
|
||||
self.grid_line = container.grid_line or 0
|
||||
|
||||
self.flags = {} -- you can pass custom info here
|
||||
self.disable_bar = container.disable_bar and true or false
|
||||
|
||||
self:InitControls(self.path, st)
|
||||
|
||||
self:Print(nil, "__init for path (%s)", self.path)
|
||||
end
|
||||
|
||||
function utils_ui.UICellContainer:__init(id, owner, path, prof, ele_base, manual, use_frame)
|
||||
self.ID = id -- unique id for class instance, so we can deal with many instances outside
|
||||
self.owner = owner
|
||||
self.path = path or "container"
|
||||
self.xml = manual and owner.xml or XMLP
|
||||
|
||||
-- Item cells
|
||||
-- Edited by Sota
|
||||
--self.grid_size = 41
|
||||
self.grid_size = small_grid_size
|
||||
|
||||
self.grid_line = 2
|
||||
self.grid = {} -- [row][col] = bool ( true = unoccupied , false = occupied )
|
||||
self.cell = {}
|
||||
self.line = {}
|
||||
self.line_cnt = 0
|
||||
self.indx_id = {} --[id] = idx
|
||||
self.indx_sec = {} --[sec][id] = idx
|
||||
self.idxer = 0
|
||||
self.row_end = 0
|
||||
self.col_end = 0
|
||||
self.scroll_pos = 0
|
||||
self.cell_vis_offset = 20 --[px]
|
||||
self.rKind = { last = false , current = false , row = 1 }
|
||||
|
||||
-- Properties
|
||||
self.sort_method = "sizekind"
|
||||
self.showcase = false
|
||||
self.manual = manual
|
||||
self.can_select = false
|
||||
self.stack_all = false
|
||||
self.ignore_scroll = false
|
||||
self.disable_scroll = manual
|
||||
self.disable_scroll_dragdrop = false
|
||||
self.disable_drag = false
|
||||
self.disable_highlight = false
|
||||
self.disable_info = false
|
||||
self.disable_stack = false
|
||||
self.disable_bar = false
|
||||
self.disable_callback = {} --[name] = true
|
||||
self.scolling_power_up = 3
|
||||
|
||||
-- Cell management
|
||||
self.selected = nil
|
||||
self.hover = { idx = false }
|
||||
self.hold = { idx = false , ico = false , tg = 0 , w = 0 , h = 0 }
|
||||
self.db = { idx = false , tg = 0 }
|
||||
self.drag_area = { up = 0 , down = 0 , step = 200 }
|
||||
self.pd = { update = false , off = 0 , start = 0 , hold = false , power = 1}
|
||||
self.scolling_power = 1
|
||||
self.use_frame = use_frame
|
||||
|
||||
self:InitControls(owner, prof, ele_base)
|
||||
self:EnableScrolling(not manual)
|
||||
|
||||
self:Print(nil, "__init for path (%s)", path)
|
||||
end
|
||||
@@ -0,0 +1,83 @@
|
||||
icon_override = aaa_rax_icon_override_mcm.icon_override
|
||||
local sync_element = utils_xml.sync_element
|
||||
|
||||
function aaa_rax_icon_override_mcm.utils_ui.UICellItem:Set(obj, area)
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
local xml = self:GetXML()
|
||||
local path = self.path
|
||||
local is_obj = (self.showcase == 0)
|
||||
local grid_size = self.grid_size
|
||||
|
||||
local sec = is_obj and obj:section() or obj
|
||||
local clsid = is_obj and obj:clsid()
|
||||
|
||||
local x = icon_override:section_exist(sec) and icon_override:r_float_ex(sec,"inv_grid_x") or SYS_GetParam(2,sec, "inv_grid_x")
|
||||
local y = icon_override:section_exist(sec) and icon_override:r_float_ex(sec,"inv_grid_y") or SYS_GetParam(2,sec, "inv_grid_y")
|
||||
local w = icon_override:section_exist(sec) and icon_override:r_float_ex(sec,"inv_grid_width") or SYS_GetParam(2,sec, "inv_grid_width")
|
||||
local h = icon_override:section_exist(sec) and icon_override:r_float_ex(sec,"inv_grid_height") or SYS_GetParam(2,sec, "inv_grid_height")
|
||||
|
||||
if not x or not y or not w or not h then
|
||||
return false
|
||||
end
|
||||
|
||||
x = x * grid_size
|
||||
y = y * grid_size
|
||||
w = w * grid_size
|
||||
h = h * grid_size
|
||||
|
||||
self.ID = is_obj and obj:id() or nil
|
||||
self.section = sec
|
||||
self.area = area
|
||||
--self.X = x
|
||||
--self.Y = y
|
||||
self.W = w
|
||||
self.H = h
|
||||
|
||||
-- Trade mode
|
||||
--if self:Check_TradeMode(obj, sec) then
|
||||
--return false
|
||||
--end
|
||||
|
||||
-- Cell pos
|
||||
if area and (not self.manual) then
|
||||
local area_x = ((area.x * grid_size) - grid_size) * ratio
|
||||
local area_y = (area.y * grid_size) - grid_size
|
||||
-- Edited by Sota
|
||||
--local area_xl = self.grid_line * area.x
|
||||
local area_xl = self.grid_line * area.x * ratio
|
||||
|
||||
local area_yl = self.grid_line * area.y
|
||||
|
||||
self.cell:SetWndPos(vector2():set( area_x + area_xl , area_y + area_yl ))
|
||||
self.cell:SetWndSize(vector2():set(w * ratio , h))
|
||||
sync_element(self.hl, self.cell)
|
||||
self:Print(nil, "Set for [%s] in (%s,%s,%s,%s)", sec, area_x, area_y, w, h)
|
||||
|
||||
-- Cell pos (free cell)
|
||||
elseif self.st then
|
||||
local st_x = ((self.st:GetWidth() /2) - ((w * ratio) /2))
|
||||
local st_y = ((self.st:GetHeight() /2) - (h /2))
|
||||
self.cell:SetWndPos(vector2():set( st_x , st_y ))
|
||||
self.cell:SetWndSize(vector2():set(w * ratio , h))
|
||||
sync_element(self.hl, self.cell)
|
||||
self:Print(nil, "Set for [%s] in free cell", sec)
|
||||
end
|
||||
|
||||
-- Icon
|
||||
self:Add_Icon(sec, w, h)
|
||||
self:Add_Shadow(sec, w, h)
|
||||
|
||||
-- Icon layers
|
||||
self:Add_Layers(xml, obj, sec, clsid)
|
||||
|
||||
-- Update cell
|
||||
local is_updated = self:Update(is_obj and obj)
|
||||
if (not is_updated) then
|
||||
self:Print(nil, "Updating failed for [%s] | Reset cell", sec)
|
||||
self:Reset()
|
||||
return false
|
||||
end
|
||||
|
||||
self.cell:Show(true)
|
||||
return true
|
||||
end
|
||||
@@ -0,0 +1,39 @@
|
||||
function axr_companions.UICompanionList:InitControls()
|
||||
local xml = utils_xml.get_hud_xml()
|
||||
|
||||
self.dialog = xml:InitStatic("companion_list", self)
|
||||
|
||||
local scale = 1
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
self.dialog:SetWndPos( vector2():set( 1024 - self.dialog:GetWidth() * ratio * scale , 0 ) )
|
||||
|
||||
self.companion_info = {}
|
||||
for i=1,8 do
|
||||
self.companion_info[i] = {}
|
||||
self.companion_info[i].base = xml:InitStatic("companion_list:slot", self.dialog)
|
||||
self.companion_info[i].background = xml:InitStatic("companion_list:slot:background", self.companion_info[i].base)
|
||||
self.companion_info[i].icon = xml:InitStatic("companion_list:slot:icon", self.companion_info[i].base)
|
||||
self.companion_info[i].danger_indicator = xml:InitStatic("companion_list:slot:danger_indicator", self.companion_info[i].base)
|
||||
self.companion_info[i].team_role_shadow = xml:InitStatic("companion_list:slot:team_role", self.companion_info[i].base)
|
||||
self.companion_info[i].team_role = xml:InitStatic("companion_list:slot:team_role", self.companion_info[i].base)
|
||||
self.companion_info[i].distance_shadow = xml:InitTextWnd("companion_list:slot:distance", self.companion_info[i].base)
|
||||
self.companion_info[i].distance = xml:InitTextWnd("companion_list:slot:distance", self.companion_info[i].base)
|
||||
self.companion_info[i].prog_health = xml:InitProgressBar("companion_list:slot:health", self.companion_info[i].base)
|
||||
|
||||
for _,ele in pairs(self.companion_info[i]) do
|
||||
local pos = ele:GetWndPos()
|
||||
ele:SetWndPos( vector2():set( pos.x * ratio * scale , pos.y * scale ) )
|
||||
|
||||
local w, h = ele:GetWidth(), ele:GetHeight()
|
||||
ele:SetWndSize( vector2():set( w * ratio * scale , h * scale ) )
|
||||
end
|
||||
|
||||
local h = self.companion_info[i].background:GetHeight()
|
||||
self.companion_info[i].distance:SetFont(GetFontSmall())
|
||||
self.companion_info[i].base:SetWndPos( vector2():set( 0 , self.dialog:GetHeight() - i * (h+5) ) )
|
||||
|
||||
local pos = self.companion_info[i].team_role:GetWndPos()
|
||||
self.companion_info[i].team_role_shadow:SetWndPos( vector2():set( pos.x + 1 * ratio * scale , pos.y + 1 * scale ) )
|
||||
self.companion_info[i].team_role_shadow:SetTextureColor( GetARGB(255, 0, 0, 0) )
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,34 @@
|
||||
local explicitly_missing = true
|
||||
local all_lower_case = true
|
||||
|
||||
function indirect_parts_favoriter.name_favorite_parts(obj, bag, mode)
|
||||
return game.translate_string("st_favorite_parts")
|
||||
end
|
||||
|
||||
function indirect_parts_favoriter.name_and_cond(sec, con, threshold, mode)
|
||||
local line
|
||||
|
||||
if mode == 1 then
|
||||
local part_name = ui_item.get_sec_name(sec)
|
||||
if con == -1 and explicitly_missing then
|
||||
con = game.translate_string("st_part_missing")
|
||||
else
|
||||
con = con .. "%"
|
||||
end
|
||||
if indirect_parts_favoriter.is_favorite(sec) then
|
||||
line = game.translate_string("st_unfavorite_part") .. " " .. part_name .. " (" .. con .. ")"
|
||||
else
|
||||
line = game.translate_string("st_favorite_part") .. " " .. part_name .. " (" .. con .. ")"
|
||||
end
|
||||
elseif mode == 2 then
|
||||
line = game.translate_string("st_unfavorite_all_part") .. " " .. threshold .. game.translate_string("st_part_condition")
|
||||
elseif mode == 3 then
|
||||
line = game.translate_string("st_favorite_all_part") .. " " .. threshold .. game.translate_string("st_part_condition")
|
||||
end
|
||||
|
||||
if all_lower_case then
|
||||
line = string.lower(line)
|
||||
end
|
||||
|
||||
return line
|
||||
end
|
||||
@@ -0,0 +1,114 @@
|
||||
cur_hint = inventory_upgrades.cur_hint
|
||||
local char_ini = ini_file("item_upgrades.ltx")
|
||||
local param_ini = ini_file("misc\\stalkers_upgrade_info.ltx")
|
||||
local cur_price_percent = 2
|
||||
local upg_ind = {
|
||||
["a"] = 1,
|
||||
["b"] = 1,
|
||||
["c"] = 2,
|
||||
["d"] = 2,
|
||||
["e"] = 3,
|
||||
["f"] = 3,
|
||||
}
|
||||
|
||||
function inventory_upgrades.get_upgrade_cost(section)
|
||||
-- The text variable to be displayed
|
||||
|
||||
-- Edited by Sota
|
||||
--local str = " "
|
||||
local str = ""
|
||||
|
||||
if db.actor then
|
||||
-- Read the amount necessary for installation
|
||||
local price = math.floor(char_ini:r_u32(section, "cost")*cur_price_percent)
|
||||
|
||||
-- Enter into the text variable the cost of the upgrade
|
||||
-- Edited by Sota
|
||||
--str = " " .. game.translate_string("st_upgr_cost") .. ": " .. price
|
||||
str = game.translate_string("st_upgr_cost") .. ": " .. price
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
function inventory_upgrades.get_possibility_string(mechanic_name, possibility_table)
|
||||
local str = ""
|
||||
if (cur_hint) then
|
||||
for k,v in pairs(cur_hint) do
|
||||
-- Edited by Sota
|
||||
--str = str .. "\\n - " .. game.translate_string(v)
|
||||
str = str .. "\\n • " .. game.translate_string(v)
|
||||
end
|
||||
end
|
||||
if (str == "") then
|
||||
str = " - add hints for this upgrade"
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
function inventory_upgrades.prereq_functor_a( param3, section )
|
||||
|
||||
local victim = get_speaker()
|
||||
if not (victim) then
|
||||
return ""
|
||||
end
|
||||
|
||||
local mechanic_name = victim:section()
|
||||
local str = ""
|
||||
local custom = false
|
||||
|
||||
-- check section precondition
|
||||
if (param_ini:line_exist(mechanic_name.."_upgr", section)) then
|
||||
local param = param_ini:r_string_ex(mechanic_name.."_upgr", section)
|
||||
if (param) then
|
||||
custom = true
|
||||
if (param=="false") then
|
||||
return str
|
||||
else
|
||||
cur_hint = nil
|
||||
local possibility_table = xr_logic.parse_condlist(victim, mechanic_name.."_upgr", section, param)
|
||||
local possibility = xr_logic.pick_section_from_condlist(db.actor, victim, possibility_table)
|
||||
if not(possibility) or (possibility=="false") then
|
||||
str = str .. get_possibility_string(mechanic_name, possibility_table)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Check global precondition
|
||||
if (not custom) then
|
||||
local indx = section:sub(14,14)
|
||||
local tier = indx and upg_ind[indx] or 1
|
||||
local tier_con = param_ini:r_float_ex(mechanic_name, "def_upgr_tier_" .. tier)
|
||||
--printf("upgrade global precond | mechanic_name: %s - tier: %s - tier_con: %s ", mechanic_name, tier, tier_con)
|
||||
|
||||
-- check if mechanic has tools suitable upgrade's tier
|
||||
if (tier_con == 0) then
|
||||
if (not has_alife_info(mechanic_name .. "_upgrade_tier_" .. tier)) then
|
||||
-- Edited by Sota
|
||||
--str = str .. "\\n - " .. game.translate_string("st_upgr_condlist")
|
||||
str = str .. "\\n • " .. game.translate_string("st_upgr_condlist")
|
||||
end
|
||||
-- permanently locked
|
||||
elseif (tier_con == 1) then
|
||||
-- Edited by Sota
|
||||
--str = str .. "\\n - " .. game.translate_string("st_upgr_cant_do")
|
||||
str = str .. "\\n • " .. game.translate_string("st_upgr_cant_do")
|
||||
end
|
||||
end
|
||||
|
||||
-- Check money
|
||||
local actor = db.actor
|
||||
if actor then
|
||||
-- We read from the upgrade section its price
|
||||
local price = math.floor(char_ini:r_u32(section, "cost")*cur_price_percent)
|
||||
-- Read the number of dough from YY
|
||||
local cash = actor:money()
|
||||
-- If the bubble is not enough, then we list the corresponding line
|
||||
if (cash < price) then
|
||||
-- Edited by Sota
|
||||
--str = str .. "\\n - "..game.translate_string("st_upgr_enough_money").."\\n • "..price-cash.." RU"
|
||||
str = str .. "\\n • " .. game.translate_string("st_upgr_enough_money") .. ": " .. price-cash .. " RU"
|
||||
end
|
||||
end
|
||||
return str
|
||||
end
|
||||
@@ -0,0 +1,947 @@
|
||||
bar_list = {
|
||||
["condition_progess_bar"] = { min= {255,196,18,18,0}, mid= {255,255,255,118,0.5}, max= {255,107,207,119,1}, background= true},
|
||||
["power_progess_bar"] = { def= GetARGB(255,86,196,209), background= true },
|
||||
["uses_progess_bar"] = { def= GetARGB(255,255,255,255), background= false },
|
||||
}
|
||||
local lerp_color = utils_xml.lerp_color
|
||||
local gc = game.translate_string
|
||||
local string_find = string.find
|
||||
utjan_xml = nil
|
||||
|
||||
base_init = utils_ui.UICellItem.InitControls
|
||||
function utils_ui.UICellItem:InitControls(path, st)
|
||||
self.disable_bar_og = self.disable_bar -- save original game setting for disabling bar in case user toggles bar visibility
|
||||
base_init(self, path, st)
|
||||
end
|
||||
|
||||
base_pbar = utils_ui.UICellItem.Add_ProgressBar
|
||||
function utils_ui.UICellItem:Add_ProgressBar(xml, obj, sec, clsid)
|
||||
local hide_non_equipped = settings.cond_text.hide_bar and not (self.path == "equipment:cont_equ")
|
||||
local hide_on_magazine = settings.mag_info.hide_bar and magazine_binder and magazine_binder.is_magazine(sec)
|
||||
if not IsItem("multiuse", sec) and (hide_non_equipped or hide_on_magazine) then
|
||||
self.disable_bar = true
|
||||
else
|
||||
self.disable_bar = self.disable_bar_og
|
||||
end
|
||||
|
||||
base_pbar(self, xml, obj, sec, clsid)
|
||||
|
||||
Add_Parts_Bars(self, xml, obj, sec, clsid)
|
||||
|
||||
Add_Mag_Icon_Text(self, xml, obj, sec, clsid)
|
||||
|
||||
Add_Condition_Text(self, xml, obj, sec, clsid)
|
||||
end
|
||||
|
||||
base_counter = utils_ui.UICellItem.Add_Counter
|
||||
function utils_ui.UICellItem:Add_Counter(xml, obj, sec)
|
||||
base_counter(self, xml, obj, sec)
|
||||
|
||||
Add_Ammo_Short_Name_Text(self, xml, obj, sec)
|
||||
|
||||
Add_Money_Text(self, xml, obj, sec)
|
||||
|
||||
Add_Recipe_Icon_Text(self, xml, obj, sec)
|
||||
|
||||
Add_Weapon_Name(self, xml, obj, sec)
|
||||
|
||||
Add_Repair_Icon(self, xml, obj, sec)
|
||||
end
|
||||
|
||||
base_reset = utils_ui.UICellItem.Reset
|
||||
function utils_ui.UICellItem:Reset()
|
||||
base_reset(self)
|
||||
if (self.manual) then
|
||||
if self.parts_indicators then
|
||||
for k,v in pairs(self.parts_indicators) do
|
||||
self.parts_indicators[k]:Show(false)
|
||||
end
|
||||
end
|
||||
|
||||
if self.cond_text then
|
||||
self.cond_text:Show(false)
|
||||
end
|
||||
if self.cond_text_bg then
|
||||
self.cond_text_bg:Show(false)
|
||||
end
|
||||
if self.wpn_name then
|
||||
self.wpn_name:Show(false)
|
||||
end
|
||||
if self.gun_repair_icon then
|
||||
self.gun_repair_icon:Show(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
valid_wpn_kinds = {
|
||||
["w_rifle"] = true,
|
||||
["w_smg"] = true,
|
||||
["w_pistol"] = true,
|
||||
["w_shotgun"] = true,
|
||||
["w_sniper"] = true,
|
||||
["w_explosive"] = true,
|
||||
["w_melee"] = true,
|
||||
}
|
||||
|
||||
grenade_classes = {
|
||||
["G_F1"] = true,
|
||||
["G_F1_S"] = true,
|
||||
["G_RGD5_S"] = true,
|
||||
}
|
||||
|
||||
main_slot_indexes = {
|
||||
[2] = true,
|
||||
[3] = true,
|
||||
}
|
||||
|
||||
-- AlphaLion wpn name
|
||||
function Add_Weapon_Name(self, xml, obj, sec)
|
||||
if self.wpn_name then
|
||||
self.wpn_name:Show(false)
|
||||
end
|
||||
|
||||
if not settings.wpn_info.show_wpn_name then return end
|
||||
|
||||
local class = SYS_GetParam(0, sec, "class")
|
||||
if not settings.wpn_info.show_grenade_name and grenade_classes[class] then return end
|
||||
|
||||
local kind = SYS_GetParam(0, sec, "kind")
|
||||
if not valid_wpn_kinds[kind] then return end
|
||||
|
||||
if not settings.wpn_info.show_melee and kind == "w_melee" then return end
|
||||
|
||||
local wpn_name_short = SYS_GetParam(0, sec, "inv_name_short")
|
||||
if not wpn_name_short then return end
|
||||
|
||||
local is_equipped = self.path == "equipment:cont_equ"
|
||||
if settings.wpn_info.main_slots_only and is_equipped and not main_slot_indexes[self.indx] then return end
|
||||
|
||||
self.wpn_name = self.wpn_name or utjan_xml:InitTextWnd("counter_text", self.cell)
|
||||
self.wpn_name:SetEllipsis(true)
|
||||
|
||||
local name = game.translate_string(wpn_name_short)
|
||||
self.wpn_name:SetText(name)
|
||||
self.wpn_name:AdjustHeightToText()
|
||||
self.wpn_name:AdjustWidthToText()
|
||||
|
||||
local x_offset = self.bar and self.bar:IsShown() and self.bar:GetWndPos().x + self.bar:GetWidth() or 0
|
||||
if self.parts_indicators then
|
||||
for k,v in pairs(self.parts_indicators) do
|
||||
local part_x_edge = self.parts_indicators[k]:IsShown() and self.parts_indicators[k]:GetWndPos().x + self.parts_indicators[k]:GetWidth() or 0
|
||||
if part_x_edge > x_offset then
|
||||
x_offset = part_x_edge
|
||||
end
|
||||
end
|
||||
end
|
||||
if self.cond_text and self.cond_text:IsShown() then
|
||||
local cond_text_x_edge = self.cond_text:GetWndPos().x + self.cond_text:GetWidth()
|
||||
if cond_text_x_edge > x_offset then
|
||||
x_offset = cond_text_x_edge
|
||||
end
|
||||
end
|
||||
|
||||
local cell_h = self.cell:GetHeight()
|
||||
local cell_w = self.cell:GetWidth()
|
||||
|
||||
if not is_equipped then
|
||||
self.wpn_name:SetTextAlignment(1)
|
||||
self.wpn_name:SetWndRect(Frect():set(0, 0, cell_w - (x_offset + 2),self.wpn_name:GetHeight() + 2))
|
||||
self.wpn_name:SetWndPos(vector2():set(x_offset, cell_h - self.wpn_name:GetHeight()))
|
||||
else
|
||||
self.wpn_name:SetTextAlignment(2)
|
||||
self.wpn_name:SetWndRect(Frect():set(0, 0, cell_w, self.wpn_name:GetHeight() + 2))
|
||||
self.wpn_name:SetWndPos(vector2():set(0, 3))
|
||||
end
|
||||
|
||||
self.wpn_name:Show(true)
|
||||
end
|
||||
|
||||
function set_text_rect(ele, padding_w, padding_h, text)
|
||||
if text then
|
||||
ele:SetText(text)
|
||||
end
|
||||
ele:AdjustHeightToText()
|
||||
ele:AdjustWidthToText()
|
||||
local width = ele:GetWidth()
|
||||
local height = ele:GetHeight()
|
||||
ele:SetWndRect(Frect():set(0, 0, width + padding_w, height + padding_h))
|
||||
end
|
||||
|
||||
-- MONEY TEXT
|
||||
function Add_Money_Text(self, xml, obj, sec)
|
||||
if self.money_text then
|
||||
self.money_text:Show(false)
|
||||
end
|
||||
if self.money_text_bg then
|
||||
self.money_text_bg:Show(false)
|
||||
end
|
||||
|
||||
if not settings.money_text.enable then return end
|
||||
|
||||
local money_amount = IsItem("money", sec) or parse_list(ini_sys, sec, "money_value") -- money_value is used for Lootboxes cash stacks
|
||||
if not (money_amount and money_amount[1]) then return end
|
||||
|
||||
local show_bg = not settings.money_text.hide_bg
|
||||
if show_bg then
|
||||
self.money_text_bg = self.money_text_bg or utjan_xml:InitStatic("background", self.cell)
|
||||
end
|
||||
self.money_text = self.money_text or utjan_xml:InitTextWnd("counter_text", self.cell)
|
||||
|
||||
local text
|
||||
if money_amount[2] then
|
||||
text = gc("ui_utjan_ruble") .. ((money_amount[1] + money_amount[2]) / 2) .. "~"
|
||||
else
|
||||
text = gc("ui_utjan_ruble") .. money_amount[1]
|
||||
end
|
||||
|
||||
local text_padding_w = settings.money_text.padding + 1
|
||||
local text_padding_h = settings.money_text.padding
|
||||
set_text_rect(self.money_text, text_padding_w, text_padding_h, text)
|
||||
local text_height = self.money_text:GetHeight()
|
||||
local cell_h = self.cell:GetHeight()
|
||||
|
||||
self.money_text:SetWndPos( vector2():set( 0 , cell_h - text_height) )
|
||||
|
||||
if show_bg then
|
||||
self.money_text_bg:SetWndRect(Frect():set(0, 0, self.money_text:GetWidth(), self.money_text:GetHeight()))
|
||||
self.money_text_bg:SetWndPos( self.money_text:GetWndPos() )
|
||||
self.money_text_bg:Show(true)
|
||||
end
|
||||
|
||||
self.money_text:Show(true)
|
||||
end
|
||||
-- MONEY TEXT END
|
||||
|
||||
-- ADD CONDITION TEXT
|
||||
arty_table = {
|
||||
["i_arty_junk"] = true,
|
||||
["i_arty"] = true,
|
||||
["i_arty_cont"] = true,
|
||||
}
|
||||
|
||||
function Add_Condition_Text(self, xml, obj, sec, clsid)
|
||||
if self.cond_text then
|
||||
self.cond_text:Show(false)
|
||||
end
|
||||
if self.cond_text_bg then
|
||||
self.cond_text_bg:Show(false)
|
||||
end
|
||||
|
||||
if not settings.cond_text.enable then return end
|
||||
|
||||
if self.disable_bar_og then return end -- dont show condition when the vanilla scripts hide the condition bar
|
||||
|
||||
local is_equipped = self.path == "equipment:cont_equ"
|
||||
if not settings.cond_text.enable_equipped and is_equipped then return end
|
||||
if IsItem("multiuse",sec) then return end
|
||||
|
||||
local has_cond = utils_item.is_degradable(obj, sec) or IsWeapon(nil,clsid) or IsOutfit(nil,clsid) or IsHeadgear(nil,clsid)
|
||||
if (not has_cond) then return end
|
||||
|
||||
if magazine_binder and magazine_binder.is_magazine(sec) then return end
|
||||
|
||||
local show_bg = not settings.cond_text.hide_bg
|
||||
if show_bg and not is_equipped then
|
||||
self.cond_text_bg = self.cond_text_bg or utjan_xml:InitStatic("background", self.cell)
|
||||
end
|
||||
|
||||
self.cond_text = self.cond_text or utjan_xml:InitTextWnd("counter_text", self.cell)
|
||||
|
||||
local cond = obj:condition()
|
||||
local str = SYS_GetParam(0,sec, "condition_bar","condition_progess_bar")
|
||||
local props = bar_list[str]
|
||||
local color = props.def or lerp_color( cond , props.min , props.mid , props.max )
|
||||
if color then
|
||||
self.cond_text:SetTextColor( color )
|
||||
end
|
||||
|
||||
local text = math.ceil(cond * 100) .. "%"
|
||||
local text_padding_w = is_equipped and 0 or settings.cond_text.padding + 1
|
||||
local text_padding_h = is_equipped and 0 or settings.cond_text.padding
|
||||
set_text_rect(self.cond_text, text_padding_w, text_padding_h, text)
|
||||
|
||||
local text_height = self.cond_text:GetHeight()
|
||||
local kind = SYS_GetParam(0, sec, "kind", "na")
|
||||
|
||||
if arty_table[kind] then
|
||||
local alt_artefact_pos = settings.cond_text.alt_artefact_pos
|
||||
if alt_artefact_pos == 0 then
|
||||
self.cond_text:SetWndPos( vector2():set( 0 , self.cell:GetHeight() - text_height) )
|
||||
elseif alt_artefact_pos == 1 then
|
||||
self.cond_text:SetWndPos( vector2():set( self.cell:GetWidth() - self.cond_text:GetWidth() , self.cell:GetHeight() - text_height) )
|
||||
elseif alt_artefact_pos == 2 then
|
||||
self.cond_text:SetWndPos( vector2():set( self.cell:GetWidth() - self.cond_text:GetWidth() , 0) )
|
||||
end
|
||||
elseif is_equipped and settings.cond_text.enable_equipped then
|
||||
local pos_adjusted = false
|
||||
local bar_pos = self.bar and self.bar:IsShown() and self.bar:GetWndPos()
|
||||
if self.parts_indicators then -- Adjust position if part dots are shown
|
||||
for k,v in pairs(self.parts_indicators) do
|
||||
if self.parts_indicators[k]:IsShown() then
|
||||
self.cond_text:SetWndPos( vector2():set( bar_pos.x , self.parts_indicators[k]:GetWndPos().y - text_height) )
|
||||
pos_adjusted = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not pos_adjusted then
|
||||
self.cond_text:SetWndPos( vector2():set( bar_pos.x , bar_pos.y - text_height) )
|
||||
end
|
||||
elseif settings.part_dots.enable and (settings.part_dots.position == 1 or (settings.part_dots.position == 2 and is_short_gun(obj, clsid, sec))) then
|
||||
local part_y = self.cell:GetHeight()
|
||||
if self.parts_indicators then
|
||||
for k,v in pairs(self.parts_indicators) do
|
||||
if self.parts_indicators[k]:IsShown() then
|
||||
part_y = self.parts_indicators[k]:GetWndPos().y
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
self.cond_text:SetWndPos( vector2():set( 0 , part_y - text_height) )
|
||||
else
|
||||
local bar_h = self.bar and self.bar:IsShown() and self.bar:GetHeight() or 0
|
||||
self.cond_text:SetWndPos( vector2():set( 0 , self.cell:GetHeight() - bar_h - text_height) )
|
||||
end
|
||||
|
||||
if show_bg and not is_equipped then
|
||||
self.cond_text_bg:SetWndRect(Frect():set(0, 0, self.cond_text:GetWidth(), self.cond_text:GetHeight()))
|
||||
self.cond_text_bg:SetWndPos( self.cond_text:GetWndPos() )
|
||||
self.cond_text_bg:Show(true)
|
||||
end
|
||||
|
||||
self.cond_text:Show(true)
|
||||
end
|
||||
-- END ADD CONDITION TEXT
|
||||
|
||||
-- ADD PART CONDITION BARS
|
||||
function is_short_gun(obj, clsid, sec)
|
||||
if IsWeapon(obj, clsid) and SYS_GetParam(2, sec, "inv_grid_width") == 2 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
-- WPO colors
|
||||
clr_r = GetARGB(255,196,18,18)
|
||||
clr_o = utils_xml.get_color("d_orange", true)
|
||||
clr_y = GetARGB(255,255,255,118)
|
||||
clr_g = GetARGB(255,107,207,119)
|
||||
clr_missing = GetARGB(255,70,60,60) -- Missing part color
|
||||
|
||||
local ini_parts = itms_manager.ini_parts
|
||||
function has_parts(obj)
|
||||
if not obj then return end
|
||||
local sec = SYS_GetParam(0, obj:section(), "parent_section") or obj:section()
|
||||
local parts = ini_parts:r_string_ex("con_parts_list", sec)
|
||||
return parts ~= nil
|
||||
end
|
||||
|
||||
function Add_Parts_Bars(self, xml, obj, sec, clsid)
|
||||
if self.parts_indicators then
|
||||
for k,v in pairs(self.parts_indicators) do
|
||||
self.parts_indicators[k]:Show(false)
|
||||
end
|
||||
end
|
||||
|
||||
if not settings.part_dots.enable then return end
|
||||
if not has_parts(obj) then return end
|
||||
|
||||
local is_equipped = self.path == "equipment:cont_equ"
|
||||
if not settings.part_dots.show_on_equipped and is_equipped then return end
|
||||
|
||||
if not settings.part_dots.show_on_wpn and IsWeapon(nil, clsid) then return end
|
||||
if not settings.part_dots.show_on_armor and (IsHeadgear(nil, clsid) or IsOutfit(nil, clsid)) then return end
|
||||
|
||||
local se_parts = item_parts.get_parts_con(obj, nil, true)
|
||||
if is_empty(se_parts) then return end
|
||||
local parts = dup_table(se_parts)
|
||||
|
||||
self.parts_indicators = self.parts_indicators or {}
|
||||
|
||||
for part, v in pairs(parts) do
|
||||
if SYS_GetParam(1, part, "cond_part") then
|
||||
self.parts_indicators[part] = self.parts_indicators[part] or utjan_xml:InitStatic("cond_dot", self.cell)
|
||||
else
|
||||
parts[part] = nil
|
||||
end
|
||||
end
|
||||
|
||||
-- Added by Sota
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
|
||||
local bar_shown = self.bar and self.bar:IsShown()
|
||||
local bar_h = bar_shown and self.bar:GetHeight() or 0
|
||||
local bar_w = bar_shown and self.bar:GetWidth() or 0
|
||||
local props = bar_list.condition_progess_bar
|
||||
local i = 0
|
||||
for part, condition in spairs(parts, parts_sort) do
|
||||
local bar_pos = bar_shown and self.bar:GetWndPos()
|
||||
local cond_dot_h = 4 --self.parts_indicators[part]:GetHeight()
|
||||
-- Edited by Sota
|
||||
--local cond_dot_w = cond_dot_h * 0.75
|
||||
local cond_dot_w = cond_dot_h * ratio
|
||||
|
||||
cond_dot_h = cond_dot_h * settings.part_dots.size_mult
|
||||
cond_dot_w = cond_dot_w * settings.part_dots.size_mult
|
||||
local cond_text_w = self.cond_text and self.cond_text:GetWidth() or 0
|
||||
local separator_width = settings.part_dots.separator_width
|
||||
|
||||
self.parts_indicators[part]:SetWndRect( Frect():set(0, 0, cond_dot_w, cond_dot_h) )
|
||||
|
||||
if is_equipped then
|
||||
self.parts_indicators[part]:SetWndPos( vector2():set( bar_pos.x + (cond_dot_w + separator_width) * i, bar_pos.y - cond_dot_h * 1.5))
|
||||
else
|
||||
if settings.part_dots.position == 1 or (settings.part_dots.position == 2 and is_short_gun(obj, clsid, sec)) then
|
||||
if bar_shown then
|
||||
self.parts_indicators[part]:SetWndPos( vector2():set( (cond_dot_w + separator_width) * i, self.cell:GetHeight() - bar_h - cond_dot_h * 1.5))
|
||||
else
|
||||
self.parts_indicators[part]:SetWndPos( vector2():set( 1 + (cond_dot_w + separator_width) * i, self.cell:GetHeight() - cond_dot_h * 1.5))
|
||||
end
|
||||
else
|
||||
if bar_shown then
|
||||
self.parts_indicators[part]:SetWndPos( vector2():set( bar_w + 1 + (cond_dot_w + separator_width) * i, self.cell:GetHeight() - cond_dot_h * 1.5))
|
||||
else
|
||||
self.parts_indicators[part]:SetWndPos( vector2():set( cond_text_w + 1 + (cond_dot_w + separator_width) * i, self.cell:GetHeight() - cond_dot_h * 1.5))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local color
|
||||
if settings.part_dots.wpo_mode and IsWeapon(nil, clsid) then -- Weapon Parts Overhaul Colors
|
||||
color = clr_missing
|
||||
if condition >= settings.part_dots.wpo_green then color = clr_g
|
||||
elseif condition >= settings.part_dots.wpo_yellow then color = clr_y
|
||||
elseif condition >= settings.part_dots.wpo_orange then color = clr_o
|
||||
elseif condition > -1 then color = clr_r end
|
||||
else
|
||||
if condition >= 0 then
|
||||
local cond = clamp(condition / 99, 0, 1)
|
||||
color = props.def or lerp_color( cond , props.min , props.mid , props.max )
|
||||
else
|
||||
color = clr_missing
|
||||
end
|
||||
end
|
||||
|
||||
if color then
|
||||
self.parts_indicators[part]:SetTextureColor( color )
|
||||
end
|
||||
self.parts_indicators[part]:Show(true)
|
||||
|
||||
i = i + 1
|
||||
end
|
||||
end
|
||||
|
||||
unique_mapping = {
|
||||
["prt_w_gas_tube_9"] = "extractor",
|
||||
["prt_w_gas_tube_10"] = "extractor",
|
||||
["prt_w_gas_tube_8"] = "ejector",
|
||||
["prt_w_gas_tube_2"] = "pump",
|
||||
["prt_w_bolt_11"] = "hammers",
|
||||
["prt_w_bolt_12"] = "hammers",
|
||||
["prt_w_bolt_carrier_8"] = "chock",
|
||||
["prt_w_bolt_carrier_9"] = "chock",
|
||||
}
|
||||
|
||||
name_mapping = {
|
||||
["barrel"] = 1,
|
||||
["trigger"] = 2,
|
||||
["bolt"] = 3,
|
||||
["bolt_carrier"] = 4,
|
||||
["chock"] = 5,
|
||||
["ejector"] = 6,
|
||||
["extractor"] = 7,
|
||||
["gas_tube"] = 8,
|
||||
["hammers"] = 9,
|
||||
["pump"] = 10,
|
||||
["spring"] = 11,
|
||||
}
|
||||
|
||||
function parts_sort(t, a, b)
|
||||
if not (a and b) then return false end
|
||||
|
||||
local a_map
|
||||
if unique_mapping[a] then
|
||||
a_map = name_mapping[unique_mapping[a]]
|
||||
else
|
||||
for k,v in pairs(name_mapping) do
|
||||
if string_find(a, k) then
|
||||
a_map = v
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local b_map
|
||||
if unique_mapping[b] then
|
||||
b_map = name_mapping[unique_mapping[b]]
|
||||
else
|
||||
for k,v in pairs(name_mapping) do
|
||||
if string_find(b, k) then
|
||||
b_map = v
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
if not (a_map and b_map) then return false end
|
||||
return a_map < b_map
|
||||
end
|
||||
-- ADD PART CONDITION BARS END
|
||||
|
||||
-- ADD AMMO ITEM SHORT NAME TEXT
|
||||
valid_ammo_class = {
|
||||
["AMMO"] = true,
|
||||
["AMMO_S"] = true,
|
||||
}
|
||||
|
||||
valid_exlosive_ammo = {
|
||||
["S_M209"] = true,
|
||||
["S_VOG25"] = true,
|
||||
["S_OG7B"] = true,
|
||||
}
|
||||
|
||||
function Add_Ammo_Short_Name_Text(self, xml, obj, sec)
|
||||
if self.ammo_name_bg then
|
||||
for k,v in pairs(self.ammo_name_bg)do
|
||||
self.ammo_name_bg[k]:Show(false)
|
||||
end
|
||||
end
|
||||
if self.ammo_name then
|
||||
for k,v in pairs(self.ammo_name)do
|
||||
self.ammo_name[k]:Show(false)
|
||||
end
|
||||
end
|
||||
|
||||
local class = SYS_GetParam(0, sec, "class")
|
||||
if not (valid_ammo_class[class] or valid_exlosive_ammo[class]) then return end
|
||||
if not settings.ammo_name.enable and valid_ammo_class[class] then return end
|
||||
if not settings.ammo_name.show_expl and valid_exlosive_ammo[class] then return end
|
||||
|
||||
local is_component = SYS_GetParam(1, sec, "is_component")
|
||||
if is_component then return end -- Ammo maker compat
|
||||
|
||||
local ammo_name_short = SYS_GetParam(0, sec, "inv_name_short")
|
||||
if not ammo_name_short then return end
|
||||
|
||||
self.ammo_name = {}
|
||||
self.ammo_name_bg = {}
|
||||
|
||||
local gc_name = gc(ammo_name_short)
|
||||
local i = 1
|
||||
local name_cutoff = ""
|
||||
|
||||
while i > 0 do
|
||||
self.ammo_name_bg[i] = self.ammo_name_bg[i] or utjan_xml:InitStatic("background", self.cell)
|
||||
self.ammo_name[i] = self.ammo_name[i] or utjan_xml:InitTextWnd("counter_text", self.cell)
|
||||
|
||||
local text_padding = settings.ammo_name.padding
|
||||
set_text_rect(self.ammo_name[i], text_padding, text_padding, gc_name)
|
||||
|
||||
local incr_i = false
|
||||
while (self.ammo_name[i]:GetWidth() > self.cell:GetWidth()) do
|
||||
local str_table = str_explode(gc_name, " ")
|
||||
if #str_table == 1 then
|
||||
break
|
||||
end
|
||||
|
||||
if name_cutoff == "" then
|
||||
name_cutoff = str_table[1]
|
||||
else
|
||||
name_cutoff = name_cutoff .. " " .. str_table[1]
|
||||
end
|
||||
|
||||
gc_name = ""
|
||||
for i = 2, #str_table do
|
||||
gc_name = gc_name .. str_table[i]
|
||||
if #str_table > i then
|
||||
gc_name = gc_name .. " "
|
||||
end
|
||||
end
|
||||
|
||||
set_text_rect(self.ammo_name[i], text_padding, text_padding, gc_name)
|
||||
incr_i = true
|
||||
end
|
||||
|
||||
local name_h = self.ammo_name[i]:GetHeight()
|
||||
local name_w = self.ammo_name[i]:GetWidth()
|
||||
|
||||
self.ammo_name[i]:SetWndPos( vector2():set( 0 , self.H - (name_h * i)) )
|
||||
-- Edited by Sota
|
||||
--local bg_padding = name_w * 0.08
|
||||
local bg_padding = name_w * 0.025
|
||||
|
||||
self.ammo_name_bg[i]:SetWndRect(Frect():set(0, 0, name_w + (bg_padding * 2), name_h))
|
||||
local name_pos = self.ammo_name[i]:GetWndPos()
|
||||
self.ammo_name_bg[i]:SetWndPos( vector2():set(name_pos.x - bg_padding , name_pos.y ) )
|
||||
|
||||
if valid_ammo_class[class] and settings.ammo_name.bad_color or
|
||||
valid_exlosive_ammo[class] and settings.ammo_name.expl_bad_color then
|
||||
if string.find(sec, "_verybad") then
|
||||
self.ammo_name[i]:SetTextColor( clr_r )
|
||||
elseif string.find(sec, "_bad") then
|
||||
self.ammo_name[i]:SetTextColor( clr_o )
|
||||
else
|
||||
self.ammo_name[i]:SetTextColor( clr_g )
|
||||
end
|
||||
end
|
||||
|
||||
-- Check if ammo icon is dimmed in crafting list
|
||||
local craft_gui = ui_workshop.GUI and ui_workshop.GUI:IsShown() and ui_workshop.GUI.dlg_craft
|
||||
if craft_gui then
|
||||
local menu = craft_gui.list_menu:GetSelectedItem()
|
||||
local last_type = menu and menu.idx
|
||||
local r = last_type and craft_gui.recipes[last_type] or {}
|
||||
local rsp_sec
|
||||
for k,v in pairs(r) do
|
||||
if r[k].sec == sec then
|
||||
rsp_sec = r[k].rsp
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if rsp_sec and not craft_gui.recipes_items[rsp_sec] then
|
||||
local txt_clr = self.ammo_name[i]:GetTextColor()
|
||||
self.ammo_name[i]:SetTextColor( change_alpha(txt_clr, 140) )
|
||||
local bg_clr = self.ammo_name_bg[i]:GetTextureColor()
|
||||
self.ammo_name_bg[i]:SetTextureColor( change_alpha(bg_clr, 140) )
|
||||
end
|
||||
end
|
||||
|
||||
self.ammo_name_bg[i]:Show(true)
|
||||
self.ammo_name[i]:Show(true)
|
||||
|
||||
if incr_i then
|
||||
i = i + 1
|
||||
gc_name = name_cutoff
|
||||
name_cutoff = ""
|
||||
else
|
||||
i = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function change_alpha(clr, a)
|
||||
if not clr and a ~= nil then return end
|
||||
|
||||
local b = bit.band(clr, 255)
|
||||
local g = bit.band(bit.rshift(clr, 8), 255)
|
||||
local r = bit.band(bit.rshift(clr, 16), 255)
|
||||
|
||||
return GetARGB(a, r, g, b)
|
||||
end
|
||||
-- ADD AMMO ITEM SHORT NAME TEXT END
|
||||
|
||||
-- ADD RECIPE READ/UNREAD TEXT
|
||||
one_use_recipes = {
|
||||
recipe_cooking_1 = true,
|
||||
}
|
||||
|
||||
workshop_autoinject_known_recipes = {}
|
||||
|
||||
functor_table_readable = {
|
||||
["item_recipe.func_recipe"] = true,
|
||||
["item_recipe.func_letter"] = true,
|
||||
}
|
||||
|
||||
function Add_Recipe_Icon_Text(self, xml, obj, sec)
|
||||
if self.recipe_text then
|
||||
self.recipe_text:Show(false)
|
||||
end
|
||||
if self.recipe_text_bg then
|
||||
self.recipe_text_bg:Show(false)
|
||||
end
|
||||
|
||||
if not settings.recipe_text.enable then return end
|
||||
if not sec then return end
|
||||
|
||||
local use_map = SYS_GetParam(0, sec, "use_map")
|
||||
local functor = SYS_GetParam(0, sec, "use1_action_functor", "na")
|
||||
local has_encyclopedia = functor_table_readable[functor]
|
||||
local is_pda = functor == "ui_pda_npc_tab.use_view"
|
||||
if not (has_encyclopedia or is_pda or use_map or one_use_recipes[sec]) then return end
|
||||
|
||||
if not settings.recipe_text.show_on_pda and is_pda then return end
|
||||
|
||||
local has_stash
|
||||
if is_pda and obj then
|
||||
local pda_info = se_load_var(obj:id(), obj:name(), "info")
|
||||
if pda_info and pda_info.msg then
|
||||
for k,v in pairs(pda_info.msg) do
|
||||
if pda_info.msg[k].stash and not pda_info.msg[k].stash_read then
|
||||
has_stash = true
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if is_pda and not has_stash then return end
|
||||
|
||||
local recipe_is_known
|
||||
if use_map then
|
||||
local maps = game_statistics.actor_anomaly_maps or {}
|
||||
recipe_is_known = maps[use_map] or false
|
||||
else
|
||||
workshop_autoinject_known_recipes = workshop_autoinject and workshop_autoinject.known_recipe or workshop_autoinject_known_recipes
|
||||
recipe_is_known = workshop_autoinject_known_recipes[sec] or ui_pda_encyclopedia_tab.is_unlocked_note("encyclopedia__notes_" .. sec)
|
||||
end
|
||||
|
||||
self.recipe_text_bg = self.recipe_text_bg or utjan_xml:InitStatic("background", self.cell)
|
||||
self.recipe_text = self.recipe_text or utjan_xml:InitTextWnd("counter_text", self.cell)
|
||||
|
||||
local text
|
||||
if recipe_is_known then
|
||||
text = gc("ui_utjan_recipe_read")
|
||||
self.recipe_text:SetTextColor( GetARGB(255, 185, 162, 138))
|
||||
elseif has_stash then
|
||||
text = "(???)"
|
||||
self.recipe_text:SetTextColor( GetARGB(255, 255, 232, 208))
|
||||
else
|
||||
text = gc("ui_utjan_recipe_unread")
|
||||
self.recipe_text:SetTextColor( GetARGB(255, 255, 232, 208))
|
||||
end
|
||||
|
||||
local text_padding = settings.recipe_text.padding
|
||||
set_text_rect(self.recipe_text, text_padding + 1, text_padding, text)
|
||||
|
||||
local name_h = self.recipe_text:GetHeight()
|
||||
local name_w = self.recipe_text:GetWidth()
|
||||
if has_stash then
|
||||
local bar_h = self.bar and self.bar:IsShown() and self.bar:GetHeight() or 0
|
||||
local cond_text_h = self.cond_text and self.cond_text:IsShown() and self.cond_text:GetHeight() or 0
|
||||
self.recipe_text:SetWndPos( vector2():set( 0 , self.H - bar_h - cond_text_h - name_h) )
|
||||
else
|
||||
self.recipe_text:SetWndPos( vector2():set( 0 , self.H - name_h) )
|
||||
end
|
||||
-- Edited by Sota
|
||||
--local bg_padding = name_w * 0.08
|
||||
local bg_padding = name_w * 0.025
|
||||
|
||||
self.recipe_text_bg:SetWndRect(Frect():set(0, 0, name_w + (bg_padding * 2), name_h))
|
||||
local name_pos = self.recipe_text:GetWndPos()
|
||||
self.recipe_text_bg:SetWndPos( vector2():set(name_pos.x - bg_padding , name_pos.y ) )
|
||||
|
||||
self.recipe_text_bg:Show(true)
|
||||
self.recipe_text:Show(true)
|
||||
end
|
||||
|
||||
if workshop_autoinject and not workshop_autoinject.known_recipe then
|
||||
base_wai_load = workshop_autoinject.load_state
|
||||
function workshop_autoinject.load_state(mdata)
|
||||
base_wai_load(mdata)
|
||||
workshop_autoinject_known_recipes = mdata.known_recipe or {}
|
||||
end
|
||||
end
|
||||
-- ADD RECIPE READ/UNREAD TEXT END
|
||||
|
||||
-- ADD MAGS REDUX ITEM TEXT
|
||||
function Add_Mag_Icon_Text(self, xml, obj, sec, clsid)
|
||||
if not magazine_binder then return end
|
||||
|
||||
if self.mag_ammo_count then
|
||||
self.mag_ammo_count:Show(false)
|
||||
end
|
||||
if self.mag_ammo_count_bg then
|
||||
self.mag_ammo_count_bg:Show(false)
|
||||
end
|
||||
if self.mag_ammo_name_bg then
|
||||
for k,v in pairs(self.mag_ammo_name_bg)do
|
||||
self.mag_ammo_name_bg[k]:Show(false)
|
||||
end
|
||||
end
|
||||
if self.mag_ammo_name then
|
||||
for k,v in pairs(self.mag_ammo_name)do
|
||||
self.mag_ammo_name[k]:Show(false)
|
||||
end
|
||||
end
|
||||
|
||||
if not settings.mag_info.enable then return end
|
||||
if not magazine_binder.is_magazine(sec) then return end
|
||||
if (not self.ID) or self.manual then return end
|
||||
local mag_data = magazine_binder.get_data(self.ID)
|
||||
if not mag_data then return end
|
||||
|
||||
if self.cond_text then
|
||||
self.cond_text:Show(false)
|
||||
end
|
||||
if self.cond_text_bg then
|
||||
self.cond_text_bg:Show(false)
|
||||
end
|
||||
|
||||
local count_h
|
||||
local bar_h = self.bar and self.bar:IsShown() and self.bar:GetHeight() or 0
|
||||
|
||||
if settings.mag_info.show_ammo_count then
|
||||
self.mag_ammo_count_bg = self.mag_ammo_count_bg or utjan_xml:InitStatic("background", self.cell)
|
||||
self.mag_ammo_count = self.mag_ammo_count or utjan_xml:InitTextWnd("condition_text", self.cell)
|
||||
|
||||
local mag_capacity = SYS_GetParam(2, sec, "max_mag_size")
|
||||
local text = #mag_data.loaded .. "/" .. mag_capacity
|
||||
local text_padding = settings.mag_info.padding
|
||||
set_text_rect(self.mag_ammo_count, text_padding + 1, text_padding, text)
|
||||
|
||||
count_h = self.mag_ammo_count:GetHeight() + bar_h
|
||||
local count_w = self.mag_ammo_count:GetWidth()
|
||||
self.mag_ammo_count:SetWndPos( vector2():set( 0 , self.H - count_h) )
|
||||
self.mag_ammo_count_bg:SetWndRect(Frect():set(0, 0, count_w, count_h))
|
||||
self.mag_ammo_count_bg:SetWndPos( self.mag_ammo_count:GetWndPos() )
|
||||
|
||||
local props = bar_list["condition_progess_bar"]
|
||||
local cond = #mag_data.loaded / mag_capacity
|
||||
local color = props.def or lerp_color( cond , props.min , props.mid , props.max )
|
||||
if color then
|
||||
self.mag_ammo_count:SetTextColor( color )
|
||||
end
|
||||
|
||||
self.mag_ammo_count_bg:Show(true)
|
||||
self.mag_ammo_count:Show(true)
|
||||
else
|
||||
count_h = 0
|
||||
end
|
||||
|
||||
if not settings.mag_info.show_ammo_name then return end
|
||||
if not (#mag_data.loaded > 0) then return end
|
||||
|
||||
self.mag_ammo_name = {}
|
||||
self.mag_ammo_name_bg = {}
|
||||
|
||||
local last_bullet_sec
|
||||
for k,v in pairs(mag_data.loaded) do
|
||||
last_bullet_sec = v
|
||||
end
|
||||
local inv_short_name = SYS_GetParam(0, last_bullet_sec, "inv_name_short", "Bullet?")
|
||||
local gc_name = gc(inv_short_name)
|
||||
|
||||
local i = 1
|
||||
local name_cutoff = ""
|
||||
|
||||
while i > 0 do
|
||||
self.mag_ammo_name_bg[i] = self.mag_ammo_name_bg[i] or utjan_xml:InitStatic("background", self.cell)
|
||||
self.mag_ammo_name[i] = self.mag_ammo_name[i] or utjan_xml:InitTextWnd("counter_text", self.cell)
|
||||
|
||||
local text_padding = settings.mag_info.padding
|
||||
set_text_rect(self.mag_ammo_name[i], text_padding, text_padding, gc_name)
|
||||
|
||||
local incr_i = false
|
||||
while (self.mag_ammo_name[i]:GetWidth() > self.cell:GetWidth()) do
|
||||
local str_table = str_explode(gc_name, " ")
|
||||
if #str_table == 1 then
|
||||
break
|
||||
end
|
||||
|
||||
if name_cutoff == "" then
|
||||
name_cutoff = str_table[1]
|
||||
else
|
||||
name_cutoff = name_cutoff .. " " .. str_table[1]
|
||||
end
|
||||
|
||||
gc_name = ""
|
||||
for i = 2, #str_table do
|
||||
gc_name = gc_name .. str_table[i]
|
||||
if #str_table > i then
|
||||
gc_name = gc_name .. " "
|
||||
end
|
||||
end
|
||||
|
||||
set_text_rect(self.mag_ammo_name[i], text_padding, text_padding, gc_name)
|
||||
incr_i = true
|
||||
end
|
||||
|
||||
local name_h = self.mag_ammo_name[i]:GetHeight()
|
||||
local name_w = self.mag_ammo_name[i]:GetWidth()
|
||||
|
||||
self.mag_ammo_name[i]:SetWndPos( vector2():set( 0 , self.H - count_h - (name_h * i)) )
|
||||
-- Edited by Sota
|
||||
--local bg_padding = name_w * 0.08
|
||||
local bg_padding = name_w * 0.025
|
||||
|
||||
self.mag_ammo_name_bg[i]:SetWndRect(Frect():set(0, 0, name_w + (bg_padding * 2), name_h))
|
||||
local name_pos = self.mag_ammo_name[i]:GetWndPos()
|
||||
self.mag_ammo_name_bg[i]:SetWndPos( vector2():set(name_pos.x - bg_padding , name_pos.y ) )
|
||||
|
||||
self.mag_ammo_name_bg[i]:Show(true)
|
||||
self.mag_ammo_name[i]:Show(true)
|
||||
|
||||
if incr_i then
|
||||
i = i + 1
|
||||
gc_name = name_cutoff
|
||||
name_cutoff = ""
|
||||
else
|
||||
i = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
-- ADD MAGS REDUX ITEM TEXT END
|
||||
|
||||
function Add_Repair_Icon(self, xml, obj, sec)
|
||||
if self.gun_repair_icon then
|
||||
self.gun_repair_icon:Show(false)
|
||||
end
|
||||
|
||||
if not settings.wpn_info.show_gun_repair_type then return end
|
||||
|
||||
local repair_type = SYS_GetParam(0, sec, "repair_type")
|
||||
if not repair_type then return end
|
||||
|
||||
local icon_texture = repair_type_texture_tbl[repair_type]
|
||||
if not icon_texture then return end
|
||||
|
||||
local is_equipped = self.path == "equipment:cont_equ"
|
||||
|
||||
self.gun_repair_icon = self.gun_repair_icon or utjan_xml:InitStatic("gun_repair_icon", self.cell)
|
||||
self.gun_repair_icon:InitTexture(icon_texture)
|
||||
local y_offset = (not is_equipped) and self.wpn_name and self.wpn_name:IsShown() and self.wpn_name:GetHeight() or 2
|
||||
local x_offset = is_equipped and -4 or -1
|
||||
self.gun_repair_icon:SetWndPos(vector2():set(self.cell:GetWidth() - self.gun_repair_icon:GetWidth() + x_offset, self.cell:GetHeight() - self.gun_repair_icon:GetHeight() - y_offset))
|
||||
self.gun_repair_icon:Show(true)
|
||||
end
|
||||
|
||||
repair_type_texture_tbl = {
|
||||
pistol = "ui_dyn_eq_repair_blue",
|
||||
shotgun = "ui_dyn_eq_repair_green",
|
||||
rifle_5 = "ui_dyn_eq_repair_red",
|
||||
rifle_7 = "ui_dyn_eq_repair_yellow",
|
||||
}
|
||||
|
||||
-- MCM
|
||||
function load_defaults()
|
||||
local t = {}
|
||||
local op = item_icon_info_mcm.op
|
||||
for i, v in ipairs(op.gr) do
|
||||
if v.gr then
|
||||
t[v.id] = {}
|
||||
for ii, vv in ipairs(v.gr) do
|
||||
if vv.def ~= nil then
|
||||
t[v.id][vv.id] = vv.def
|
||||
end
|
||||
end
|
||||
elseif v.def ~= nil then
|
||||
t[v.id] = v.def
|
||||
end
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
settings = load_defaults()
|
||||
|
||||
function load_settings()
|
||||
settings = load_defaults()
|
||||
if ui_mcm then
|
||||
for k, v in pairs(settings) do
|
||||
if type(settings[k]) == "table" then
|
||||
for kk, vv in pairs(settings[k]) do
|
||||
settings[k][kk] = ui_mcm.get("item_icon_info/" .. k .. "/" .. kk)
|
||||
end
|
||||
else
|
||||
settings[k] = ui_mcm.get("item_icon_info/" .. k)
|
||||
end
|
||||
end
|
||||
end
|
||||
return settings
|
||||
end
|
||||
|
||||
function on_game_start()
|
||||
RegisterScriptCallback("actor_on_first_update", load_settings)
|
||||
RegisterScriptCallback("on_option_change", load_settings)
|
||||
|
||||
utjan_xml = CScriptXmlInit()
|
||||
utjan_xml:ParseFile("ui_utjan_icon_info.xml")
|
||||
end
|
||||
@@ -0,0 +1,93 @@
|
||||
function item_recipe.UIRecipe:Reset(section)
|
||||
self.section = section
|
||||
|
||||
local name = ui_item.get_sec_name(section)
|
||||
-- Edited by Sota
|
||||
--self.cap_shadow:SetText( name )
|
||||
self.cap:SetText( name )
|
||||
|
||||
-- Reset recipes
|
||||
empty_table(self.recipes)
|
||||
self:LoadRecipes()
|
||||
|
||||
-- Clear scroll
|
||||
local xml = self.xml
|
||||
self.scroll:Clear()
|
||||
empty_table(self.cells)
|
||||
|
||||
-- Collect valid items
|
||||
local itm_counter = {}
|
||||
db.actor:iterate_inventory( function(temp, item)
|
||||
local sec = item:section()
|
||||
local cnt = IsItem("multiuse",nil,item) and item:get_remaining_uses() or 1
|
||||
itm_counter[sec] = (itm_counter[sec] or 0) + cnt
|
||||
end)
|
||||
-- Edited by Sota
|
||||
--local fnt = GetFontSmall()
|
||||
for i=1,#self.recipes do
|
||||
local _st = xml:InitStatic("recipe:form", nil)
|
||||
self.cells[i] = {}
|
||||
|
||||
xml:InitFrame("recipe:list:frame_1", _st)
|
||||
xml:InitFrame("recipe:list:frame_2", _st)
|
||||
--xml:InitStatic("recipe:list:light", _st)
|
||||
--xml:InitStatic("recipe:list:arrow", _st)
|
||||
local line = xml:InitStatic("recipe:list:pic_line",_st)
|
||||
-- Edited by Sota
|
||||
--line:InitTexture("ui_itm_line")
|
||||
|
||||
local j=1
|
||||
while true do
|
||||
if (j ~= 1) and (not self.recipes[i][j-1]) then
|
||||
break
|
||||
end
|
||||
|
||||
--xml_itm_shadow = xml:InitStatic("recipe:list:itm_" .. tostring(j) .. "_shadow", _st)
|
||||
--xml_itm_shadow:InitTexture("ui_button_light_h")
|
||||
|
||||
local sec = (j == 1) and self.recipes[i].sec or self.recipes[i][j-1][1]
|
||||
local amount_req = (j == 1) and 1 or self.recipes[i][j-1][2]
|
||||
local multi = 1
|
||||
if IsItem("ammo",sec) then
|
||||
multi = IsItem("ammo",sec)
|
||||
end
|
||||
|
||||
local txt = ""
|
||||
local clr = GetARGB(255, 255, 255, 255)
|
||||
if (j == 1) then
|
||||
txt = "x" .. (multi * amount_req)
|
||||
else
|
||||
txt = (multi * (itm_counter[sec] or 0)) .. "/" .. (multi * amount_req)
|
||||
|
||||
-- Edited by Sota
|
||||
if ( (itm_counter[sec] or 0) >= amount_req ) then
|
||||
clr = GetARGB(255, 50, 255, 50)
|
||||
-- added red text color if not enough items
|
||||
else
|
||||
clr = GetARGB(255, 255, 50, 50)
|
||||
end
|
||||
end
|
||||
|
||||
self.cells[i][j] = utils_ui.UICellItem( {path="container" , xml=xml , grid_size=35 } , { path="recipe:list:itm_" .. tostring(j) , base= _st } )
|
||||
self.cells[i][j].showcase = 2
|
||||
self.cells[i][j].disable_bar = true
|
||||
self.cells[i][j]:Set(sec)
|
||||
|
||||
-- Edited by Sota - container with text can now be configured via xml file "ui_items_recipe.xml"
|
||||
--self.cells[i][j]:Add_CustomText( txt, 4, nil, clr, fnt)
|
||||
self.cells[i][j].txt = xml:InitTextWnd("recipe:list:itm_" .. tostring(j), _st)
|
||||
self.cells[i][j].txt:SetText(txt)
|
||||
self.cells[i][j].txt:SetTextColor(clr)
|
||||
|
||||
j = j + 1
|
||||
end
|
||||
|
||||
self.scroll:AddWindow(_st, true)
|
||||
_st:SetAutoDelete(true)
|
||||
end
|
||||
|
||||
-- Showing toolkit icon
|
||||
if self.toolkit then
|
||||
self.cells_tool:Set(self.toolkit)
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
local ratio = utils_xml.screen_ratio()
|
||||
|
||||
local uisleep_initcontrols = ui_sleep_dialog.UISleep.InitControls
|
||||
ui_sleep_dialog.UISleep.InitControls = function(self)
|
||||
uisleep_initcontrols(self)
|
||||
self.wide = false
|
||||
end
|
||||
|
||||
local uisleep_initialize = ui_sleep_dialog.UISleep.Initialize
|
||||
ui_sleep_dialog.UISleep.Initialize = function(self)
|
||||
uisleep_initialize(self)
|
||||
self.sleep_static:SetWndSize(vector2():set(self.sleep_static:GetWidth() * ratio, self.sleep_static:GetHeight() ))
|
||||
self.sleep_static2:SetWndSize(vector2():set(self.sleep_static2:GetWidth() * ratio, self.sleep_static:GetHeight() ))
|
||||
self.sleep_static2:SetWndPos(vector2():set(self.sleep_static:GetWndPos().x + self.sleep_static:GetWidth(), self.sleep_static:GetWndPos().y ))
|
||||
end
|
||||
|
||||
local uisleep_update = ui_sleep_dialog.UISleep.Update
|
||||
ui_sleep_dialog.UISleep.Update = function(self)
|
||||
uisleep_update(self)
|
||||
if self:IsShown() then
|
||||
self.st_marker:SetWndPos(vector2():set(self.st_marker:GetWndPos().x * ratio, 5))
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,315 @@
|
||||
SetTip = ui_workshop.SetTip
|
||||
|
||||
local clr_list = {
|
||||
["g"] = utils_xml.get_color("d_green"),
|
||||
["y"] = utils_xml.get_color("yellow"),
|
||||
["o"] = utils_xml.get_color("d_orange"),
|
||||
["r"] = utils_xml.get_color("d_red"),
|
||||
["b"] = utils_xml.get_color("d_cyan"),
|
||||
["b1"] = utils_xml.get_color("pda_blue"),
|
||||
["b2"] = utils_xml.get_color("d_blue"),
|
||||
["p"] = utils_xml.get_color("d_purple"),
|
||||
["dark"] = utils_xml.get_color("ui_gray_2"),
|
||||
}
|
||||
|
||||
local uiworkshop_initcontrols = ui_workshop.UIWorkshop.InitControls
|
||||
ui_workshop.UIWorkshop.InitControls = function(self)
|
||||
uiworkshop_initcontrols(self)
|
||||
|
||||
self.btn_back = self.xml:Init3tButton("workshop:btn_back", self.dialog)
|
||||
self:Register(self.btn_back, "button_cancel")
|
||||
end
|
||||
|
||||
local uiworkshop_initcallbacks = ui_workshop.UIWorkshop.InitCallBacks
|
||||
ui_workshop.UIWorkshop.InitCallBacks = function(self)
|
||||
uiworkshop_initcallbacks(self)
|
||||
|
||||
self:AddCallback("button_cancel", ui_events.BUTTON_CLICKED, self.Close, self)
|
||||
end
|
||||
--[[
|
||||
local uiworkshop_reset = ui_workshop.UIWorkshop.Reset
|
||||
ui_workshop.UIWorkshop.Reset = function(self, owner, mechanic, toolkits_workshop, dbg)
|
||||
uiworkshop_reset(self, owner, mechanic, toolkits_workshop, dbg)
|
||||
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
if self.owner.item_info then
|
||||
self.owner.item_info:Update()
|
||||
end
|
||||
if self.owner.upgr_info then
|
||||
self.owner.upgr_info:Update()
|
||||
end
|
||||
end
|
||||
--]]
|
||||
local uiworkshopstate_reset = ui_workshop.UIWorkshopState.Reset
|
||||
ui_workshop.UIWorkshopState.Reset = function(self)
|
||||
uiworkshopstate_reset(self)
|
||||
|
||||
-- Mechanic availability
|
||||
local mech_name = game.translate_string("st_ui_workshop_owner_nobody")
|
||||
local str_intro = game.translate_string("st_ui_workshop_info_state_intro")
|
||||
local str_owner = game.translate_string("st_ui_workshop_owner")
|
||||
self.info_text:SetText( str_intro .. clr_list["b2"] .. " \\n • " .. strformat(str_owner,mech_name) )
|
||||
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
if self.owner.item_info then
|
||||
self.owner.item_info:Update()
|
||||
end
|
||||
if self.owner.upgr_info then
|
||||
self.owner.upgr_info:Update()
|
||||
end
|
||||
end
|
||||
|
||||
function ui_workshop.UIWorkshopState:OnKeyboard(dik, keyboard_action)
|
||||
local res = CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
|
||||
if (res == false) then
|
||||
local bind = dik_to_bind(dik)
|
||||
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
|
||||
if dik == DIK_keys.DIK_ESCAPE then
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
self:Reset()
|
||||
self:Close()
|
||||
Unregister_UI("UIWorkshopState")
|
||||
end
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
local uiworkshoprepair_reset = ui_workshop.UIWorkshopRepair.Reset
|
||||
ui_workshop.UIWorkshopRepair.Reset = function(self)
|
||||
uiworkshoprepair_reset(self)
|
||||
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
if self.owner.item_info then
|
||||
self.owner.item_info:Update()
|
||||
end
|
||||
if self.owner.upgr_info then
|
||||
self.owner.upgr_info:Update()
|
||||
end
|
||||
end
|
||||
|
||||
function ui_workshop.UIWorkshopRepair:OnKeyboard(dik, keyboard_action)
|
||||
local res = CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
|
||||
if (res == false) then
|
||||
for name,cc in pairs(self.CC) do
|
||||
cc:OnKeyboard(dik, keyboard_action)
|
||||
end
|
||||
|
||||
local bind = dik_to_bind(dik)
|
||||
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
|
||||
if dik == DIK_keys.DIK_ESCAPE then
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
self:Reset()
|
||||
self:Close()
|
||||
Unregister_UI("UIWorkshopRepair")
|
||||
end
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
local uiworkshopupgrade_reset = ui_workshop.UIWorkshopUpgrade.Reset
|
||||
ui_workshop.UIWorkshopUpgrade.Reset = function(self)
|
||||
uiworkshopupgrade_reset(self)
|
||||
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
if self.owner.item_info then
|
||||
self.owner.item_info:Update()
|
||||
end
|
||||
if self.owner.upgr_info then
|
||||
self.owner.upgr_info:Update()
|
||||
end
|
||||
end
|
||||
|
||||
function ui_workshop.UIWorkshopUpgrade:Update()
|
||||
CUIScriptWnd.Update(self)
|
||||
|
||||
local info_box = self.owner.item_info
|
||||
local upgr_box = self.owner.upgr_info
|
||||
|
||||
-- Item upgrade toolkit
|
||||
if self.itm_ico_rq:IsCursorOverWindow() and self.upgr_toolkit then
|
||||
self.update_cache["type"] = 1 -- reset cache
|
||||
upgr_box:Update()
|
||||
info_box:Update(nil,self.upgr_toolkit)
|
||||
return
|
||||
end
|
||||
|
||||
-- Item cell containers
|
||||
local found_cell = self.CC:Update(info_box)
|
||||
if (found_cell) then
|
||||
self.update_cache["type"] = 1 -- reset cache
|
||||
upgr_box:Update()
|
||||
return
|
||||
end
|
||||
|
||||
-- Upgrade tree
|
||||
for k1,v1 in pairs(self.upgr_xml) do
|
||||
for k2,v2 in pairs(v1) do
|
||||
if v2.pic:IsCursorOverWindow() and self.upgr[k1][k2] then
|
||||
-- Cache
|
||||
if (self.update_cache["type"] == 2) and (self.update_cache["k1"] == k1) and (self.update_cache["k2"] == k2) then
|
||||
upgr_box:Update(self.update_cache["section"], self.update_cache["prereq"], self.update_cache["installed"])
|
||||
return
|
||||
end
|
||||
|
||||
local section = self.upgr[k1][k2].section
|
||||
local installed = self.inst_upgr[section]
|
||||
local prereq = ""
|
||||
local t = self.upgr_flags[k1][k2]
|
||||
local has_prereq = false
|
||||
for i=1,#t do
|
||||
if (not t[i]) then
|
||||
local str = game.translate_string("st_ui_workshop_no_upgr_" .. tostring(i))
|
||||
if (i == 1) then
|
||||
local main_tool = self.upgr_toolkit or ""
|
||||
str = strformat(str, ui_item.get_sec_name(main_tool))
|
||||
elseif (i == 2) then
|
||||
local tool = self.upgr[k1][k2].tool or ""
|
||||
str = strformat(str, ui_item.get_sec_name(tool))
|
||||
end
|
||||
-- Edited by Sota
|
||||
--prereq = prereq .. "\\n - " .. str
|
||||
prereq = prereq .. "\\n • " .. str
|
||||
|
||||
has_prereq = true
|
||||
end
|
||||
end
|
||||
if has_prereq then
|
||||
prereq = game.translate_string("st_upgr_disable") .. prereq
|
||||
elseif installed then
|
||||
prereq = game.translate_string("st_upgr_installed")
|
||||
end
|
||||
|
||||
-- Cache
|
||||
self.update_cache["type"] = 2
|
||||
self.update_cache["k1"] = k1
|
||||
self.update_cache["k2"] = k2
|
||||
self.update_cache["section"] = section
|
||||
self.update_cache["installed"] = installed
|
||||
self.update_cache["prereq"] = prereq
|
||||
|
||||
upgr_box:Update(section, prereq, installed)
|
||||
info_box:Update()
|
||||
return
|
||||
|
||||
-- Upgrade kit
|
||||
elseif v2.itm:IsCursorOverWindow() and self.upgr[k1][k2] then
|
||||
self.update_cache["type"] = 1 -- reset cache
|
||||
local tool = self.upgr[k1][k2].tool
|
||||
if tool then
|
||||
upgr_box:Update()
|
||||
info_box:Update(nil,tool)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
upgr_box:Update()
|
||||
info_box:Update()
|
||||
end
|
||||
|
||||
local uiworkshopupgrade_listupgradetree = ui_workshop.UIWorkshopUpgrade.ListUpgradeTree
|
||||
ui_workshop.UIWorkshopUpgrade.ListUpgradeTree = function(self)
|
||||
uiworkshopupgrade_listupgradetree(self)
|
||||
|
||||
local main_tool = self.upgr_toolkit
|
||||
if main_tool and self.upgr_tools[main_tool] and is_not_empty(self.upgr_tools[main_tool]) then
|
||||
SetTip("upgrade_tip_1", "upgrade_warning_2", "upgrade_solution_2", nil, false, self.info_text)
|
||||
else
|
||||
SetTip("upgrade_tip_1", "upgrade_warning_1", "upgrade_solution_1", self.upgr_toolkit, false, self.info_text)
|
||||
end
|
||||
end
|
||||
|
||||
function ui_workshop.UIWorkshopUpgrade:EvaluateUpgrades()
|
||||
|
||||
-- First we process the newely installed upgrade
|
||||
for row,w in pairs(self.upgr) do
|
||||
for col,v in pairs(w) do
|
||||
if self.upgr_xml[row][col].btn:GetCheck()
|
||||
and (not self.inst_upgr[v.section])
|
||||
then
|
||||
self:DischargeKit(self.upgr_toolkit)
|
||||
self:DischargeKit(v.tool)
|
||||
self.inst_upgr[v.section] = true
|
||||
|
||||
utils_obj.play_sound("interface\\inv_slot")
|
||||
|
||||
SetTip("upgrade_tip_3", nil, nil, nil, true, self.info_text)
|
||||
|
||||
self.btn_upgrade:Enable(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Lock/Unlock upgrades according to requirements
|
||||
for row,w in pairs(self.upgr) do
|
||||
for col,v in pairs(w) do
|
||||
self:EvaluateUpgrade(row, col, v)
|
||||
end
|
||||
end
|
||||
|
||||
-- Workshop toolkit update
|
||||
self:SetkitInfo(self.upgr_toolkit, self.itm_num_rq, self.itm_ico_rq, self.itm_ico_temp_rq)
|
||||
-- Edited by Sota
|
||||
--[[
|
||||
local main_tool = self.upgr_toolkit
|
||||
if main_tool and self.upgr_tools[main_tool] and is_not_empty(self.upgr_tools[main_tool]) then
|
||||
SetTip("upgrade_tip_1", "upgrade_warning_2", "upgrade_solution_2", nil, false, self.info_text)
|
||||
else
|
||||
SetTip("upgrade_tip_1", "upgrade_warning_1", "upgrade_solution_1", self.upgr_toolkit, false, self.info_text)
|
||||
end
|
||||
--]]
|
||||
end
|
||||
|
||||
function ui_workshop.UIWorkshopUpgrade:OnKeyboard(dik, keyboard_action)
|
||||
local res = CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
|
||||
if (res == false) then
|
||||
self.CC:OnKeyboard(dik, keyboard_action)
|
||||
|
||||
local bind = dik_to_bind(dik)
|
||||
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
|
||||
if dik == DIK_keys.DIK_ESCAPE then
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
self:Reset()
|
||||
self:Close()
|
||||
Unregister_UI("UIWorkshopUpgrade")
|
||||
end
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
local uiworkshopcraft_reset = ui_workshop.UIWorkshopCraft.Reset
|
||||
ui_workshop.UIWorkshopCraft.Reset = function(self)
|
||||
uiworkshopcraft_reset(self)
|
||||
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
if self.owner.item_info then
|
||||
self.owner.item_info:Update()
|
||||
end
|
||||
if self.owner.upgr_info then
|
||||
self.owner.upgr_info:Update()
|
||||
end
|
||||
end
|
||||
|
||||
function ui_workshop.UIWorkshopCraft:OnKeyboard(dik, keyboard_action)
|
||||
local res = CUIScriptWnd.OnKeyboard(self,dik,keyboard_action)
|
||||
if (res == false) then
|
||||
for name,cc in pairs(self.CC) do
|
||||
cc:OnKeyboard(dik, keyboard_action)
|
||||
end
|
||||
|
||||
local bind = dik_to_bind(dik)
|
||||
if keyboard_action == ui_events.WINDOW_KEY_PRESSED then
|
||||
if dik == DIK_keys.DIK_ESCAPE then
|
||||
-- Fix by Grok from GAMMA - blocking the Workshop UI with a tooltip window
|
||||
self:Reset()
|
||||
self:Close()
|
||||
Unregister_UI("UIWorkshopCraft")
|
||||
end
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
-- Inventory Weights Revised by demonized
|
||||
local XMLP = CScriptXmlInit()
|
||||
XMLP:ParseFile("ui_demonized_inventory_weights.xml")
|
||||
|
||||
ui_cell_item_update = utils_ui.UICellItem.Update
|
||||
utils_ui.UICellItem.Update = function(self, obj)
|
||||
local res = ui_cell_item_update(self, obj)
|
||||
obj = obj or (self.ID and level.object_by_id(self.ID))
|
||||
if (self.showcase == 0) and (not obj) then
|
||||
return false
|
||||
end
|
||||
|
||||
-- Init weight xml
|
||||
if not self.weight then
|
||||
self.weight = XMLP:InitStatic("weight", self.cell)
|
||||
end
|
||||
|
||||
-- Update weight counter
|
||||
self:Add_Weight(obj, self.section)
|
||||
return res
|
||||
end
|
||||
|
||||
ui_cell_item_reset = utils_ui.UICellItem.Reset
|
||||
utils_ui.UICellItem.Reset = function(self)
|
||||
ui_cell_item_reset(self)
|
||||
if self.manual then
|
||||
if self.weight then self.weight:Show(false) end
|
||||
end
|
||||
end
|
||||
|
||||
utils_ui.UICellItem.Get_Weight_Text_Template = function(self, weight)
|
||||
return weight .. game.translate_string("st_kg")
|
||||
end
|
||||
|
||||
utils_ui.UICellItem.Set_Weight_Text = function(self, weight)
|
||||
self.weight:TextControl():SetText(self:Get_Weight_Text_Template(weight))
|
||||
end
|
||||
|
||||
utils_ui.UICellItem.Add_Weight = function(self, obj, sec)
|
||||
|
||||
-- Hide counter
|
||||
if self.weight then
|
||||
self.weight:Show(false)
|
||||
end
|
||||
|
||||
if not obj then
|
||||
return
|
||||
end
|
||||
|
||||
local weight = obj:weight()
|
||||
if self:HasChild() then
|
||||
-- Add weight of stacked items
|
||||
for id,_ in pairs(self.childs) do
|
||||
local child_obj = level.object_by_id(id)
|
||||
if child_obj then
|
||||
weight = weight + child_obj:weight()
|
||||
end
|
||||
end
|
||||
|
||||
-- Move to below item count
|
||||
|
||||
-- Edited by Sota - x offset from xml file
|
||||
--self.weight:SetWndPos(vector2():set(-1, 10))
|
||||
self.weight:SetWndPos(vector2():set(self.weight:GetWndPos().x, 10))
|
||||
else
|
||||
-- If ammo - move it below always
|
||||
if IsItem("ammo",sec) then
|
||||
|
||||
-- Edited by Sota - x offset from xml file
|
||||
--self.weight:SetWndPos(vector2():set(-1, 10))
|
||||
self.weight:SetWndPos(vector2():set(self.weight:GetWndPos().x, 10))
|
||||
else
|
||||
-- Move to top
|
||||
|
||||
-- Edited by Sota - x offset from xml file
|
||||
--self.weight:SetWndPos(vector2():set(-1, 10))
|
||||
self.weight:SetWndPos(vector2():set(self.weight:GetWndPos().x, -1))
|
||||
end
|
||||
end
|
||||
|
||||
self:Set_Weight_Text(round_100(weight))
|
||||
self.weight:Show(true)
|
||||
end
|
||||
+1623
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user