Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion: dependencies #8

Closed
Popeye4242 opened this issue Mar 14, 2021 · 8 comments
Closed

Feature suggestion: dependencies #8

Popeye4242 opened this issue Mar 14, 2021 · 8 comments

Comments

@Popeye4242
Copy link

Hi,

having a lot of options can make the options list very long very fast. Therefore dependencies might be useful where we can change an option and depending on that options values we show or hide other options.

I don't need this right now but I'll just leave this as an idea here.

@DorCoMaNdO
Copy link
Owner

Already added as part of 0.2.0-dev builds with properties MenuVisible and HudVisible, ideally used with the ValueChanged event.

@Popeye4242
Copy link
Author

Popeye4242 commented Mar 14, 2021

image
This works for the options on the left. The options in the game menu can still not be disabled.
image

@DorCoMaNdO
Copy link
Owner

You set MenuVisible to false right? Does it work when you reopen the menu?

@Popeye4242
Copy link
Author

When I close the menu and reopen it then all custom options disappear. Including the ones where the visibility wasn't toggled.

@DorCoMaNdO
Copy link
Owner

I'll take a look

@DorCoMaNdO
Copy link
Owner

Will be fixed with 0.2.0-dev.3, I'll also recommend using CustomOption.RaiseValueChanged(false); (on plugin load) after the update too, to update the option visibility to the default/currently selected value when first loading into the game.

@DorCoMaNdO
Copy link
Owner

Should be solved now, please let me know if you encounter any other issues.

@BOTHLine
Copy link

BOTHLine commented Apr 4, 2021

I get the following NullReferenceException when opening the GameOptionsMenu, after doing something specific:

  • Open the GameOptionsMenu -> CustomOption will be created
  • Close the GameOptionsMenu
  • On the created CustomOption, set MenuVisible to false
  • Reopen the GameOptionsMenu

After reopening the GameOptionsMenu, the NullReferenceException occurs (It should happen in GetGameOptions(lowestY)
else if ((UnityEngine.Object) option.GameSetting != (UnityEngine.Object) null) { ((UnityEngine.Component) option.GameSetting).gameObject.SetActive(true); optionBehaviourList.Add(option.GameSetting); }

Somehow the component/gameObject seems to be null.

[Error : Detour] UnhollowerBaseLib.Il2CppException: System.NullReferenceException: Object reference not set to an instance of an object.
at UnhollowerBaseLib.Il2CppException.RaiseExceptionIfNecessary (System.IntPtr returnedException) [0x00014] in :0
at UnityEngine.Component.get_gameObject () [0x0002c] in <045cf7e91f5542268be1763686f1f2ad>:0
at Essentials.Options.CustomOption.GetGameOptions (System.Single lowestY) [0x00063] in <1254f1b337aa418a8f8bfbd277af126f>:0
at Essentials.Options.CustomOption+GameOptionsMenuPatchStart.Postfix (GameOptionsMenu __instance) [0x0002b] in <1254f1b337aa418a8f8bfbd277af126f>:0
at (wrapper dynamic-method) GameOptionsMenu.DMDGameOptionsMenu::Start(GameOptionsMenu)
at (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.(il2cpp -> managed) Start(intptr,UnhollowerBaseLib.Runtime.Il2CppMethodInfo*)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants