[UI MOD] comfort play UI mod 2.5 (beta 3.0 has 3+1 trade list slots) for X4-3.20

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

[UI MOD] comfort play UI mod 2.5 (beta 3.0 has 3+1 trade list slots) for X4-3.20

Post by xuancong » Wed, 17. Jun 20, 16:45

As a beginner attempt to fix some of the UI inconveniences while playing X4-foundations, I created this mod: 1) for players to test/debug; 2) for developers to incorporate into future game patches (if they agree on my modifications)

x4_focused_pan : x4-foundations UI patch for comfort play Version 2.5 (for game version 3.20)
https://www.nexusmods.com/x4foundations/mods/541/
ImageImage

The beta 3.0 version is in Github master branch, with 3+1 slots for trade ware list
https://github.com/xuancong84/public/
Image
You can modify the 3 pre-defined trade ware lists by editing get_trade_wares_list(n) function in x4_focused_pan.lua directly.

Modifications (newly added enhancement will be highlighted in bold green):
  • it allows players to use middle mouse button to perform camera-space map panning (in the original game, map paning is always along the x-z sector plane, i.e., in map-space)
  • fixed: in the original game, after zoomed in on an object well below sector plane, once you start panning map, you will lose zoomed focus; after zoomed in on an object well above the sector plane, once you start panning map, the focus will shift onto the plane right behind the object, so you get very high mouse sensitivity
  • fixed: in the original game, after zoomed in on an object well below sector plane, if you attempt to left-click on any nearby objects, your camera will zoom out, and the clicked object will not be selected
  • enhance: in the original game, reset-camera function (the reset-view button and hotkey) will always focus on the player, however, very often the player is manipulating units far away from his current location. Now, reset-camera will first check mouse cursor, if it points to an object, it will reset direction and focus on that object; else if an object is selected, it will reset direction and focus on the selected object; else it will reset direction and focus on the player's current location
  • enhance: some auto-trade/passive capabilities will need 1 or 2-star pilots, you can find them on your station. However, in the original game, you need to physically run to that person before he/she gets de-spawned. Now, you can fire/hire/set-guidance-to any workforce NPC on your own station (), by right-clicking the NPC in the station-crew-info menu workforce list, i.e., 'hire' means work-somewhere-else.
  • fixed: in the original game, if you select a ship (with movement orders) and go to information menu => behavior tab, you cannot insert new movement order nor modify a existing movement order in the order queue
  • enhance: 3.20 comes with a bug, in the info menu, when you double-click on the title of the table, sometimes the camera will no longer focus on the object; now when an object is selected, in the info menu, if you right-click the title row, the camera will center on the object without resetting camera direction
  • enhance: in the original game, the toggle-trade button is too small, Now you can use middle-click on map to toggle trade display; moreover, middle-click on any station will set the trade filter to that station’s trade offers (both buy and sell offers). To set to buy offers only, use CTRL middle-click the station; to set to sell offers only, use SHIFT middle-click the station. Middle-click on any of your own ship will set the trade filter to that ship's cargo (very often, it takes your auto-trade ship a long time to find a seller)
  • enhance: very often you want to have your predefined list of trade wares (typically those wares that make most profit) that can be easily switched to, but setting the trade filter is really a headache in the original game. Now, you can use the save/load/clear button next to the reset-view button, or use CTRL middle-click to save current trade filter list, and use SHIFT middle-click to load previously saved trade filter list, and use CTRL+SHIFT middle-click to clear trade filter list.
  • some players give feedback that the slider in trade popup menu is too small to drag every time. Now if you right-click on trade items to popup the trade menu, you do not need to drag the slider at all, the slider position will be initialized at maximum buy/sell already :lol:
Warning: UI mods change Lua code, so usually they can hardly apply to a different game version although I have put in some effort to make my modification as compatible as possible. But hopefully, some of the enhancements can be soon integrated into subsequent game patches by the developer team.
Note: This mod only affects game UI interface, improving game play experience. Thus, it should be compatible with most other mods that re-adjust game balance, such as VRO, FE, FOCW, etc.
Last edited by xuancong on Fri, 31. Jul 20, 05:25, edited 9 times in total.

Godis
Posts: 28
Joined: Thu, 20. Feb 20, 20:33

Re: [MOD] comfort play UI mod for X4 version 3.20

Post by Godis » Sat, 20. Jun 20, 15:07

The mod is actually useful, but unfortunately it breaks the extensions settings menu. With this mod enabled the said menu disappeares from the main menu. Cannot say if this is caused by the mod itself or some combination of this mod with others.

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

Re: [MOD] comfort play UI mod for X4 version 3.20

Post by xuancong » Sat, 20. Jun 20, 15:17

That is weird :?: . I have tested, on my machine, I can still see the extensions menu both during game and before game (immediately after launching the game before loading or starting a new game).
If that is indeed the case, then it must be due to conflict with some other UI mod you have.

Godis
Posts: 28
Joined: Thu, 20. Feb 20, 20:33

Re: [MOD] comfort play UI mod for X4 version 3.20

Post by Godis » Sun, 21. Jun 20, 23:53

I cannot see the button, not before loading a save, not after that. Did you test it with Rightclick API? I'm using that one too.

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

Re: [MOD] comfort play UI mod for X4 version 3.20

Post by xuancong » Tue, 23. Jun 20, 14:51

Godis wrote:
Sun, 21. Jun 20, 23:53
I cannot see the button, not before loading a save, not after that. Did you test it with Rightclick API? I'm using that one too.
I am not sure what modifications you have made to your game or whether your game version is >=3.20. But when I test my mod with RightClickAPI and G_Work_Around, everything works fine. And the extensions button is present both before and after loading the game.
Image

barra
Posts: 25
Joined: Tue, 31. Jan 17, 07:58
x4

Re: [MOD] comfort play UI mod for X4 version 3.20

Post by barra » Sun, 28. Jun 20, 11:28

xuancong wrote:
Wed, 17. Jun 20, 16:45



Modifications:
  • it allows players to use middle mouse button to perform camera-space map panning (in the original game, map paning is always along the x-z sector plane, i.e., in map-space)
  • fixed: in the original game, after zoomed in on an object well below sector plane, once you start panning map, you will lose zoomed focus; after zoomed in on an object well above the sector plane, once you start panning map, the focus will shift onto the plane right behind the object, so you get very high mouse sensitivity
  • fixed: in the original game, after zoomed in on an object well below sector plane, if you attempt to left-click on any nearby objects, your camera will zoom out, and the clicked object will not be selected
  • enhance: in the original game, reset-camera function (the reset-view button and hotkey) will always focus on the player, however, very often the player is manipulating units far away from his current location. Now, reset-camera will first check mouse cursor, if it points to an object, it will reset direction and focus on that object; elseif an object is selected, it will reset direction and focus on the selected object; else it will reset direction and focus on the player
  • enhance: now, you can fire/hire/set-guidance-to any workforce NPC on your own station, by right-clicking the NPC in the station-crew-info menu workforce list, i.e., 'hire' means work-somewhere-else. In the original game, you need to physically run to that person before he/she gets de-spawned
  • fixed: in the original game, if you select a ship (with movement orders) and go to information menu => behavior tab, you cannot insert new movement order nor modify a existing movement order in the order queue
  • enhance: 3.20 comes with a bug, in the info menu, when you double-click on the title of the table, sometimes the camera will no longer focus on the object; now when an object is selected, in the info menu, if you right-click the title row, the camera will center on the object without resetting camera direction
Wow I really appreciate your work, especially the reset camera to player position was very annoying.
May I suggest you another qol enhancement?!

I thought it would be neat to have a button (in build overview and aswell in the filter tab itself), setting the wares filter, to the actual requested wares of a given build storage.
Maybe even an option/expansion, to create filter templates, to choose from. For example: let the player create templates of often used/searched wares, lets say silicon wafers and microships and advanced electronics, to choose it with one click, similiar to the custom loadout options for shipstation-building.

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

Re: [MOD] comfort play UI mod for X4 version 3.20

Post by xuancong » Sun, 5. Jul 20, 09:06

barra wrote:
Sun, 28. Jun 20, 11:28
May I suggest you another qol enhancement?!

I thought it would be neat to have a button (in build overview and aswell in the filter tab itself), setting the wares filter, to the actual requested wares of a given build storage.
Maybe even an option/expansion, to create filter templates, to choose from. For example: let the player create templates of often used/searched wares, lets say silicon wafers and microships and advanced electronics, to choose it with one click, similiar to the custom loadout options for shipstation-building.
Thank you very much @barra for your nice suggestion!
Yup, I fully agree with you that the toggle-trade button is too small to click, now you can use middle-click on map to toggle trade. Take a look my revised post in bold green in the OP and check it out whether my mod causes any bugs or not.

barra
Posts: 25
Joined: Tue, 31. Jan 17, 07:58
x4

Re: [MOD] comfort play UI mod 2.0 (traders will be happy) for X4-3.20

Post by barra » Sun, 5. Jul 20, 17:28

Again WOW, this is awesome, you even improved the suggestion to perfect it.
Maybe you should be hired by egosoft, they clearly need fresh "blood"

" I fully agree with you that the toggle-trade button is too small to click"
I simply fixed it for myself with autoIt but yours is the solution I was hoping for!

Thank you for following up on the suggestion
I would even donate you a coffee if you have a patron or paypal donate link ;)

barra
Posts: 25
Joined: Tue, 31. Jan 17, 07:58
x4

Re: [MOD] comfort play UI mod 2.0 (traders will be happy) for X4-3.20

Post by barra » Sun, 5. Jul 20, 18:53

speaking of autoIt and using it at the moment to toggle off the left menu pane in the map view with a "hotkey" , is there any ingame hotkey to toggle off the left menu pane, not that I know of atleast.

So would you please mind to "create" one, alt- mid-mouse is not used yet :)
thank you in advance!

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [MOD] comfort play UI mod 2.0 (traders will be happy) for X4-3.20

Post by Max Bain » Sun, 5. Jul 20, 21:29

Cool. The save load function for trade filters was something I was searching for. I guess you can only save/load one preset or can you save multiple presets like "station building materials" "shipyard components" "ores" and so on? That would be five stars useful! Anyway, great work.

Edit:

Btw I made a suggestion to Egosoft to use the double click to set the amount always on maximum. I doubt that they will do this, so maybe this would fit perfect to your mod.

You could double click on a ware to set the amount at maximum in the trade window. You could also double click on a turret/module in the loadout menu to set the turret/module amount to maximum. This would help a lot. Actually people are forced to use a tiny slider even if they always want to trade/set the maximum amount of wares/modules/turrets.
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

Re: [MOD] comfort play UI mod 2.0 (traders will be happy) for X4-3.20

Post by xuancong » Mon, 6. Jul 20, 03:21

Thank you very much @barra for your appreciation! :D
barra wrote:
Sun, 5. Jul 20, 17:28
I simply fixed it for myself with autoIt but yours is the solution I was hoping for!
You are also a endeavourer who fix problems on your own :mrgreen:
Btw, what is autoIt? I am actually thinking about the multiple sets of trade ware lists @Max_Bain mentioned about. However, there is not enough space at the search bar area to accommodate too many buttons. Need to plan the buttons carefully :lol:
is there any ingame hotkey to toggle off the left menu pane
Actually, you can turn off the left menu pane by pressing ESC, but to turn it on, you need to click the left big button. I think the left side buttons are big enough for players to click. It is only the toggle_trade and reset_view button that is way too small for players to mouse aim.

barra
Posts: 25
Joined: Tue, 31. Jan 17, 07:58
x4

Re: [MOD] comfort play UI mod 2.0 (traders will be happy) for X4-3.20

Post by barra » Mon, 6. Jul 20, 12:02

AutoIt is a free very basic scripting language, mostly used to create keyboard and mouse macros. For example you could bind a hotkey to move the mouse to X/Y coordinates, performa a click and move mouse back to its location when the button was pressed.

Oh, the ESC-key, thank you, using autoIt for it for so long let me forget about it BUT its not exactly the size of the button Im annoyed of but the fact that you had to move your mouse for it, its "unnecessary", an example: you are at the map screen, now because of your great QOL features one can click mid-mouse to get the wares filter, the price info is then coupled into clusters/squares, with the left menu pane open which covers almost one 3rd of the screen also covering some stations beneath it, sure you can scroll or just press ESC to close it to see a bigger overview of the map and therefor the stations the price info is linking to but the extra mouse move to the left to turn the left menu pane on again after finishing the search/trading things is something that disturbes my "workflow". Another solution would be, to not include stations into the shown wares/cluster, that are covererd beneath the left and right menu pane when it is open. This solution would be even the "cleaner" one. Its the fiddeling of moving the map view (or turning off and on the left and right pane) to a point where you could get a clear view of the stations, of the current cluster/square the wares filter is refering to, thats so tedious. Because I think its way harder to code I just proposed a hotkey to turn on/off the left and idially the right menu pane at once without the need to refocus your eyes.

Im even to lazy to move the mouse LOL! In a more serious note, its not really ergonomically with a good mouse not so much for your hands/wrists but for tiring your neck and eyes. Buttons at the edge of a screen shouldnt have to be used on a regular basis in this case the "pain" is doubled because you had to move/focus to the far left and the far right to turn it off to refocus to the mid of the screen and after trading/research of availabe wares is done, rinse and repaeat. The focus should stay at the mid of the screen, thats why most of the games have the buttons at the bottom of the screen I guess.

But its your mod and I really appreciate your work :) , so if not this suggestion for using ALT-Mid-Mouse , then whats with clearing the wares filter back to default (no wares selected)!?

@max_baine: I like your proposal, beeing able to double click a ware in the trade window, instead of dragging the slider to max. would be also very neat ;)

barra
Posts: 25
Joined: Tue, 31. Jan 17, 07:58
x4

Re: [MOD] comfort play UI mod 2.0 (traders will be happy) for X4-3.20

Post by barra » Wed, 8. Jul 20, 13:22

xuancong wrote:
Mon, 6. Jul 20, 03:21
I am actually thinking about the multiple sets of trade ware lists @Max_Bain mentioned about. However, there is not enough space at the search bar area to accommodate too many buttons. Need to plan the buttons carefully :lol:
hmmm, maybe you would not need more space, IF the load and save buttons would behave as drop-down menus, like the loadout function for shipstations, saving might be done with mid-mouse + 1, mid-mouse + 2 etc. or by /button:save/dropdown/a list of save slots
In my opinion its not really necessary to name the different saves, just a option of a few saves, called 1-X

PS.: I hope Im not annoying you :D + If I had to decide between a list of saves OR the doubleclick features for the transfer of wares in the trading window, I would choose the double click transfer one.

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

Re: [MOD] comfort play UI mod 2.0 (traders will be happy) for X4-3.20

Post by xuancong » Thu, 9. Jul 20, 16:02

barra wrote:
Mon, 6. Jul 20, 12:02
But its your mod and I really appreciate your work :) , so if not this suggestion for using ALT-Mid-Mouse , then whats with clearing the wares filter back to default (no wares selected)!?
I have tested, the Lua API cannot access ALT key status at all, it is either CTRL or SHIFT or BOTH (CTRL and SHIFT). So instead, I use CTRL+SHIFT to clear the ware filter list. I have also added the CLEAR button.
barra wrote:
Mon, 6. Jul 20, 12:02
@max_baine: I like your proposal, beeing able to double click a ware in the trade window, instead of dragging the slider to max. would be also very neat ;)
If the slider is too tiny for you to aim, I believe any button will also be too tiny for you to double-click. So I get rid of that totally, now the trade popup will have the slider initialized at maximum buy/sell position, you can proceed to click on the confirm button directly! :lol:

Buzz2005
Posts: 2206
Joined: Sat, 26. Feb 05, 01:47
x4

Re: [UI MOD] comfort play UI mod 2.5 (traders will be even happier) for X4-3.20

Post by Buzz2005 » Mon, 20. Jul 20, 09:22

did you try it on new 3.3 beta? should I wait for stable?
Fixed ships getting spawned away from ship configuration menu at resupply ships from automatically getting deployables.

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

Re: [UI MOD] comfort play UI mod 2.5 (traders will be even happier) for X4-3.20

Post by xuancong » Mon, 20. Jul 20, 15:26

Buzz2005 wrote:
Mon, 20. Jul 20, 09:22
did you try it on new 3.3 beta? should I wait for stable?
I am not sure how Egosoft works? I am afraid even if it works on 3.3 beta, it might not work on 3.3 stable release. :roll:

Buzz2005
Posts: 2206
Joined: Sat, 26. Feb 05, 01:47
x4

Re: [UI MOD] comfort play UI mod 2.5 (traders will be even happier) for X4-3.20

Post by Buzz2005 » Mon, 20. Jul 20, 16:53

did you try it?
Fixed ships getting spawned away from ship configuration menu at resupply ships from automatically getting deployables.

Max Bain
Posts: 1463
Joined: Wed, 27. Jun 18, 19:05
x3ap

Re: [UI MOD] comfort play UI mod 2.5 (traders will be even happier) for X4-3.20

Post by Max Bain » Fri, 24. Jul 20, 00:22

some players give feedback that the slider in trade popup menu is too small to drag every time. Now if you right-click on trade items to popup the trade menu, you do not need to drag the slider at all, the slider position will be initialized at maximum buy/sell already
I am too dumb to do this. I am clicking on my trader, right click on the station I want to buy stuff from, click on trade with... and then I tried to make a right click on everything I found but nothing works. Am I at the wrong menu? How does it work? Thanks!

LOL just found out how it works!
You simply need to right click on the trade good on the map directly. Nice :)
XR Ship Pack (adds several ships from XR) Link
Weapon Pack (adds several new weapons) Link
Economy Overhaul (expands the X4 economy with many new buildings) Link
X4 Editor (view stats of objects and make your own mod within a few clicks) Link

Insigar
Posts: 44
Joined: Mon, 8. Oct 07, 09:12
x4

Re: [MOD] comfort play UI mod for X4 version 3.20

Post by Insigar » Sat, 25. Jul 20, 14:23

Godis wrote:
Sat, 20. Jun 20, 15:07
The mod is actually useful, but unfortunately it breaks the extensions settings menu. With this mod enabled the said menu disappeares from the main menu. Cannot say if this is caused by the mod itself or some combination of this mod with others.
Just remove the .cat file from the mod folder and it works. (Just in case: Atleast it looks like it works and I won't guarantee for anything)

User avatar
xuancong
Posts: 92
Joined: Sun, 24. May 15, 14:08

Re: [UI MOD] comfort play UI mod 2.5 (traders will be even happier) for X4-3.20

Post by xuancong » Sun, 26. Jul 20, 05:31

Max Bain wrote:
Fri, 24. Jul 20, 00:22
I am too dumb to do this. I am clicking on my trader, right click on the station I want to buy stuff from, click on trade with... and then I tried to make a right click on everything I found but nothing works. Am I at the wrong menu? How does it work? Thanks!
It seems that you have not gotten familiarized with the original game UI yet. In the original game UI, when trade is turned on, the transparent trade item list overlay (showing the trade offers from each station, e.g., in the right image of OP, the "ium 56693 80Cr" in "sold wares") is actually clickable. Left-click on any trade item text will toggle that item in the trade filter, right-click will open the trade execution menu with amount slider.

Post Reply

Return to “X4: Foundations - Scripts and Modding”