-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
feat: in-game options, flags overhaul #506
base: master
Are you sure you want to change the base?
Conversation
Added plugin for the in-game menu system Added example plugin with using custom flags
Lennard I love you this is amazing |
Just pushed a bit of code which "migrates" the old options file. I add the flags we just read under the |
Awesome - I mostly did the other options.ini file so I could switch between this and other branches, without constantly losing my stuff. But this is the way forward anyway! Great :) |
My plan for this right now is to override the IOI account portion of the options menu. This will virtually never be removed in an update or changed by mods. It also means it works everywhere. The Peacock tab is cool and all for testing, but moving it into options is better overall. EDIT: Seems like the IOI account option isn't shown in the pause menu options. We will have to override a template, shame but it has never been changed since chunk0. |
what about our evil plans to make everyone require a peacock account to use it /s |
My idea was that plugins could eventually register their own top-level entries in the menu (like the Test one) where they could do whatever they had to for their plugins, not just flags. This could obviously also work under Options :) On top of that, I think we may need two (or more) cachebuster variables to be able to control when which portion of the menu forcefully updates. In my initial implementation, whenever you do something in the UI you are always kicked back to the root of everything because the root-level also updates. But this may or may not be related to the cachebuster at all, but rather the way the ioiaccount response is handled. |
Yeah, I think the refresh of the menu is due to the One way around this is to store all the changes and do a bulk update by either pressing a "Save" button or by doing it when you exit the category.
Makes sense, we could still do this within options like you said, plugins could have their own menu with a link to a settings page within it (for flags) and then other custom pages. |
Found the issue with the enums, working on a fix. |
The last commit is not in a working state.
On top of that, I would really like to have the "Refresh UI" and cache buster data visible when PEACOCK_DEV is set, this really slows down testing changes to the UI. Also a nice excuse to extend the plugin API to be able to add this (along with the old "Test" menu option). I've pushed my enum fix either way, but this will need additional work. As for the enums: The problem is context/contextitem vs tabs/tabsitem for the controllers. Because a category can have both another category or flags, enums (as the normal options section uses them) won't work because they require a "tabs" controller. But if you set a category to always be "tabs", it won't be removed from the UI if you go a level deeper. So the best "solution" now was to add enum options as another level, rather than trying to mimic how Hitman usually handles enums. System is kinda messy, but it works. |
Just pushed
Agreed.
Yeah, menu templates get messy fast. The current system for enums is nice since it still shows the option info on the right, giving you context for what each enum does. |
Draft PR with WIP logic for an in-game options menu for Peacock (as a plugin, currently).
Also comes with extended flags.ts to feed the right information to the UI, plus logic to allow plugins to register their own flags (example included).