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

Added Input API #94

Merged
merged 51 commits into from
Jun 27, 2020
Merged

Added Input API #94

merged 51 commits into from
Jun 27, 2020

Conversation

TAImatem
Copy link
Contributor

ModLayoutButton: A button that has HorizontalLayoutGroup instead of Text

ModInputInput: somewhat similar to ModFieldInput, but has a nice visual representation of combos and in future will open modified input window, though some functionality could be easily moved to ModLayoutButton to make the latter more functionally complete

ModInputHandler: the input handler, can tell if registered combination is being pressed and tells the game to ignore buttons that are part of combination that's currently being pressed

ModCombination: object representation of combos, modders should use it for queries to ModInputHandler

There are also adjustments to ModHelper that pass InputHandler to mods with corresponding changes to Owo and ModLoader

Changes to ModsMenu, ModMenu and ModConfigMeny are to accomodate ModInputInput

HarmonyHelper was changed to allow patching of constructors, though many constructors seem to execute before execution of OWML (especially members of static classes)

I know that this is big commit, feel free to ask me if anything is not clear

PS sorry for changes to csproj files, couldn't figure out the OW.Unity.Dlls.1.0.2 thing

@TAImatem
Copy link
Contributor Author

TAImatem commented Apr 30, 2020

I wonder if I should expose InputHandler's *_Combo methods, or just keep it simple

@amazingalek
Copy link
Collaborator

amazingalek commented Apr 30, 2020

Some general comments:

  • Please auto format your code, in Visual Studio this is done with control+K, D. This'll fix indents, etc.
  • One line between methods
  • Use the same namespace convention used in OWML (no TAIcheat namespace)
  • Don't shorten words - write Update instead of Upd.

@TAImatem
Copy link
Contributor Author

TAIcheat is part of this only temporarily to showcase how InputHandler functions until either EnableDebugMod or LoadCustomAssets gets converted to use that system

moved to nuget package
potential bugfixes
changed some stuff to internal
@TAImatem TAImatem changed the base branch from master to dev June 26, 2020 18:04
TAImatem added 3 commits June 26, 2020 23:57
changed EnableDebugMode to use ModInputHandler
removed TAICheat
changes suggested by Alek
moved ModInputHandler's ctor to the top
TAImatem added 3 commits June 27, 2020 02:13
changed the system for listening to game's bindings to a patch-less variant
made blocking game's input optional
@TAImatem TAImatem changed the title Added InputHandler system with first version of menu input for it; adjusted patcher to accept MethodBase for patching contructors Added Input API Jun 27, 2020
@TAImatem TAImatem merged commit 3535614 into ow-mods:dev Jun 27, 2020
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

Successfully merging this pull request may close these issues.

4 participants