-
Notifications
You must be signed in to change notification settings - Fork 376
Added dropdown options in pause menu #2165
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
Conversation
By default, it will include the mod settings menu Options can be added to the dropdown as well Shortcut can be used with 'D'
|
How will mods know that their settings have changed though? Most load settings at initialisation so changing them mid game will not change anything. There are some I can think of in my mods where they cause overriding of behaviour that currently has no way to undo it without restarting the game. TheLacus suggested a flag per setting so mod authors could mark dynamically changeable settings. I think this PR will need synchronising with that work. Could the standard vanilla arrows work for this, or are the new ones needed for some reason? |
Right, I will try and implement that part. Would the flag essentially be used a visibility flag in the mod settings window?
I actually wasn't aware that they existed - I'd be happy to use them. Which textures would those be? |
|
the ones I used for the item list scroller component were these, though there may be others more applicable for what you're doing. I just thought I'd mention it so you could consider what's most appropriate. :)
I think the flag would need to indicate that a mod setting was dynamically changeable at runtime and default to false. My thought is that settings would be 'greyed' out and non-interacting during runtime of DFU unless the flag had been set by mod author indicating that it can be changed. That would avoid layout issues. |
Use Action instead of MouseClick handler
|
Considering that this PR is essentially a front-end to an already existing feature in the console, and that the mod setting changes might be more involved, I will set aside those commits for a separate PR. I am still trying to figure out a solution to positioning the dropdown to the top-left corner of the screen, but this PR is feature-complete otherwise. |
- Move dropdown to ParentPanel (top-left corner) and scale it to the NativePanel - Parts of the ListBox had to be modified to put selection and mouse-clicking at the right scale.
|
I finally found a solution to get the dropdown to move it to the ParentPanel and have it scale properly with the NativePanel. I had issues with the ListBox scaling properly to be in sync with what my mouse was hovering over, so I had to do some modifications. I don't believe it caused any regressions after testing the Save and Talk windows. It is a very messy fix, but I am not aware of a better way to do it. If there is, please let me know. |
Those changes should be OK. I never considering parenting ListBox outside of native panels, so something like this is really necessary in this case. I'll try to find any problems, but I think it will be fine. |
(Very last minute but in EDT it isn't July yet! Hopefully I make it through the feature lock ;))
Implements #2004
Added a dropdown menu in the pause window that by default will include access to the mod settings menu. I simply took the same logic as the static class ChangeModSettings in DefaultCommands, so hopefully this should suffice. Shortcut to toggle it can can be used with 'D'.
Additional options (button text and button click event) can be easily added to the dropdown via a method from DaggerfallUI called RegisterPauseOptionToDropdown that takes in a string for the button text and an Action to implement the logic once it has been clicked.
I'm making this a draft because I have been having a hard time trying to get the dropdown toggle be moved to the very edge of the screen. When I add it to ParentPanel, the controls become very tiny and I haven't figured out how to properly scale it with AutoSize, Scale = NativePanel.LocalScale, etc. I would appreciate any help to get this working as I want it to. Additionally, if there are any other improvements to what I have down, please feel free to let me know.