Skip to content

Commit

Permalink
Merge branch 'how-to-play'
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Nov 28, 2024
2 parents 123530c + 0ceedc4 commit 4b7b99b
Show file tree
Hide file tree
Showing 34 changed files with 3,441 additions and 32 deletions.
2,086 changes: 2,086 additions & 0 deletions assets/CREDITS_PSP.md

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions assets/images/keyboard_arrows.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/keyboard_backspace.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/keyboard_escape.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/keyboard_space.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/mouse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/mouse_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/mouse_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/mouse_scroll.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/steam_button_start_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/switch_buttons_down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/switch_buttons_left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/switch_buttons_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions assets/images/switch_buttons_up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/switch_dpad.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions assets/images/switch_stick_l.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions src/ButtonImage.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef BUTTONIMAGE_HPP
#define BUTTONIMAGE_HPP

enum class ButtonImage {
KEYBOARD_MOVEMENT,
KEYBOARD_CONFIRM,
KEYBOARD_CANCEL,
KEYBOARD_MENU,

MOUSE_MOVEMENT,
MOUSE_CONFIRM,
MOUSE_CANCEL,
MOUSE_MENU,

GAMEPAD_MOVEMENT1,
GAMEPAD_MOVEMENT2,
GAMEPAD_CONFIRM,
GAMEPAD_CANCEL,
GAMEPAD_MENU,

AMOUNT
};

#endif // BUTTONIMAGE_HPP
3 changes: 3 additions & 0 deletions src/EventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ Event EventManager::getEventFromMouseButton(Uint8 button) {
case SDL_BUTTON_RIGHT:
event = Event::CANCEL;
break;
case SDL_BUTTON_MIDDLE:
event = Event::MENU;
break;
default:
event = Event::OTHER;
break;
Expand Down
22 changes: 10 additions & 12 deletions src/OptionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,15 @@ void OptionManager::setFullscreen(bool value) {
write();
}

bool OptionManager::getHowToPlaySeen() {
return this->options.get("how_to_play_seen", false).asBool();
}

void OptionManager::setHowToPlaySeen(bool value) {
this->options["how_to_play_seen"] = value;
write();
}

int OptionManager::getScreenWidth() {
int result = this->options.get("screen_width", 0).asInt();
if (result == 0) {
Expand All @@ -241,11 +250,7 @@ int OptionManager::getScreenHeight() {
return result;
}

int OptionManager::getScreenRefreshRate() {
return this->options.get("screen_refresh_rate", 0).asInt();
}

void OptionManager::setScreenResolution(int width, int height, int refresh_rate) {
void OptionManager::setScreenResolution(int width, int height) {
int new_shell_size = DEFAULT_SHELL_SIZE;
while (width < (new_shell_size * DEFAULT_BOARD_WIDTH) || height < (new_shell_size * (DEFAULT_BOARD_HEIGHT +1))) {
new_shell_size = new_shell_size/2;
Expand All @@ -262,17 +267,10 @@ void OptionManager::setScreenResolution(int width, int height, int refresh_rate)

this->options["screen_width"] = width;
this->options["screen_height"] = height;
this->options["screen_refresh_rate"] = refresh_rate;

write();
}

int OptionManager::getShellSize() {
return this->options.get("shell_size", DEFAULT_SHELL_SIZE).asInt();
}

bool OptionManager::getShellSizeChanged() {
bool current_shell_size_changed = this->shell_size_changed;
this->shell_size_changed = false;
return current_shell_size_changed;
}
Loading

0 comments on commit 4b7b99b

Please sign in to comment.