Skip to content

Commit

Permalink
Merge pull request #106 from savaughn/app-support
Browse files Browse the repository at this point in the history
moved macos app data to App Support folder
  • Loading branch information
savaughn authored Nov 21, 2023
2 parents 268810c + 09067fc commit b0ee300
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ https://discord.gg/JUzzegS3AP
| Windows | ✅ | \<UserProfile\>\\Documents\\PokeromTrader\\saves
| Linux amd64 | ✅ |~/.pokeromtrader/saves
| Linux arm64 | ✅ |~/.pokeromtrader/saves
| MacOS x86_64 | ✅ |~/Library/PokeromTrader/saves
| MacOS arm64 | ✅ |~/Library/PokeromTrader/saves
| MacOS x86_64 | ✅ |~/Library/Application Support/PokeromTrader/saves
| MacOS arm64 | ✅ |~/Library/Application Support/PokeromTrader/saves
| iOS ||
| Android ||

Expand Down
2 changes: 1 addition & 1 deletion src/filehelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif

#ifdef __APPLE__
#define USR_DATA_DIR "/Library/PokeromTrader"
#define USR_DATA_DIR "/Library/Application Support/PokeromTrader"
#elif _WIN32
#define USR_DATA_DIR "\\Documents\\PokeromTrader"
#else
Expand Down
7 changes: 4 additions & 3 deletions src/screens/ChangeDirScreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void draw_change_dir(struct save_file_data *save_file_data, GameScreen *current_
};
static int selected_index = SCREEN_BUTTON_NONE;
const Rectangle input_box_rec = (Rectangle){50, SCREEN_HEIGHT / 2 +5, SCREEN_WIDTH - 100, 40};
const uint8_t input_text_size = 15;

text_size = strlen(input_text);
strcpy(input_text_backup, (char *)save_file_data->save_dir);
Expand Down Expand Up @@ -86,7 +87,7 @@ void draw_change_dir(struct save_file_data *save_file_data, GameScreen *current_
DrawRectangleLinesEx(input_box_rec, 2, editing_text ? BLACK : DARKGRAY);

// Draw the text inside the input box
DrawText(input_text, input_box_rec.x + 10, input_box_rec.y + 10, 20, BLACK);
DrawText(input_text, input_box_rec.x + 10, input_box_rec.y + 12, input_text_size, BLACK);

Rectangle clear_button_rec = (Rectangle){SCREEN_WIDTH - MeasureText("Clear input", 20) + 10 - 70, input_box_rec.y + 25 + input_box_rec.height - 5, MeasureText("Clear input", 20) + 10, 30};
DrawRectangleRec(clear_button_rec, selected_index == SCREEN_BUTTON_CLEAR ? LIGHTGRAY : RED);
Expand All @@ -95,8 +96,8 @@ void draw_change_dir(struct save_file_data *save_file_data, GameScreen *current_
// Draw the cursor
if (editing_text)
{
DrawLine(input_box_rec.x + 12 + MeasureText(input_text, 20), input_box_rec.y + 10,
input_box_rec.x + 12 + MeasureText(input_text, 20), input_box_rec.y + 30, BLACK);
DrawLine(input_box_rec.x + 12 + MeasureText(input_text, input_text_size), input_box_rec.y + 10,
input_box_rec.x + 12 + MeasureText(input_text, input_text_size), input_box_rec.y + 30, BLACK);
}

// Draw the save button
Expand Down

0 comments on commit b0ee300

Please sign in to comment.