PadWorld-Entertainment / worldofpadman

World of PADMAN game repository
https://worldofpadman.net
Other
39 stars 9 forks source link

Glowing Player Model option cannot keep enabled status when color black is selected #149

Closed kai-li-wop closed 2 years ago

kai-li-wop commented 2 years ago

When enabling glowing player models (skins) in preferences menu the enabled status of the radio button cannot be saved when the color is set to black. When revisiting the menu, the option is always shown as disabled afterwards, but "black" glowing player models are in fact enabled in the game.

This is probably due to the handling of the CVAR "cg_glowModel". Currently it is defined so that "" (default) in the menu is interpreted as off and not empty values between 0 and 7 as the respective colors. This is unfavorable for the handling in the menu, since the radio button Glowing Player Models is currently always set to on, if the option Glow Color has a value of != 0. black, however, corresponds to 0, insofar the option Glowing Player Models is set to off if Glow Color = black.

  1. approach: cg_glowModel could be modified to consider 0 as off and then define the colors using integer values from 1 to 8. cg_glowModel would then no longer return strings. Attention, there is also cg_glowModelTeam. In any case, this approach would require more extensive changes to the glow model code. Advantage: The value 0 would then be clearly interpretable as off and could be given as default value instead of "". Disadvantage: No specific color (e.g. green) can be specified as default value as soon as Glowing Player Models is activated.

  2. approach: It might be easier to define a second CVAR that simply turns on and off the functionality associated with cg_glowModel and cg_glowModelTeam. Then the handling of cg_glowModel and cg_glowModelTeam could be left as is. Advantage: A default color can be specified for cg_glowModel, while independently of this the default value 0 can be specified to disable the feature.

  3. approach: Find a way to distinguish between the values "" and 0 for "cg_glowModel" in the menu code.

  4. approach: Eliminate black as a selectable color since it simply produces flat black and not really glowing player models. So change the code in a way that black is always disabling the whole feature. In this case we only need to do a few wording adjustments in the menu code (black = off).

mgerhardy commented 2 years ago

To easily solve apporach 3, one could use a vmCvar_t to get the string of the cvar. We have UI_RegisterCvars and UI_UpdateCvars functions for this.

mgerhardy commented 2 years ago

approach 1 should not be taken - the colors have a fixed meaning and it would be quite irritating if those colors have a different id just here.

kai-li-wop commented 2 years ago

Approach 3 it is then.

kai-li-wop commented 2 years ago

I also merged both options into one single option. bef09ee2d1708fc0cb2029de999cd738051c87f7

3aTmE commented 2 years ago

I tried to replicate the Issue with the current Codebase. Seems to be fixed!

But a similar issue appeared on my end with issue #151 . (A previously set preset wont stay in the menu after exiting it while the changes still get applied)