UI modding - support thread
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
Yes I figured you'd probably be limited to some sort of "hack" with the current setup. You can add feature requests in the bug tracker linked at the start of this thread. So far all the one's I've added or seen added have been either implemented almost immediately or acknowledged in a very positive way by Egosoft. I certainly think more customisation options for the menus and the the map would be a good addition. I think there's already a request for drawing shapes and graphics in the UI which would be a start on the road to things like drag selection on the map. Being able to build a "control panel" as you have described would also be really cool.
UI Modding - free look
Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
"Chop your own wood and it will warm you twice."
Re: UI Modding - free look
Nothing released so far opens up any keys or button press sequences for mapping via mods - definitely another request that should be added to Ego's tracker IMO.Moneytide wrote:Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
Re: UI Modding - free look
That would be an MD/XML rather than an UI feature. It has been suggested to add that long time ago. Something like event_keypressed, set_key etc..wysiwyg wrote:Nothing released so far opens up any keys or button press sequences for mapping via mods - definitely another request that should be added to Ego's tracker IMO.Moneytide wrote:Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
Cheers Euclid
"In any special doctrine of nature there can be only as much proper science as there is mathematics therein.”
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
- Immanuel Kant (1724-1804), Metaphysical Foundations of the Science of Nature, 4:470, 1786
Re: UI Modding - free look
i already thought about what would make most sense for this in AI/MD. dont know about lua since i didnt need it yet - but for AI/MD these events would make most sense:wysiwyg wrote:Nothing released so far opens up any keys or button press sequences for mapping via mods - definitely another request that should be added to Ego's tracker IMO.Moneytide wrote:Would this enable us to create a mod for variable controlled cockpit free look? Perhaps hold middle mouse and use mouse to look around?
<event_hotkey_down id="'INPUT_STATE_MOUSECLICK'" />
<event_hotkey_up id="'INPUT_STATE_MOUSECLICK'" hold_time_min="0.5s" hold_time_max="1s" />
event.param returns the Hotkey Name (in case none was specified) and event.param1 returns the actual time the Key was held for the up event. (you can also specify how long the Key has to be held minimum and maximum to trigger the event, default values if not specified are 0.0s and infinity s)
(not sure about the difference between Input Stat and Input Action, but probably the up event can only be available for Inpu States, not for Actions...)
also a way to enable/disable control contexts (see libraries/contexts.xml) would be great so we can use our own, like:
<enable_control_context context="expression" />
<disable_control_context context="expression" />
and maybe even a List of currently active control contexts like the expression "player.controlcontexts"
and a way to define our own Hotkeys of course, but i think with UI Modding everything necesary is already available (define default Key & Hotkey ID in libraries/inputmap.xml , the Situation it is available in libraries/contexts.xml and add it to the Controls Menu via UI Modding for re-assignment - not entirely sure about the last one though..)
sorry when i cannt contribute anyhing for the UI part of this and also make an AI/MD function request, but if just fitted perfectly to the current direction of the discussion ^^''
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
@Tromblon: We had support for rowspanning and nested tables on our wishlist quite a long time, but unfortunately never got to add that.
In theory it's possible to do what you want to achieve. But it's not easy, unfortunately. You would have to modify the widget_xxx scripts to add the support yourself.
I've added two feature requests for you to the tracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-24, http://www.egosoft.com:8282/jira/browse/XRUIMOD-25
@wysiwyg/Moneytide: The request to improve input mapping for mods is already on the bugtracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-20
@euclid: Only partially true. While the feature could also be added to AI/MD, it'd be a separate task to do that for the UI. Of course adding support for one or another could then be used to trigger things on the other side by sending events from the UI to MD or vice versa.
In theory it's possible to do what you want to achieve. But it's not easy, unfortunately. You would have to modify the widget_xxx scripts to add the support yourself.
I've added two feature requests for you to the tracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-24, http://www.egosoft.com:8282/jira/browse/XRUIMOD-25
@wysiwyg/Moneytide: The request to improve input mapping for mods is already on the bugtracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-20
@euclid: Only partially true. While the feature could also be added to AI/MD, it'd be a separate task to do that for the UI. Of course adding support for one or another could then be used to trigger things on the other side by sending events from the UI to MD or vice versa.
Stefan Hett
- BigBANGtheory
- Posts: 3168
- Joined: Sun, 23. Oct 05, 12:13
gosh time flies, so I have another UI use case for this month which if not currently possible I'd like to explore as a feature request pls:
Tactical UI Use Case 2.0 (March 2015)
The goal is to permit the player to select multiple objects displayed in the UI, this might be property items in menus or objects within the HUD, cockpit radar and most importantly the holomap. The purpose of this is to support ability to issue commands* and or instructions* to multiple objects at the same time without having to repeat actions again and again.
Multiple selection should be activated in a manner similar to Microsoft Windows applications as this will be the most intuitive method for most players i.e. use of a modifier key (or button) in combination with the cursor, and for mouse users support for bandbox or marquee selection. The bandbox should be drawn in realtime within the UI thus has a dependency on Tactical UI Use Case 1.0 i.e. the inclusion of LUA graphics libraries.
*required but out of scope for UI modification
Tactical UI Use Case 2.0 (March 2015)
The goal is to permit the player to select multiple objects displayed in the UI, this might be property items in menus or objects within the HUD, cockpit radar and most importantly the holomap. The purpose of this is to support ability to issue commands* and or instructions* to multiple objects at the same time without having to repeat actions again and again.
Multiple selection should be activated in a manner similar to Microsoft Windows applications as this will be the most intuitive method for most players i.e. use of a modifier key (or button) in combination with the cursor, and for mouse users support for bandbox or marquee selection. The bandbox should be drawn in realtime within the UI thus has a dependency on Tactical UI Use Case 1.0 i.e. the inclusion of LUA graphics libraries.
*required but out of scope for UI modification
@BigBANGtheory: If I get you right this is to a point already possible. Check out the map code for the calls to GetPickedMapComponent(). This function returns the currently selected/picked object on the map.
menu.onRenderTargetSelect() is called, when you click into the map.
So what you could currently already do is to get a list of all the objects the player clicks on in a sequence and then provide the appropriate actions for these.
As for the visuals, I guess atm you could add some table-layout to list what was picked already and provide means to unpick the objects via a button in the table.
To improve upon these things further, I guess this then goes down to adding support to draw shapes/lines directly (http://www.egosoft.com:8282/jira/browse/XRUIMOD-11) with which you then could achieve the visuals.
Does that sound correct, or did I miss something?
menu.onRenderTargetSelect() is called, when you click into the map.
So what you could currently already do is to get a list of all the objects the player clicks on in a sequence and then provide the appropriate actions for these.
As for the visuals, I guess atm you could add some table-layout to list what was picked already and provide means to unpick the objects via a button in the table.
To improve upon these things further, I guess this then goes down to adding support to draw shapes/lines directly (http://www.egosoft.com:8282/jira/browse/XRUIMOD-11) with which you then could achieve the visuals.
Does that sound correct, or did I miss something?
Stefan Hett
-
- Posts: 124
- Joined: Sat, 22. Jan 11, 21:13
There is another little mod which I have implemented for 2.51 using the subst_XX.cat method which I would like to port to the new UI modding way. It changes the formatting of the target distance of the primary target next to the crosshair to show a decimal place (e.g. 1.5 km) providing me with a better feeling for my actual speed and more importantly it is easier to find the right distance to start firing based on the range of the selected weapon.
The function that I like to change is "getDistanceText()" from "core/Lua/targetsystem.lua".
So my first question is, is modding UI core files supported right now? If yes, how would a dependency to a core file look like? I tried a few variants but so far I have always ended up with a missing dependency.
The second thing is that currently all the functions in targetsystem.lua seem to be local. Is there a way to overwrite/hook into them?
As always thank you all for your input and ideas.
The function that I like to change is "getDistanceText()" from "core/Lua/targetsystem.lua".
So my first question is, is modding UI core files supported right now? If yes, how would a dependency to a core file look like? I tried a few variants but so far I have always ended up with a missing dependency.
The second thing is that currently all the functions in targetsystem.lua seem to be local. Is there a way to overwrite/hook into them?
As always thank you all for your input and ideas.
- BigBANGtheory
- Posts: 3168
- Joined: Sun, 23. Oct 05, 12:13
Ok then yes if the UI can list player objects clicked in a sequence and then be organised by object type that is a start. What then remains is indirect selection i.e. the player drawing a semi-transparent box over objects of interest and for those objects to be listed for further action.stefanEgo wrote:@BigBANGtheory: If I get you right this is to a point already possible. Check out the map code for the calls to GetPickedMapComponent(). This function returns the currently selected/picked object on the map.
menu.onRenderTargetSelect() is called, when you click into the map.
So what you could currently already do is to get a list of all the objects the player clicks on in a sequence and then provide the appropriate actions for these.
As for the visuals, I guess atm you could add some table-layout to list what was picked already and provide means to unpick the objects via a button in the table.
To improve upon these things further, I guess this then goes down to adding support to draw shapes/lines directly (http://www.egosoft.com:8282/jira/browse/XRUIMOD-11) with which you then could achieve the visuals.
Does that sound correct, or did I miss something?
- YorrickVander
- Posts: 2705
- Joined: Tue, 29. Oct 13, 21:59
little tip for passing data to/from lua for menus where params cannot be passed to lua as the user clicks :
gives you the equivalent of player.entity so blackboard data can be accessed from the menu lua. player.entity.$blackboardvar then becomes
Code: Select all
local playership = GetPlayerPrimaryShipID()
local player = GetComponentData(playership, "controlentity")
Code: Select all
local var = GetNPCBlackboard(player, "$blackboardvar")
X Rebirth - A Sirius Cybernetics Corporation Product
Split irritate visiting pilot with strange vocal patterns.
Split irritate visiting pilot with strange vocal patterns.
@blackmilan: Unfortunately the only way to modify Lua scripts located under ui/core/Lua is only possible via substitution catalogs (with the exception of the widget_xxx-files). This still works in XR >3.50. We really wanted to add proper modding support for these files too, but due to the lack of resources, we had to postpone that. So for the time being, you'd be fine with using the subst-cat-files. However, I've added a feature request for you in the bugtracker: http://www.egosoft.com:8282/jira/browse/XRUIMOD-26
Just so you are aware: Please note that we are more likely to introduce breaking changes in new versions for mods using the subst-catalog-method than we are for the standard format.
As part of XRUIMOD-26 we'd also consider simplifying modifying the scripts without having to replace them alltogether.
Just so you are aware: Please note that we are more likely to introduce breaking changes in new versions for mods using the subst-catalog-method than we are for the standard format.
As part of XRUIMOD-26 we'd also consider simplifying modifying the scripts without having to replace them alltogether.
Stefan Hett
Just to give you some heads-up on some modding related changes: 3.52 RC2 is currently in beta testing and contains two changes/fixes:
(full list is available here as usual: https://wiki.egosoft.com:1337/X%20Rebir ... Changelog/)
- Bugfix: the mouseOver/mouseOut events on tables was not correctly fired, if the table contained inactive buttons ( XRUIMOD-27 )
- New Feature: FFI function HasCustomConversation() was added which checks whether an entity is running a custom conversation atm. ( XRUIMOD-28 )
(full list is available here as usual: https://wiki.egosoft.com:1337/X%20Rebir ... Changelog/)
- Bugfix: the mouseOver/mouseOut events on tables was not correctly fired, if the table contained inactive buttons ( XRUIMOD-27 )
- New Feature: FFI function HasCustomConversation() was added which checks whether an entity is running a custom conversation atm. ( XRUIMOD-28 )
Stefan Hett
- Juggernaut93
- Posts: 2897
- Joined: Sun, 17. Jul 11, 21:03
Is it possible to create a multi-line EditBox?
XR mods: Log Everything
TC/AP scripts: Automatic Rank Variation Checker - Aran Finder - Missile Transformer - Station Hacking Software
[ external image ]
TC/AP scripts: Automatic Rank Variation Checker - Aran Finder - Missile Transformer - Station Hacking Software
[ external image ]
you can write t-file links in this Text Box ( {PageID,tID} ) and with a custom t-file just containing \n you should be able to add a line break just as workaroundJuggernaut93 wrote:Is it possible to create a multi-line EditBox?
with this method you also should be able to add color Codes ( \033X where X is a Letter defining the Color) - just dont forget to terminate this with \033X (default Color) as it may make following Text colorful otherwise
if not stated otherwise everything i post is licensed under WTFPL
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help
Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter
I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help