Page 1 of 1

Contextual Help OXP

Posted: Thu Apr 03, 2025 3:15 am
by phkb
I finally got around to releasing this. This mod *requires* Oolite 1.91, as it uses features in that release. In fact, I just pushed a patch to v1.91 to fix a bug, so you should definitely update to the latest version if you can.

I also chose to create a new thread for the release, rather than have 2 pages of discussion before the release annoucement. If you want to read the original discussion, you can find it here: https://bb.oolite.space/viewtopic.php?t=21426

What does this do? Basically, it provides a mechanism where help text related to the current GUI screen can be easily and quickly displayed. And that's (mostly) it.

The "mostly" I'm alluding to is that other OXP's can piggy-back on the system. To see this demonstrated, here's a screen grab of the help text displayed from the Short Range Chart screen.
Image
Note the line at the bottom: "Press Ctrl-G on this screen to open the Galactic Registry." That text was added by Galactic Registry. If you use Smugglers, and the Email System, you will find they both add some text as well.

So, in summary, this OXP allows for quick access to basic help on each of the GUI screens, and provides a way for OXP developers to add their own content to the help text. The help text is directly from cims Ship's Library OXP, but let me know if more/less/tweaks are needed.

At the moment, the key combination to access this is Ctrl-H. The "?" mark (shift-/ on US/UK keyboards) is out, as it's used on the Chart screen and Market screen. F1 is out, because it's in use as the "Launch ship" key. The "+" key is certainly feasible, but I don't think it's quite as intuitive as Ctrl-H. I'd prefer to use (a) a key combo that is not currently in use elsewhere, so that players aren't forced to change their keyboard configuration just to use it, and (b) a combination that can be the same on every page. So if a suggestion can be made that is more intuitive, I'm happy to change it.

In any event, to help with making it clear you *can* press Ctrl-H, a message will be shown in the console whenever you visit a GUI page for the first time, reminding you of the key combo.

The mod should be in the Download Manager now, but if you prefer a direct link, here you go: ContextualHelp.oxz.
I'll write up a wiki page shortly, with instructions on how to work with it.
OK, wiki page is up: [EliteWiki] Contextual Help

Re: Contextual Help OXP

Posted: Thu Apr 03, 2025 7:06 am
by another_commander
Ace. Will test this baby as soon as I get a chance.

Re: Contextual Help OXP

Posted: Thu Apr 03, 2025 3:57 pm
by another_commander
Two observations from testing so far:

1. The message at the bottom of each help screen reads "Press ESC to return" but I can use Enter to return just fine too.

2. Maybe this has nothing to do with the OXP itself and it was just a one-off event, but reporting it just in case. After running a few checks with Contextual Help (installed via the Manager), I uninstalled the OXP and returned to the game. Pressed Ctrl+h to make sure it was not active anymore and then launched, flew around for a minute and exited the game. When I looked at the log, I found this at the end:

Code: Select all

18:38:18.280 [gnustep]: 2025-04-03 18:38:18.280 oolite[2916] src/Core/Scripting/OOJavaScriptEngine.m:498  Assertion failed in OOJavaScriptEngine(instance), method callJSFunction:forObject:argc:argv:result:.  Invalid parameter not satisfying: OOJSValueIsFunction(context, function)

18:38:18.282 [exception]: ***** Exception in pollDockedControls [GUI keys]: NSInternalInconsistencyException : src/Core/Scripting/OOJavaScriptEngine.m:498  Assertion failed in OOJavaScriptEngine(instance), method callJSFunction:forObject:argc:argv:result:.  Invalid parameter not satisfying: OOJSValueIsFunction(context, function)
18:39:00.108 [exit.context]: Exiting: Shift-escape pressed.
18:39:00.112 [gameController.exitApp]: .GNUstepDefaults synchronized.

Closing log at 2025-04-03 18:39:00 +0300.
This did not happen when I relaunched the game for one last check (without Contextual Help).

The full log from that run is attached for completeness.

Re: Contextual Help OXP

Posted: Thu Apr 03, 2025 4:22 pm
by another_commander
OK, reproduced the second error by following the process from start (install OXP via Manager, use it for a couple of screens, uninstall it via Manager, press Ctrl+h a few times, exit).

It seems that the action that causes it is the Ctrl+h after the OXP has been uninstalled. Once I quite the game and relaunch it, I can press Ctrl+h as much as I want and all is good.

It's a minor issue I would say, there does not seem to be any actual problem in the game and frankly, I would have never noticed had I not made it standard practice to look at the log after every test run.

Re: Contextual Help OXP

Posted: Thu Apr 03, 2025 4:43 pm
by Captain Beatnik
Great new feature, good work!

Any chance Oolite 1.91 will be avaliable soon for mac so that mac users (like me) can also use it?

Re: Contextual Help OXP

Posted: Thu Apr 03, 2025 7:14 pm
by Redspear
phkb wrote: Thu Apr 03, 2025 3:15 am
So, in summary, this OXP allows for quick access to basic help on each of the GUI screens, and provides a way for OXP developers to add their own content to the help text.
Will have to check this out but sounds great.

Re: Contextual Help OXP

Posted: Fri Apr 04, 2025 5:55 am
by phkb
another_commander wrote: Thu Apr 03, 2025 4:22 pm
It's a minor issue I would say, there does not seem to be any actual problem in the game and frankly, I would have never noticed had I not made it standard practice to look at the log after every test run.
Top job finding it! It was a bug in core code - I wasn't destroying the array at the correct time. Anyway, patch is in, so a new 1.91 should be out shortly.

I've also posted a small update to Contextual Help, removing a debug message and expanding the readme.txt.

Re: Contextual Help OXP

Posted: Tue Apr 22, 2025 1:32 am
by Wildeblood
phkb wrote: Fri Apr 04, 2025 5:55 am
I've also posted a small update to Contextual Help, removing a debug message and expanding the readme.txt.
Did you get this one?

09:12:42.038 [ContextualHelp]: Invalid GUI screen code specified: GUI_SCREEN_MARKET_INFO

Should have been GUI_SCREEN_MARKETINFO.

Re: Contextual Help OXP

Posted: Tue Apr 22, 2025 6:48 am
by phkb
Yep, that was in the Email System. I was attempting to make the Email system accessible from every screen, but made a mistake on the last one and forgot to check.