Main Menu - Options Menu

So I’ve been working on the code for the Options Menu. I know that the GUI will be changed and so I haven’t focused to much on the small details. However I’ve set up a lot of buttons and some nice features.

Here is the latest video, and picture, which shows the controls section.

Its not hard to code all these buttons, however it can be time consuming as I have to set them all up in the .layout file with XML, them root them in the .lua file, if they are a button I have to set that up as well in the lua as well as their function, lastly I have to make sure they all show/hide when ever a button is pressed. So a lot of copy/paste is being done. But I think it looks nice and gives a feel of a real menu.

8 Likes

It sucks that I can only give you one like. You’ve done a great job with this so far. For the controls, you can easily just modify the controls.lua file (at least I think that’s what it was called) in the root of the scripts directory using simple streams. If you have any other questions just ask.

I’ll take a look at the controls tomorrow, how does the text look? Would a different font work better, also should I left align it?

Used the Symmetry Buttons for +/- would like the minus button to be a real minus.
I didn’t spend a lot of time making the buttons look nice or putting them in the right place as the GUI is going to change soon.

However one thing I would like to do is increase the middle “buttons” and give them a spot to displace the volume level. IE: 100%. However I’m also considering replacing the buttons with a field or label instead.

1 Like

You can dynamically edit the button label text, so you can do something like “<-> Master Sound (50%) <+>”

Oh okay. I still need to set up a variable and how to call the sound first. I have no clue how to do that. And tbh would need someone to walk me through each step.

Just message me on slack if you need any help. Did you already register the + button to call a function whenever it is pressed?

Yes, but the function is empty

Started working on setting up toggleable buttons:

And got the sound working, here is an example to mute, max it. Going to change it so you increase/decrease by 10.

3 Likes

Okay here is a video of the sound set up better. You can adjust it by increments of 10, and it displays it for you as well.

2 Likes

Could I also get a list of everything that wants to be done for the Options Menu for 0.3.3? There are some things I can do easily and others that require new learning new things. I’d like to be able to get as much done on it as possible, and such was thinking about prioritizing the list.

Things to include:

  1. Everything that is in ogre.cfg
  2. Separate sliders for overall sound, music, and effects
  3. Everything that can be found in keymap.lua
  4. Graphics quality (so that we can turn off unnecessary effects for people with bad videocards).
  5. Languages

Things to not include:

  1. Level of difficulty, this is done after pressing New Game for the first time.
  2. Similar gameplay related items.

Here is everything from those first two files:

Colour Depth=32
Display Frequency=N/A
FSAA=0
Fixed Pipeline Enabled=Yes
Full Screen=No
RTT Preferred Mode=FBO
VSync=No
VSync Interval=1
Video Mode=1366 x 768
sRGB Gamma Conversion=No
kmp.undo = {“ctrl”, “U”}
kmp.redo = {“ctrl”, “R”}
kmp.remove = {“R”}
kmp.newmicrobe = {“C”}
kmp.vacuole = {“S”}
kmp.mitochondrion = {“M”}
kmp.oxytoxyvacuole = {“T”}
kmp.flagellum = {“F”}
kmp.chloroplast = {“P”}
kmp.togglegrid = {“G”}
kmp.rename = {“F12”}
kmp.gotostage = {“F2”}
kmp.forward = {“W”}
kmp.backward = {“S”}
kmp.leftward = {“A”}
kmp.rightward = {“D”}
kmp.shootoxytoxy = {“E”}
kmp.reproduce = {“P”}
kmp.togglemenu = {“ESCAPE”}
kmp.skipvideo = {“ESCAPE”}
kmp.gotoeditor = {“F2”}
kmp.altuniverse = {“F1”}
kmp.screenshot = {“SYSRQ”} --printscreen button
kmp.plus = {“EQUALS”}
kmp.add = {“ADD”}
kmp.minus = {“MINUS”,}
kmp.subtract = {“SUBTRACT”}

I’m going to get buttons set up for Music and Sound effects, then we can do sliders for them all. Which I might need help on.
Also what graphics qualities? Be specific as I can get the layout set up first then start coding it all.

With the controls, do you want them to be able to remap the keys? If so would we have to adjust what the tutorial/tooltips say based upon what keymapping is set? I think it could be done, just need some extra variables and some switches (if/if elses)

The other thing is Langauges?

Yes, definetely languages. I forgot about that. Thanks for reminding me!

For now, the only real graphics thing we have is having the membrane be fluid. We can also increase the spawn radius, which will allow people to zoom out more.

I think we need to have the keys some of the keys be remapped. Others, like print screen, shouldn’t change. And others, like toxin emission, will be edited within the microbe editor. So I’m guessing these ones:
kmp.undo = {“ctrl”, “U”}
kmp.redo = {“ctrl”, “R”}
kmp.remove = {“R”}
kmp.newmicrobe = {“C”}
kmp.togglegrid = {“G”}

kmp.forward = {“W”}
kmp.backward = {“S”}
kmp.leftward = {“A”}
kmp.rightward = {“D”}

kmp.reproduce = {“P”}
kmp.togglemenu = {“ESCAPE”}
kmp.gotoeditor = {“F2”}

Okay sounds good, I was also using the Options -> Controls section to “DISPLAY” all the controls, or would that be somewhere else? Thanks for the reply I’ll try to get the layouts set up this week and we can go forward with that.

With the keymap, since it’s a lua table we can edit the values in the keymap dynamically so they appear immediately in-game. I don’t think it’s a good idea to have scripts edited by the game so you’d have to save the keymap to a save file (plaintext key-value list) much like the other options; maybe make it a separate file so you can have multiple independent control schemes, even.

1 Like

Okay got the build up on my machine, going to try and redo all this on the new engine.

I have no idea what I’m doing, as well as forget everything about anything to do with coding, so any pointers in the right direction will help me tons!

1 Like

All the GUI scripts are in thrive/scripts/gui. You need to run cmake .. in the thrive/build folder after changing them to make the game pick up the changes. You can preview the GUI in chrome if you run a web server in the main thrive folder. For example with http-server -c-1 (this is another npm module you can install) and then you can open http://localhost:8080/scripts/gui/thrive_gui.html in chrome to preview the GUI (and use the devtools, and just refresh after making changes for much faster dev cycle).

The formatting script (RunCodeFormatting.rb) also cleans up the HTML, CSS and JavaScript files. You need to have the npm modules installed mentioned in the setup instructions.

2 Likes

Hows something like this look?

3 Likes

Nice work finding the animations.
I think the options button should right away show one of the options categories. We might need a few concept art pieces as to how to layout all the different options to minimize having to click through a bunch of screens.

1 Like