[WIP] new GUI for debug console

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

Moderators: another_commander, winston

Post Reply
cag
Dangerous
Dangerous
Posts: 89
Joined: Fri Mar 17, 2017 1:49 am

[WIP] new GUI for debug console

Post by cag »

Built using OoDebugConsole1.5 as a starting point, this version is functionally the same, just with less typing.

The one exception is the 'alias' function in Options menu. Basic-debug.oxp provides a few, eg. 'PS' for player.ship, but I wanted more (and in lower case!).

As with Basic-debug.oxp, these are just properties of the console script. I've added polling, so if you set one to something dynamic (eg. 'pt' for player.ship.target), it will be up to date. I've also had success adding functions, as long as I remember to type '()' after the alias :)

At present there is no documentation. What started as just my own hacked version has grown over time so I thought others may find it useful. I copied the Debug menu from the Mac OS version and tossed in anything else I could find in oolite-debug-console.js.

features:
  • menus for debug, options, font and once connected, a menu for options in debugConfig.plist
  • pop-up menus for frames (includes a search function) & scroll bars
  • command history search via the Tab key (Shift-Tab to search the other way)
    You can also remove a command from the history using the pop-up menu or Ctrl-Delete.
    (I load new functions a lot, even entire scripts, and my history file grew quite large!
    FYI: I also added a limit of 200 commands/2MB)

Python source: https://www.dropbox.com/s/junf73vkqibdn ... 2.zip?dl=0
- if not already present, will need to install the 'twisted' package

Windows exe: https://www.dropbox.com/s/x62r5gvp65yhe ... 2.exe?dl=0

Edited Jan. 7/20 @ 7:15 pm EST
- new versions uploaded to fix dialog window bug

requires:
Last edited by cag on Wed Jan 08, 2020 12:18 am, edited 1 time in total.
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5453
Joined: Wed Feb 28, 2007 7:54 am

Re: [WIP] new GUI for debug console

Post by another_commander »

Good job, thanks.

As a very minor observation, after building the application, I get the Tk icon on the console window rather than the "correct" one. Any idea why this would be?

cag
Dangerous
Dangerous
Posts: 89
Joined: Fri Mar 17, 2017 1:49 am

Re: [WIP] new GUI for debug console

Post by cag »

after building the application, I get the Tk icon on the console window rather than the "correct" one
I'm unable to reproduce on my rig (Windows 10 Pro - 1809) either by running the .exe or the script via pythonw.exe. I see the provided icon on the console, taskbar and dialog windows (Tk's "feather" icon is just ugly imho)

What's your OS? What do you mean by "building the application"? It should be sufficient, assuming you have Python installed, to run the script as is, as Python will check the script's folder for the icon.

Speed is not a factor. I always just run the script and it can handle a dozen or more log messages/frame easily. The .exe was provided for those who don't have Python installed.

If you are building an executable for another OS, getting it to cooperate with Tk can require some fiddling. I built the .exe using pyinstaller, which has a handy --icon= arg.
"Better to be thought a fool, boy, than to open your trap and remove all doubt." - Grandma [over time, just "Shut your trap... fool"]
"The only stupid questions are the ones you fail to ask." - Dad
How do I...? Nevermind.

another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 5453
Joined: Wed Feb 28, 2007 7:54 am

Re: [WIP] new GUI for debug console

Post by another_commander »

I was using pyinstaller on Windows as well. When I talked about building the application I meant generating a stand-alone executable.

It turns out I had omitted adding the icon in the list of files that pyinstaller packs. Without the icon, it was defaulting to the Tk one. I have now managed to build a stand-alone console exe that runs correctly using this command line in the folder where the console source was copied to:

C:\OoDebugConsole2> pyinstaller --onefile --add-data="OoJSC.ico;." --windowed DebugConsole.py -i OoJSC.ico

Thanks again for the help.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: [WIP] new GUI for debug console

Post by Svengali »

Nice work, a_c!!!! Thanks a lot. :D

Post Reply