Orion Custom Gumps Findings
Posted: Fri Sep 17, 2021 11:52 am
Orion has some awesome features. Its biggest drawback (and its a big one) is its lack of resources. A lot of the features can be sussed out by using them and then seeing the results. Not so much with gumps and custom gumps are no exception. I suppose at least with regular gumps you can record what you did to see how to access it in a script setting. Not so much with custom gumps. Having figured out how to make a working custom gump in Orion, I thought I would share some of my findings.
Before I get into it, a huge shout out to ZeeeQi for getting me on the right track for understanding the mechanics of Orion's custom gumps.
I should probably also preface that I have made several graphical user interfaces for college classes (Java and Python) and even for EasyUO so I may take things as simpler than they actually are. Please feel free to add or ask for clarification.
I dislike using text input for GUIs. Input testing is a nightmare for everyone, besides often times it is more convenient for the user to use a slider, checkbox, dropdown, etc. Unfortunately, for any custom gump pieces you have to list a used graphic. That means that you have to iterate through the graphics till you find a good fit. The sliders were much too complex for me to deal with this technique, but here are the other graphics I found worked well:
CheckBox
(unchecked): 0x00D2 (checked): 0x00D3 ComboBox
(closed): 0x90 (open): 0x90
Shown in message below.
Button
(default): 0x00F9
Shown in message below.
(selected): 0x00F7
Shown in message below.
(pressed): 0x00F8
Showen in message below.
In Orion you must have 3 things to have the custom gump function.
You must have the script that created the custom gump selected when you want to update anything on the gump.
You need something that "makes a selection in the gump." The only thing that I found that has that listed as a parameter is the Button. In that case, you must click the button whenever you wish to update the gump.
You need a call back function that may run independently (you'll need globals) of the script whenever you press the button.
From within the call back function there are 3 important types information retrieving functions.
ReturnCode - The serial of what triggered the call back function. (0 - closed the gump; serial chosen - Okay buttons).
responses (e.g. Checks) - A list of serials or serials/index of all the SET input boxes. Meaning for checkboxes it only shows the boxes that are checked (not the ones that aren't). For the other one's it returns a list of PairIntInts. The Index is the serial and the Value is the item selected. For ComboBoxes you have to use the value as an index for the list that was used to generate.
response (e.g. CheckBox) - The value that a gump input is holding (for a serial). For a checkbox its true if its checked and false if its not. For combobox its the index of the list given that was selected. For text its the text.
Hope this helps people who are interested in trying to get into guis in Orion, but have so far been unable to. Again feel free to ask me questions, correct me, or add to what I have said. I tend to be pretty busy once the school term starts, but I will do my best.
Before I get into it, a huge shout out to ZeeeQi for getting me on the right track for understanding the mechanics of Orion's custom gumps.
I should probably also preface that I have made several graphical user interfaces for college classes (Java and Python) and even for EasyUO so I may take things as simpler than they actually are. Please feel free to add or ask for clarification.
I dislike using text input for GUIs. Input testing is a nightmare for everyone, besides often times it is more convenient for the user to use a slider, checkbox, dropdown, etc. Unfortunately, for any custom gump pieces you have to list a used graphic. That means that you have to iterate through the graphics till you find a good fit. The sliders were much too complex for me to deal with this technique, but here are the other graphics I found worked well:
CheckBox
(unchecked): 0x00D2 (checked): 0x00D3 ComboBox
(closed): 0x90 (open): 0x90
Shown in message below.
Button
(default): 0x00F9
Shown in message below.
(selected): 0x00F7
Shown in message below.
(pressed): 0x00F8
Showen in message below.
In Orion you must have 3 things to have the custom gump function.
You must have the script that created the custom gump selected when you want to update anything on the gump.
You need something that "makes a selection in the gump." The only thing that I found that has that listed as a parameter is the Button. In that case, you must click the button whenever you wish to update the gump.
You need a call back function that may run independently (you'll need globals) of the script whenever you press the button.
From within the call back function there are 3 important types information retrieving functions.
ReturnCode - The serial of what triggered the call back function. (0 - closed the gump; serial chosen - Okay buttons).
responses (e.g. Checks) - A list of serials or serials/index of all the SET input boxes. Meaning for checkboxes it only shows the boxes that are checked (not the ones that aren't). For the other one's it returns a list of PairIntInts. The Index is the serial and the Value is the item selected. For ComboBoxes you have to use the value as an index for the list that was used to generate.
response (e.g. CheckBox) - The value that a gump input is holding (for a serial). For a checkbox its true if its checked and false if its not. For combobox its the index of the list given that was selected. For text its the text.
Hope this helps people who are interested in trying to get into guis in Orion, but have so far been unable to. Again feel free to ask me questions, correct me, or add to what I have said. I tend to be pretty busy once the school term starts, but I will do my best.