aliens

Author Topic: Adding new ::options:: to code base.  (Read 3042 times)

Offline KingMob4313

  • Commander
  • *****
  • Posts: 543
  • Never let me down again.
    • View Profile
    • Mod Hub for Equal Terms 2.0
Adding new ::options:: to code base.
« on: August 18, 2014, 06:13:26 pm »
Disclaimer: I am no where near a check-in or a legit branch to do a check-in

I've been scrambling through the code lately, making a number of changes for my own benefit and fun (immortal mod and so on) but there is still one point that's escaping me:

I'd like to make new base options that can be selected at the advanced options menu that can enable or disable some of these mods, but I'm a bit lost on how it reads and enumerates those options.  Anyone have an idea of where I can go looking in the code base?


Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Adding new ::options:: to code base.
« Reply #1 on: August 18, 2014, 06:20:43 pm »
src/Engine/Options.cpp
_info.push_back(OptionInfo("newoption", &newoption, 0, "STR_newoption", "STR_GENERAL"));

+ if your option is not yes/no -> src/Menu/OptionsAdvancedState.cpp

in the code
if (Options::newoption)...

Offline KingMob4313

  • Commander
  • *****
  • Posts: 543
  • Never let me down again.
    • View Profile
    • Mod Hub for Equal Terms 2.0
Re: Adding new ::options:: to code base.
« Reply #2 on: August 18, 2014, 06:25:33 pm »
src/Engine/Options.cpp
_info.push_back(OptionInfo("newoption", &newoption, 0, "STR_newoption", "STR_GENERAL"));

+ if your option is not yes/no -> src/Menu/OptionsAdvancedState.cpp

in the code
if (Options::newoption)...

Sweet. That will make management much easier.  Now it's just a matter of deciding which changes I've made to gameplay are worthy of prime time.

Thanks for the quick response.