Divergent/mods/UI Rework G.A.M.M.A. Style/gamedata/scripts/modxml_inv_hint_wnd.script

37 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

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