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

Keyboard Shortcut improvements #416

Merged
merged 19 commits into from
Mar 6, 2024
Merged

Keyboard Shortcut improvements #416

merged 19 commits into from
Mar 6, 2024

Conversation

gablm
Copy link
Member

@gablm gablm commented Mar 2, 2024

This PR tries to improve the current Keyboards Shortcuts module.

  • Shortcuts are now stored in a dictionary.

    • Allows removal and additions of shortcuts without breaking the other shortcuts.
  • Fixes some margins in the UI

    • Content now tries to set its width to the size of the bottom navigation bar (min: 400px)
    • Wrapping is added to some lengthier descriptions
  • Allows translation of the strings "Ctrl", "Alt" and "Shift" show in the shortcuts menu.

Both suggested in #409

Copy link

github-actions bot commented Mar 2, 2024

Qodana for .NET

1 new problem were found

Inspection name Severity Problems
Possible 'System.NullReferenceException' 🔶 Warning 1

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@gablm gablm self-assigned this Mar 3, 2024
@gablm gablm requested a review from a team March 3, 2024 13:09
Copy link
Member

@bagusnl bagusnl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General questions ahead~

@gablm gablm added Enhancement New feature or request Area: UI/UX Issue labeled for User Interface/eXperience related issue labels Mar 4, 2024
@gablm gablm merged commit c3d3b5a into main Mar 6, 2024
4 checks passed
@gablm gablm deleted the kbs-revamp branch March 6, 2024 16:56
bagusnl added a commit that referenced this pull request Mar 9, 2024
* [skip ci] Update README.md

* Clamp column width if there is no space left

This to fix the DataTable component causing a crash due to negative value if small window mode is used.

* Enable Rich Presence only after the activated region is set

might fix #402

* Fix blurry console icon

Also, get the icon from exe rather than a separate ico file

* (CodeQA) Theme xaml

* Move RPC dispose

Adjusted to be in the same file where it is initialized (448ff77)

* Change default value displayed for ```Download Threads``` to match the real default value

* Auto resize DataTable column width using star

L.CRC and R.CRC are hidden in small window mode before this commit.

* [skip ci] Update LICENSE and its references

* [skip ci] Update SECURITY.md
- Added @shatyuka and @gablm to the active maintainers list
- Update supported version section

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* HI3 Senadina Game Settings Adjustments (#417)

* (GSP) HI3: Adjust to new version

* [skip ci] Add more abbreviation list

* Use ShouldComputeInputPris on build
To try mitigate resource not found error

* (GSP) More Hi3 Senadina backend changes

* (GSP) Force GraphicsGrade to 6 on Save

* (GSP) Docs

* (GSP) Senadina frontends

and localization

* (GSP) Disable preset

* CodeQA stuff

* Fix crash due to value not exist for ``GraphicsReflectionQuality``

* Move and change Physics toggle to ``ToggleSwitch``

* review adjustments

* Review adjustment
- Use comparedTo instead of TypeExtensions for Equals() in PhysicsSimulation.cs
- Adjustment on comparedTo in GraphicsGrade.cs
- Remove unnecessary int declaration in Honkai\RegistryClass\Enums.cs

---------

Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>
Co-authored-by: Ron Friedman <cryogen65@gmail.com>

* Add delay for GameBoost

Adding 10 seconds before changing the priority to allow for the process to initialize.
Also move to its own method to avoid error mixed up with main game launching method error(s).
Also also, fix some code QA problems on the changed section because might as well :ahuehue:

* Update WindowsAppSDK to 1.5.0

Related #418

* (DiscordRPC) Reset `_firstTimeConnect` for new client

* Use Waifu2X to enlarge background image (#412)

* Use Waifu2X to enlarge background image

* More checks

* Resize to window size

We will not get pixelated image using MagicScaler

* Code cleanup

* Rename models folder name

* Add some useful logs

* Auto detect GPU

discrete > integrated > others

* Enable OpenMP for speed

* [skip ci] Add WAIFU2X.LICENSE and OPENMP.LICENSE

* Minor fixes

---------

Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>

* [skip ci] Use ex variable on GameBoost_Invoke

oops...

* (CodeQA) SettingsPage

- Change copyright year
- Sync maintainers
- Suppress null scans (take it ReSharper!)
- Suppress unrelated Xaml warnings

* Stop "open -p" from starting a game when not updated

* (Waifu2X) Fix failed test log

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* (Waifu2X) Fix crash on exit

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Fix CustomBG checkbox logic

:derp:

* Fix Level of Detail setting order for Hi3

* Read the cache reference from stream for Hi3

* Keyboard Shortcut improvements (#416)

* Revamp how shortcuts are saved and fix UI margins

* Convert old shortcut list

* Minor refactor + Fix KbShortcut related flyout crash

* Allow localization of VirtualKeyModifiers

* Remove invalid shortcuts and save if the dictionary is altered

* Qodana

* Parse kbshortcuts .ini only when enabling the shortcuts

* Turn DefaultShortcutList into a readonly field

* (KbShortcuts) Get GameCount and MaxRegions from Metadata

* Remove Equals/HashCode and directly compare values

* Update KeyboardShortcuts.cs

* No possible multiple enumerations while loading shortcuts

* Fix validity check for new shortcut combinations

* (KeyboardShortcut) CodeQA

- Suppress null warnings
- Wrap long lines
- Remove unnecessary statement

* (KeyboardShortcut) CodeQA part 2

Bc no save :(

* (Keyboard Shortcut) Fix opacity animation

---------

Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* [skip ci] Bump version

* Add function to launch game in alt (legacy Collapse) launch mode

* Update NuGet(s)
- MagicScaler 0.14.0 -> 0.14.2
https://github.com/saucecontrol/PhotoSauce/releases/tag/v0.14.1
https://github.com/saucecontrol/PhotoSauce/releases/tag/v0.14.2

- BuildSDK

* Small refactor on HomePage.StartGame
- Avoid multiple call on the same parameter
- Avoid unnecessary call on unused parameter
- Use async overload when disposing ResizableWindowHookToken
- Avoid NRE if WatchOutputLog is unexpectedly cancelled before the time
- Suppress some NRE

---------

Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>
Co-authored-by: Gabriel Lima <44784408+gablm@users.noreply.github.com>
Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Ron Friedman <cryogen65@gmail.com>
bagusnl added a commit that referenced this pull request Mar 9, 2024
* [skip ci] Update README.md

* Clamp column width if there is no space left

This to fix the DataTable component causing a crash due to negative value if small window mode is used.

* Enable Rich Presence only after the activated region is set

might fix #402

* Fix blurry console icon

Also, get the icon from exe rather than a separate ico file

* (CodeQA) Theme xaml

* Move RPC dispose

Adjusted to be in the same file where it is initialized (448ff77)

* Change default value displayed for ```Download Threads``` to match the real default value

* Auto resize DataTable column width using star

L.CRC and R.CRC are hidden in small window mode before this commit.

* [skip ci] Update LICENSE and its references

* [skip ci] Update SECURITY.md
- Added @shatyuka and @gablm to the active maintainers list
- Update supported version section

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* HI3 Senadina Game Settings Adjustments (#417)

* (GSP) HI3: Adjust to new version

* [skip ci] Add more abbreviation list

* Use ShouldComputeInputPris on build
To try mitigate resource not found error

* (GSP) More Hi3 Senadina backend changes

* (GSP) Force GraphicsGrade to 6 on Save

* (GSP) Docs

* (GSP) Senadina frontends

and localization

* (GSP) Disable preset

* CodeQA stuff

* Fix crash due to value not exist for ``GraphicsReflectionQuality``

* Move and change Physics toggle to ``ToggleSwitch``

* review adjustments

* Review adjustment
- Use comparedTo instead of TypeExtensions for Equals() in PhysicsSimulation.cs
- Adjustment on comparedTo in GraphicsGrade.cs
- Remove unnecessary int declaration in Honkai\RegistryClass\Enums.cs

---------

Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>
Co-authored-by: Ron Friedman <cryogen65@gmail.com>

* Add delay for GameBoost

Adding 10 seconds before changing the priority to allow for the process to initialize.
Also move to its own method to avoid error mixed up with main game launching method error(s).
Also also, fix some code QA problems on the changed section because might as well :ahuehue:

* Update WindowsAppSDK to 1.5.0

Related #418

* (DiscordRPC) Reset `_firstTimeConnect` for new client

* Use Waifu2X to enlarge background image (#412)

* Use Waifu2X to enlarge background image

* More checks

* Resize to window size

We will not get pixelated image using MagicScaler

* Code cleanup

* Rename models folder name

* Add some useful logs

* Auto detect GPU

discrete > integrated > others

* Enable OpenMP for speed

* [skip ci] Add WAIFU2X.LICENSE and OPENMP.LICENSE

* Minor fixes

---------

Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>

* [skip ci] Use ex variable on GameBoost_Invoke

oops...

* (CodeQA) SettingsPage

- Change copyright year
- Sync maintainers
- Suppress null scans (take it ReSharper!)
- Suppress unrelated Xaml warnings

* Stop "open -p" from starting a game when not updated

* (Waifu2X) Fix failed test log

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* (Waifu2X) Fix crash on exit

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* Fix CustomBG checkbox logic

:derp:

* Fix Level of Detail setting order for Hi3

* Read the cache reference from stream for Hi3

* Keyboard Shortcut improvements (#416)

* Revamp how shortcuts are saved and fix UI margins

* Convert old shortcut list

* Minor refactor + Fix KbShortcut related flyout crash

* Allow localization of VirtualKeyModifiers

* Remove invalid shortcuts and save if the dictionary is altered

* Qodana

* Parse kbshortcuts .ini only when enabling the shortcuts

* Turn DefaultShortcutList into a readonly field

* (KbShortcuts) Get GameCount and MaxRegions from Metadata

* Remove Equals/HashCode and directly compare values

* Update KeyboardShortcuts.cs

* No possible multiple enumerations while loading shortcuts

* Fix validity check for new shortcut combinations

* (KeyboardShortcut) CodeQA

- Suppress null warnings
- Wrap long lines
- Remove unnecessary statement

* (KeyboardShortcut) CodeQA part 2

Bc no save :(

* (Keyboard Shortcut) Fix opacity animation

---------

Co-authored-by: Bagus Nur Listiyono <dzakibagus@gmail.com>

* [skip ci] Sync translation Translate en_US.json in es_419

100% reviewed source file: 'en_US.json'
on 'es_419'.

* [skip ci] Sync translation Translate en_US.json in ja_JP

100% reviewed source file: 'en_US.json'
on 'ja_JP'.

* [skip ci] Sync translation Translate en_US.json in zh_CN

100% reviewed source file: 'en_US.json'
on 'zh_CN'.

* [skip ci] Bump version

* Add function to launch game in alt (legacy Collapse) launch mode

* Update NuGet(s)
- MagicScaler 0.14.0 -> 0.14.2
https://github.com/saucecontrol/PhotoSauce/releases/tag/v0.14.1
https://github.com/saucecontrol/PhotoSauce/releases/tag/v0.14.2

- BuildSDK

* Small refactor on HomePage.StartGame
- Avoid multiple call on the same parameter
- Avoid unnecessary call on unused parameter
- Use async overload when disposing ResizableWindowHookToken
- Avoid NRE if WatchOutputLog is unexpectedly cancelled before the time
- Suppress some NRE

---------

Co-authored-by: Ron Friedman <9833218+Cryotechnic@users.noreply.github.com>
Co-authored-by: Kemal Setya Adhi <dev.kemalsetyaa@gmail.com>
Co-authored-by: Gabriel Lima <44784408+gablm@users.noreply.github.com>
Co-authored-by: Shatyuka <958182453@qq.com>
Co-authored-by: transifex-integration[bot] <43880903+transifex-integration[bot]@users.noreply.github.com>
Co-authored-by: Ron Friedman <cryogen65@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: UI/UX Issue labeled for User Interface/eXperience related issue Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants