function axr_companions.UICompanionList:InitControls() -- Edited by Sota -- local xml = utils_xml.get_hud_xml() local xml = CScriptXmlInit() xml:ParseFile("ui_hud_companion_list.xml") self.dialog = xml:InitStatic("companion_list", self) --utils_xml.correct_ratio(self.dialog, true) -- Added by Sota local scale = 0.75 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 -- Edited by Sota -- utils_xml.correct_ratio(ele) -- Added by Sota 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()) -- Edited by Sota -- self.companion_info[i].base:SetWndPos( vector2():set( 0 , (8-i)*(h+10) ) ) self.companion_info[i].base:SetWndPos( vector2():set( 0 , self.dialog:GetHeight() - i * (h+5) ) ) local pos = self.companion_info[i].team_role:GetWndPos() -- Edited by Sota -- self.companion_info[i].team_role_shadow:SetWndPos( vector2():set( pos.x + 1 , pos.y + 2 ) ) 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