projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
207fb81
)
moved code to get rank string for hall of fame to separate function
author
Holger Schemel
<info@artsoft.org>
Thu, 24 Feb 2022 00:47:13 +0000
(
01:47
+0100)
committer
Holger Schemel
<info@artsoft.org>
Thu, 24 Feb 2022 00:47:13 +0000
(
01:47
+0100)
src/screens.c
patch
|
blob
|
history
diff --git
a/src/screens.c
b/src/screens.c
index ecb67db2b374100792726873e3589d7d7b94475b..8e95e47beb1e93aa44d6c024e330312f128cc88f 100644
(file)
--- a/
src/screens.c
+++ b/
src/screens.c
@@
-296,6
+296,7
@@
static void execOfferUploadTapes(void);
static void DrawHallOfFame_setScoreEntries(void);
static void HandleHallOfFame_SelectLevel(int, int);
static void DrawHallOfFame_setScoreEntries(void);
static void HandleHallOfFame_SelectLevel(int, int);
+static char *getHallOfFameRankText(int);
static char *getHallOfFameScoreText(int);
static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
static char *getHallOfFameScoreText(int);
static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS];
@@
-4943,8
+4944,7
@@
static void drawChooseTreeText(TreeInfo *ti, int y, boolean active)
int startx3 = startx + dx3;
int startx4 = startx + dx4;
int pos = node->pos;
int startx3 = startx + dx3;
int startx4 = startx + dx4;
int pos = node->pos;
- boolean forced = (scores.force_last_added && pos == scores.last_added);
- char *pos_text = (forced ? "???" : int2str(pos + 1, 3));
+ char *pos_text = getHallOfFameRankText(pos);
char *dot_text = ".";
int i;
char *dot_text = ".";
int i;
@@
-5783,6
+5783,13
@@
void DrawHallOfFame(int level_nr)
DrawChooseTree(&score_entry_current);
}
DrawChooseTree(&score_entry_current);
}
+static char *getHallOfFameRankText(int nr)
+{
+ boolean forced = (scores.force_last_added && nr == scores.last_added);
+
+ return (forced ? "???" : int2str(nr + 1, 3));
+}
+
static char *getHallOfFameTimeText(int nr)
{
static char score_text[10];
static char *getHallOfFameTimeText(int nr)
{
static char score_text[10];
@@
-5851,8
+5858,7
@@
void HandleHallOfFame(int mx, int my, int dx, int dy, int button)
static void DrawScoreInfo(int entry_nr)
{
struct ScoreEntry *entry = &scores.entry[entry_nr];
static void DrawScoreInfo(int entry_nr)
{
struct ScoreEntry *entry = &scores.entry[entry_nr];
- boolean forced = (scores.force_last_added && entry_nr == scores.last_added);
- char *pos_text = (forced ? "???" : int2str(entry_nr + 1, 3));
+ char *pos_text = getHallOfFameRankText(entry_nr);
int font_title = MENU_INFO_FONT_TITLE;
int font_head = MENU_INFO_FONT_HEAD;
int font_text = MENU_INFO_FONT_TEXT;
int font_title = MENU_INFO_FONT_TITLE;
int font_head = MENU_INFO_FONT_HEAD;
int font_text = MENU_INFO_FONT_TEXT;