Page 1 of 2

Interface Reordering OXP

Posted: Thu Jun 23, 2022 4:54 pm
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?

Re: Interface Reordering OXP

Posted: Thu Jun 23, 2022 5:58 pm
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

Re: Interface Reordering OXP

Posted: Thu Jun 23, 2022 6:59 pm
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?

Re: Interface Reordering OXP

Posted: Thu Jun 23, 2022 7:07 pm
by Slartibartfast
hi

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

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

logs -- maybe later

Re: Interface Reordering OXP

Posted: Thu Jun 23, 2022 7:55 pm
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

Re: Interface Reordering OXP

Posted: Fri Jun 24, 2022 10:03 am
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?

Re: Interface Reordering OXP

Posted: Fri Jun 24, 2022 12:53 pm
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!

Re: Interface Reordering OXP

Posted: Fri Jun 24, 2022 1:35 pm
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

Re: Interface Reordering OXP

Posted: Fri Jun 24, 2022 2:31 pm
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)

Re: Interface Reordering OXP

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

1) a "select all" button would make sense
2) ditto for a "reset" button

Re: Interface Reordering OXP

Posted: Fri Jun 24, 2022 8:00 pm
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?

Re: Interface Reordering OXP

Posted: Fri Jun 24, 2022 9:14 pm
by Cody
Slartibartfast wrote: Fri Jun 24, 2022 1:35 pm
for me -- that's no show-stopper
<nods>

Re: Interface Reordering OXP

Posted: Sat Jun 25, 2022 11:59 pm
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.

Re: Interface Reordering OXP

Posted: Mon Jun 27, 2022 3:29 am
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.

Re: Interface Reordering OXP

Posted: Mon Jun 27, 2022 5:33 am
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.