3dfxdev / EDGE

EDGE Source Code
http://edge2.sf.net
74 stars 10 forks source link

Changing any boolean option through menu doesn't update the CVar #69

Closed usernameak closed 4 years ago

usernameak commented 5 years ago

Steps to reproduce:

  1. Set any boolean cvar through options menu
  2. Try to lookup it through console
  3. You will get the old value!

If you set the variable thru console, it will be OK.

Please fix it because it makes me unable to update the config format. They don't get saved if i set them through menu!

p.s. i have linux

usernameak commented 5 years ago

Found the cause. M_OptResponder in m_option.cc casts the cvar_c pointers to int and bool pointers and sets them. (WHAT?!)

Corbachu commented 5 years ago

Yeah I see that...well, as you can see by looking through both m_menu and m_option, both files are very old and had a lot of work done to them for a long time. My initial reaction, and something I want to do, is completely rework the menu system into something more modular and modifiable, as these menus and their code have been around mostly verbatim since DOSDoom.

Corbachu commented 5 years ago

@usernameak What I can do is rework every option in the responder to translate to cvars as they probably were meant to be at one point. The ones that cannot are most like gameflags, which the majority of those as stated were moved over.

Interestingly I’ll take a look at the 1.32 version of edge which actually moved all of this over, but had disabled menus, presumably since it was all being reworked for cvar based options.

There is also this old commit (8679bbd) which indeed has the old defaults system completely disabled. I do not remember if he disabled it directly and later re-enabled it or if we re-implemented it. Using this code as a direct reference it should allow for you to finish up #66 or at least get enough of it done for me to move in and convert the rest of everything else into cvars. What do you think usernameak?

Corbachu commented 4 years ago

@madame-rachelle merged #73 in by @usernameak, closing.