Jump to content

Asto

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by Asto

  1. That's weird, since it should be similar to Deezles layout, ignoring monitor 1. What did you set in your DCS preferences as resolution and aspect ratio? Can you send me screenshots from DCS? Are those ui elements (pilot and cpg) anywhere visible on those screenshots, maybe in a black area? Are they visible anywhere, if you use the following positioning? Change the two lines in my last posted code snippet. I'm wondering which offset is incorrect. compass_pos = { -math.min(total_aspect, aspect) + offsetX + padding, 0} weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, 0 }
  2. Thank you for giving it another chance. Glad to hear that :)
  3. I've spent a few more hours into this problem... It's really hard to understand what's going on there. The following code should fix it for both of our setups. The file you need to edit is the following one: *InstallPath*\DCSWorld\Mods\aircraft\AH-64D\Cockpit\Scripts\AI\PrestonAI_page_common.lua The changes are multiplayer compatible. You have to replace the entire part between "--viewports stuff" and "--end viewports stuff": --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 local offsetX = (ULX + SZX / 2 - total_w / 2) / total_w * total_aspect * 2 local offsetY = -(ULY + SZY / 2 - total_h / 2) / total_h * 2 local padding = math.min(total_aspect, aspect) * 0.2 compass_pos = { -math.min(total_aspect, aspect) + offsetX + padding, -1 + offsetY * 2 + padding} weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, -1 + offsetY * 2 + padding } compass_size = compass_size * v.height / total_h weap_control_size = weap_control_size * v.height / total_h end end --end viewports stuff But I didn't test it with monitor setups where the center viewport is in the middle or other special setups. I bet this is even far from perfect, but could work for the most setups for now. @MatveyTsivinyuk you (ED) have some serious issues there regarding the positioning of UI elements, as it seems. The behaviour is totally counterintuitive. You should always place those UI elements based on the center of the main / center-view and not based on the total center of the selected resolution when you support multi-monitor setups. This makes it way too complicated and explains why it is broken so often and why the kneeboard spawns on the MPDs etc... That makes no sense, at least to me. The other weird thing is the grid you guys & girls have created there: The center is [0, 0] The y-axis always reaches from [0, 1] (top) to [0, -1] (bottom) And now the x-axis behaves really weird: Its from [-total_aspect_ratio, 0] to [total_aspect_ratio, 0] This creates multiple problems when positioning UI elements: When I'm using a total resolution of 4240x1440 (MPDs horizontal), the total_aspect_ratio is about 2.94 When using a total resolution of 3440x2040 (MPDs vertical), the total aspect_ratio is about 1.69 The consequence: Every used relative value behaves totally different for each total resolution. You've used 0.8 and 0.82 as an example, but that is always another position on the screen. And when applying proper offsets. That's why I had to add math.min(), because normally the aspect ratio of the center view would in both cases be the same. But using the total_aspect_ratios makes this weird. Another hint from one software dev to another: I would recommend structuring the code in smaller pieces / objects and functions as far as LUA can handle it. This makes it easier to maintain and understand. And you could use automatic tools to clean your files from trailing whitespaces, since they are "useless". Even most IDEs should support that, maybe even with an .editorconfig file for the entire team If this works, you owe me a beer @Deezle If this still doesn't work for you, could you send me screenshots where those elements are placed, if visible?
  4. That's what I was afraid of, that's why I've asked for the QA test. It would be nice if there would be a standard test for vertical and horizontal layouts before each release, nothing fancy. Just two monitors. That would also show that the Apache export doesn't work correct, with always exposing the CPG MPDs to the LEFT_/RIGHT_MPD, even as a pilot, where we need some hacks right now. Thanks for testing this before the release of the update Offtopic: Assuming 3440x1440 and 1920x1080 monitors in your setup, you should thinking about placing them horizontal to save your graphics card (in theory) a big amount of work: Horizontal setup: (3440 + 1920) * 1440 = 7,7184,00 Pixels to render Your Vertical setup: 3440 * (1440 + 1080) = 8,668,800 Pixels to render
  5. Wow thanks for the open communication! If the team has the possibility to test a few more setups with that code that would be great. I'm quite limited here
  6. IMPORTANT: PLEASE SEE A BETTER SOLUTION IN MY FOLLOWING POST (BELOW, March 26th) ---------- Why is the bug report locked? Workarounds would fit there far better than in new threads? I've looked at the code and guess I've somewhat fixed their calculation. So you shouldn't need to fiddle with those numbers as stated in the reddit post above. The file you need to edit is the following one: *InstallPath*\DCSWorld\Mods\aircraft\AH-64D\Cockpit\Scripts\AI\PrestonAI_page_common.lua The changes are multiplayer compatible. You need to comment out the old calculation and add the new one below, as seen as in the screenshot. Their calculation just calculates an offset to the center, so that's why the tool is placed there. The other part of the calculation is missing in their version. And the "afaik" comment tells me they didn't exactly know what they are doing there - but as a Software Dev I can relate to that. Giggled anyways After commenting out the old two lines via `--` add the code selected in the screenshot below the old two lines: 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 + control_pos_offset[1], -0.75 + control_pos_offset[2]} compass_pos = {-0.82 * aspect + control_pos_offset[1], -0.7 + control_pos_offset[2] * 2} Afterwards it should exactly look like in the screenshot. Start DCS and enjoy the fixed positions. Disclaimer: I couldn't test all varieties. You may need to tweak this a little bit. But it would be nice if you share your corrections with us
  7. Noticed that too, I hope they are just a little bit late. I want to buy a map and a new module in the sale
×
×
  • Create New...