Skip to content

Commit

Permalink
Merge pull request #71 from savaughn/main-menu-clean-up
Browse files Browse the repository at this point in the history
Main menu clean up
  • Loading branch information
savaughn authored Nov 2, 2023
2 parents 3f21701 + 93674c4 commit 882b0f4
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 173 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ obj/
*.DS_Store
src/pokeromtrader

tests/*

settings.json
1 change: 1 addition & 0 deletions include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ enum E_LOG_MESSAGE_TYPE
};

enum textures {
T_NONE = -1,
T_EVOLVE,
T_LOGO,
T_QUIT,
Expand Down
9 changes: 8 additions & 1 deletion src/chelper.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#include <string.h>
#include "chelper.h"

void set_default_value_string(const char *eval_str, const char *default_value, char *out_str) {
if (eval_str == NULL) {
// If eval_str is NULL, set out_str to the default_value
// Default value is too big for the output buffer
if (default_value != NULL && strlen(default_value) + 1 > sizeof(out_str)) {
return;
}
strcpy(out_str, default_value);
} else {
// Otherwise, copy eval_str to out_str
if (strlen(eval_str) + 1 >sizeof(out_str)) {
return;
}
strcpy(out_str, eval_str);
}
}
3 changes: 1 addition & 2 deletions src/components/MenuButton.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ bool draw_menu_button(int x, int y, const char *text, int text_size)
else
{
DrawText(text, x + 10, y + 5, text_size, BLACK);
return false;
}

return false;
}
4 changes: 0 additions & 4 deletions src/raylibhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,15 +299,11 @@ void draw_raylib_screen_loop(
draw_evolve(pkmn_save_player1, player1_save_path, trainer1, &current_screen);
break;
case SCREEN_ABOUT:
{
draw_about(&current_screen, is_build_prerelease);
break;
}
case SCREEN_LEGAL:
{
draw_legal(&current_screen);
break;
}
default:
BeginDrawing();
ClearBackground(BACKGROUND_COLOR);
Expand Down
Loading

0 comments on commit 882b0f4

Please sign in to comment.