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

Adds gamepad exit hotkeys (plus and minus) to the input section #504

Open
wants to merge 38 commits into
base: master
Choose a base branch
from

Conversation

Goodfeat
Copy link
Contributor

@Goodfeat Goodfeat commented Jan 8, 2025

Adds gamepad exit hotkeys (plus and minus) to the input section. Pressing them simultaneously will trigger one of two events: exit the application or exit the game. This can be disabled. Only works for gamepads

image

@github-actions github-actions bot added the gui Affects the Avalonia UI or translations. label Jan 8, 2025
Copy link
Member

@GreemDev GreemDev left a comment

Choose a reason for hiding this comment

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

Looks fine, apart from the project coding style violations & Spetial.

private static bool hotButtonMinus = false;
private static bool HotExit = false;

public bool spetialExit()
Copy link
Member

Choose a reason for hiding this comment

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

Improper casing + misspelling

bool ignoreControllerApplet)
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet) { }
bool ignoreControllerApplet,
int SpetialExitEmulator)
Copy link
Member

Choose a reason for hiding this comment

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

casing + misspelling

bool ignoreControllerApplet)
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
bool ignoreControllerApplet,
int SpetialExitEmulator)
Copy link
Member

Choose a reason for hiding this comment

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

casing + misspelling again

@@ -274,6 +277,9 @@ private static string OptionName(string propertyName) =>
[Option("enable-mouse", Required = false, Default = false, HelpText = "Enable or disable mouse support.")]
public bool EnableMouse { get; set; }

[Option("enable-press-hotkeys-to-exit", Required = false, Default = 0, HelpText = "press the minus and plus buttons to: 0 -disable, 1 - exit app, 2 - exit game.")]
public int spetialExit { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

Property name casing + misspelling

bool ignoreControllerApplet)
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet)
bool ignoreControllerApplet,
int SpetialExitEmulator)
Copy link
Member

Choose a reason for hiding this comment

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

casing + misspelling again

@@ -88,6 +88,7 @@ public static void QueueMainThreadAction(Action action)

private readonly AspectRatio _aspectRatio;
private readonly bool _enableMouse;
private readonly int _SpetialExitEmulator;
Copy link
Member

Choose a reason for hiding this comment

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

casing + misspelling

}),
(60, static cff =>
{
cff.SpetialExitEmulator = 1;
Copy link
Member

Choose a reason for hiding this comment

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

New features should generally be disabled by default; the user may not want the functionality

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I fixed everything

@Goodfeat Goodfeat requested a review from GreemDev January 8, 2025 13:26
Copy link
Contributor Author

@Goodfeat Goodfeat left a comment

Choose a reason for hiding this comment

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

viewed

/// <summary>
/// Allows you to choose from three options: do nothing, exit the application, exit the emulator
/// </summary>
public int specialExitEmulator { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

Please, when adding new properties, follow the style of the items you are adding.
SpecialExitEmulator

@Goodfeat Goodfeat requested a review from GreemDev January 11, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui Affects the Avalonia UI or translations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants