Fsea Posted April 28, 2022 Posted April 28, 2022 (edited) The AI interface not be displayed correctly in the bottom left/right corner of GU_MAIN_VIEWPORT in some view ports layouts. For details and solutions, please see: On 4/17/2022 at 3:31 AM, Fsea said: The original code didn't scale the offset. This will cause the AI interface to not be displayed correctly in the bottom left/right corner of GU_MAIN_VIEWPORT in some view ports layouts. For example: The screen resolution: 2560*2520 Monitor setup is as follows: _ = function(p) return p end name = _('Helios') description = 'Generated from compatible Helios Profiles' A_10C_2_CDU_SCREEN = { x = 1222.5, y = 2082.5, width = 221.25, height = 162.5 } A_10C_2_LEFT_MFCD = { x = 61.25, y = 1583.75, width = 430, height = 430 } A_10C_2_RIGHT_MFCD = { x = 1425, y = 1583.75, width = 430, height = 430 } A_10C_2_RWR_SCREEN = { x = 590, y = 1601.25, width = 185, height = 185 } F_16C_DED = { x = 1212.5, y = 1441.25, width = 316.25, height = 107.5 } F_16C_EHSI = { x = 858.75, y = 2280, width = 206.25, height = 206.25 } F_16C_LEFT_MFCD = { x = 282.5, y = 1823.75, width = 375, height = 375 } F_16C_RIGHT_MFCD = { x = 1278.75, y = 1823.75, width = 375, height = 375 } F_16C_RWR = { x = 461.25, y = 1515, width = 225, height = 225 } FA_18C_CENTER_MFCD = { x = 783.75, y = 2131.25, width = 350, height = 350 } FA_18C_IFEI = { x = 152.5, y = 2193.75, width = 525, height = 205 } FA_18C_LEFT_MFCD = { x = 287.5, y = 1637.5, width = 375, height = 375 } FA_18C_RIGHT_MFCD = { x = 1263.75, y = 1637.5, width = 375, height = 375 } FA_18C_RWR = { x = 1491.25, y = 2160, width = 181.25, height = 181.25 } FA_18C_UFC = { x = 741.25, y = 1470, width = 456.25, height = 258.75 } Viewports = { Center = { x = 0, y = 0, width = 2560, height = 1440, aspect = 1.77777777777778, dx = 0, dy = 0 } } UIMainView = Viewports.Center GU_MAIN_VIEWPORT = Viewports.Center =============================================================== The soluation is: Modify file : DCS World OpenBeta\Mods\aircraft\AH-64D\Cockpit\Scripts\AI\PrestonAI_page_common.lua --viewports stuff local v = find_viewport("GU_MAIN_VIEWPORT", "CENTER") if v ~= nil then if v.width ~= total_w or v.height ~= total_h then ULX = v.x ULY = v.y SZX = v.width SZY = v.height local aspect = SZX/SZY -- Thanks Asto (https://forum.dcs.world/profile/127293-asto/) local control_pos_offset = {(ULX + SZX / 2 - total_w / 2) / total_w * total_aspect * 2, -(ULY + SZY / 2 - total_h / 2) / total_h * 2} weap_control_pos = {0.8 * aspect * (SZY / total_h) + control_pos_offset[1], -0.75 * (SZY / total_h) + control_pos_offset[2]} compass_pos = {-0.82 * aspect * (SZY / total_h) + control_pos_offset[1], -0.7 * (SZY / total_h) + control_pos_offset[2]} -- Kudos to you (https://forum.dcs.world/topic/295236-george-interface-with-3-monitors/?do=findComment&comment=4922420) weap_control_size = weap_control_size * v.height / total_h compass_size = compass_size * v.height / total_h end end --end viewports stuff The key is: weap_control_pos = {0.8 * aspect * (SZY / total_h) + control_pos_offset[1], -0.75 * (SZY / total_h) + control_pos_offset[2]} compass_pos = {-0.82 * aspect * (SZY / total_h) + control_pos_offset[1], -0.7 * (SZY / total_h) + control_pos_offset[2]} Edited April 28, 2022 by Fsea
Wawar Posted May 9, 2022 Posted May 9, 2022 (edited) It works for me. Thanks! Edited May 9, 2022 by Wawar
Recommended Posts