Interface Reordering OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

Alnivel
Dangerous
Dangerous
Posts: 100
Joined: Fri Jun 10, 2022 7:05 pm

Interface Reordering OXP

Post by Alnivel »

This OXP allows change the order of interfaces on F4 screen via "Reorder Interfaces" on the same screen.
Reordering can be set for individual interfaces and entire categories. Only categories and interfaces that are currently available can be added to the ordering list. The position of the other interfaces is given by the position of the "<Other interfaces>" element in that list. Within this group and categories, interfaces are ordered as usual.

Download link: https://www.dropbox.com/s/82fu7zl2vbwea ... 1.oxz?dl=1

And the question in the end: Would it be interesting to add hiding or grouping interfaces here?
User avatar
Slartibartfast
Deadly
Deadly
Posts: 175
Joined: Mon Jan 21, 2008 3:54 pm

Re: Interface Reordering OXP

Post by Slartibartfast »

Hello

just downloaded and tested
... cool!!

but it conflicts with Galactic Almanac && Communication log
if you chose a menu-entry below these - it jumps back to F4 screen.

matthias

btw. grouping would be fine / hiding ...no ... put in a "hide"-group and move to the end
Oolite 1.91 / Imp. Trader ( slighly modified :wink: ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
Alnivel
Dangerous
Dangerous
Posts: 100
Joined: Fri Jun 10, 2022 7:05 pm

Re: Interface Reordering OXP

Post by Alnivel »

Slartibartfast wrote: Thu Jun 23, 2022 5:58 pm
but it conflicts with Galactic Almanac && Communication log
if you chose a menu-entry below these - it jumps back to F4 screen.
Sorry, but I can't reproduce it. I do not see any places where there could be a conflict, rather it is just one of my bugs. Could you please share your logs? Also I would like to clarify: in which menu exactly does this happen?
User avatar
Slartibartfast
Deadly
Deadly
Posts: 175
Joined: Mon Jan 21, 2008 3:54 pm

Re: Interface Reordering OXP

Post by Slartibartfast »

hi

=> Galactic almanac
====>> "Toggle the display ..." ( first entry)

=> Communicstions log
=====> "Next page"

logs -- maybe later
Oolite 1.91 / Imp. Trader ( slighly modified :wink: ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
User avatar
Slartibartfast
Deadly
Deadly
Posts: 175
Joined: Mon Jan 21, 2008 3:54 pm

Re: Interface Reordering OXP

Post by Slartibartfast »

After saving / reloading

the problem was gone

!!! i made a "confirmation" with an old saved game ==> the problem appears again


from the log

Code: Select all

21:45:49.077 [Alnivel_InterfaceLib_Message]: Remain lines after content 2 from 15
21:45:50.899 [InterfaceReordering_Message]: New prefixes set: {"Exhibitions":"​​ ​","oolite-contracts-parcels":"​​ ​​","Gallery":"​​ ​​​","GalleryAll":"​​ ​​​​","FuelTweaks_Quirium":"​​ ​​​​​","oolite-contracts-passengers":"​​ ​​​​​​","oolite-registership":"​​ ​​​​​​​","Lib_Config":"​​ ​​​​​​​​","HomeSystem":"​​ ​​​​​​​​​","oolite-primable-equipment-manager":"​​ ​​​​​​​​​​","DamageReportMFD":"​​ ​​​​​​​​​​​","GalCopBB_Reputation":"​​ ​​​​​​​​​​​​","EmailSystem":"​​ ​​​​​​​​​​​​​","FlightLog":"​​ ​​​​​​​​​​​​​​","GalacticRegistry":"​​ ​​​​​​​​​​​​​​​","EquipmentStorage":"​​ ​​​​​​​​​​​​​​​​","RoutePlanner_Interface":"​​ ​​​​​​​​​​​​​​​​​","oolite-ship-library":"​​ ​​​​​​​​​​​​​​​​​​","Ships Library":"​​ ​​​​​​​​​​​​​​​​​​​","inamed_stations_distances":"​​ ​​​​​​​​​​​​​​​​​​​​","CommsLogMFD":"​​ ​​​​​​​​​​​​​​​​​​​​​","bar_chatter":"​​ ​​​​​​​​​​​​​​​​​​​​​​","BulletinBoardSystem":"​​ ​​​​​​​​​​​​​​​​​​​​​​​","InterfaceReordering_ManageOrder":"​​ ​​​​​​​​​​​​​​​​​​​​​​​​","Lib_PAD":"​​ ​​​​​​​​​​​​​​​​​​​​​​​​​","inquirer_market":"​​ ​​​​​​​​​​​​​​​​​​​​​​​​​​","inquirer_distances":"​​ ​​​​​​​​​​​​​​​​​​​​​​​​​​​"}
21:46:09.481 [script.javaScript.exception.notFunction]: ***** JavaScript exception (InterfaceReordering 0.1): TypeError: this.showAlmanac2 is not a function
21:46:37.045 [script.javaScript.exception.notFunction]: ***** JavaScript exception (InterfaceReordering 0.1): TypeError: this.$showPage is not a function
21:46:37.282 [NPC_Equipment_Damage]: damaging EQ_SHIELD_ENHANCER on Krait
21:46:49.942 [script.javaScript.exception.notFunction]: ***** JavaScript exception (InterfaceReordering 0.1): TypeError: this.showAlmanac2 is not a function
Oolite 1.91 / Imp. Trader ( slighly modified :wink: ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
User avatar
Cholmondely
Archivist
Archivist
Posts: 4987
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Interface Reordering OXP

Post by Cholmondely »

Alnivel - thank you for this one!

I've been grumbling about this for yonks, and you have actually come up with a solution for it!

What do you want to do about the wiki page? Would you like me to put something together for you to marmalise, or would you rather do it all on your tod?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Alnivel
Dangerous
Dangerous
Posts: 100
Joined: Fri Jun 10, 2022 7:05 pm

Re: Interface Reordering OXP

Post by Alnivel »

Slartibartfast wrote: Thu Jun 23, 2022 7:55 pm
After saving / reloading

the problem was gone

!!! i made a "confirmation" with an old saved game ==> the problem appears again
Thank you for the report and logs, they were very helpful.
I found out why this is happening, but, unfortunately, I don't see a way to fix this yet. The bug can affect not only those two cases, but many others and will be repeated after each reordering and is fixed only by saving and loading.
Cholmondely wrote: Fri Jun 24, 2022 10:03 am
What do you want to do about the wiki page? Would you like me to put something together for you to marmalise, or would you rather do it all on your tod?
I was going to make it but put it off due to fix attempts. I would really appreciate your help with page!
User avatar
Slartibartfast
Deadly
Deadly
Posts: 175
Joined: Mon Jan 21, 2008 3:54 pm

Re: Interface Reordering OXP

Post by Slartibartfast »

Hello Alnivel
will be repeated after each reordering and is fixed only by saving and loading.
for me -- that's no show-stopper

I don't think, that i will reorder very often. :wink:

cheers
Oolite 1.91 / Imp. Trader ( slighly modified :wink: ) on Lubuntu 22.04 LTS on AMD64 2x 3800+ ,
ATI Radeon R7240 XFS / Samsung TV 40" 1080p
C-Media CMI8738 / Yamaha RX-V575 / DIY-Speaker
Logitech Attack3 & standard german keyboard
User avatar
Cholmondely
Archivist
Archivist
Posts: 4987
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Interface Reordering OXP

Post by Cholmondely »

Started wiki page: Interface Reordering OXP

Tagged as a misc oxp (other options will be seen when you edit it).

I've not yet succeeded in using it so I can't fill in the instructions - but I've put in a couple of pointers for you!

(I'll delete all this detail when you take over the page, just leaving the pointer to the wiki page)
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 4987
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Interface Reordering OXP

Post by Cholmondely »

Just wondering if

1) a "select all" button would make sense
2) ditto for a "reset" button
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Alnivel
Dangerous
Dangerous
Posts: 100
Joined: Fri Jun 10, 2022 7:05 pm

Re: Interface Reordering OXP

Post by Alnivel »

Cholmondely wrote: Fri Jun 24, 2022 7:23 pm
Just wondering if

1) a "select all" button would make sense
2) ditto for a "reset" button
When creating OXP, I did not think that someone would totally reorder everything, but rather just add a couple of things to the beginning and hide things like configs to the end.

1) But for those who want to remake everything for themselves, of course, why not. I'll add it in the next version.
2) What exactly do you mean by "reset"? Reset to no reordering, essentially clear the ordering list, or reset the changes to the state before opening the edit screen?
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16058
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Interface Reordering OXP

Post by Cody »

Slartibartfast wrote: Fri Jun 24, 2022 1:35 pm
for me -- that's no show-stopper
<nods>
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Cholmondely
Archivist
Archivist
Posts: 4987
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: Interface Reordering OXP

Post by Cholmondely »

Alnivel wrote: Fri Jun 24, 2022 8:00 pm
Cholmondely wrote: Fri Jun 24, 2022 7:23 pm
Just wondering if

1) a "select all" button would make sense
2) ditto for a "reset" button
When creating OXP, I did not think that someone would totally reorder everything, but rather just add a couple of things to the beginning and hide things like configs to the end.

1) But for those who want to remake everything for themselves, of course, why not. I'll add it in the next version.
2) What exactly do you mean by "reset"? Reset to no reordering, essentially clear the ordering list, or reset the changes to the state before opening the edit screen?
Reset to no reordering.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4634
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Interface Reordering OXP

Post by phkb »

A suggestion: In "interface-reordering-main.js", lines 500-504, try the following instead of the "\u2xxx" nomenclature:

Code: Select all

    const markerBeforeOthers = String.fromCharCode(31) + String.fromCharCode(160) + String.fromCharCode(160); // abb
    const markerOthers       = String.fromCharCode(160) + String.fromCharCode(31) + String.fromCharCode(160); // bab
    const markerAfterOthers  = String.fromCharCode(160) + String.fromCharCode(160) + String.fromCharCode(31); // bba
    const markerDepth = String.fromCharCode(160);
And at line 63, try this:

Code: Select all

let prefix = script.$interfacePrefixes[key] || script.$interfacePrefixes[interfaceDefinition.category] || String.fromCharCode(160) + String.fromCharCode(31) + String.fromCharCode(160); // see "markerOther" in $makeInterfacePrefixes
That should remove all the question marks popping up everywhere.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4634
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Interface Reordering OXP

Post by phkb »

Slartibartfast wrote: Thu Jun 23, 2022 7:07 pm
=> Galactic almanac
====>> "Toggle the display ..." ( first entry)

=> Communicstions log
=====> "Next page"
Concerning these F4 pages that are causing errors, the issue, I think, is in how the runScreen function is being called. Basically, the third parameter of the function call is missing in both these OXPs, and whatever default the core code is applying is not the same as specifying "this".

So, to fix the Comms Log issue, the code would need to change from this:

Code: Select all

mission.runScreen(opts,this.$logHandler);
To this:

Code: Select all

mission.runScreen(opts,this.$logHandler, this);
or optionally, this:

Code: Select all

mission.runScreen(opts,this.$logHandler.bind(this));
Then everything is sweet. I've got some other fixes to apply for Comms Log, so once uploads are working to the wiki, a new version will be released and this issue should vanish.

For the Galactic Almanac (v0.7) it's a bit more involved, as there are 33 different calls to "runScreen", and 32 of them need a change. But the fix would be at lines 4655, 4684, 4713, 4740, 4778, 4833, 4886, 4917, 4960, 4991, 5023, 5066, 5098, 5120, 5205, 5283, 8764, 8787, 8814, 8841, 8868, 9215, 9238, 9348, 9381, 9653, 9677, 9791, 9832, 9885, 10050, and 10107.
In each of those instances, between the final "}" and ")" symbols ", this" needs to be inserted, so it looks like this:

Code: Select all

}, this);
That should clear up Galactic Almanac.
Post Reply