mirror of
https://github.com/k4zmu2a/SpaceCadetPinball.git
synced 2025-12-16 23:30:59 +01:00
Fixed high score insertion for multiple players.
Refactored high_score. Issue #131.
This commit is contained in:
parent
0f88e43ba2
commit
cc06d35bc7
5 changed files with 102 additions and 102 deletions
|
|
@ -6,24 +6,31 @@ struct high_score_struct
|
|||
int Score;
|
||||
};
|
||||
|
||||
struct high_score_entry
|
||||
{
|
||||
high_score_struct Entry;
|
||||
int Position;
|
||||
};
|
||||
|
||||
|
||||
class high_score
|
||||
{
|
||||
public:
|
||||
static int read(high_score_struct* table);
|
||||
static int write(high_score_struct* table);
|
||||
static void clear_table(high_score_struct* table);
|
||||
static int get_score_position(high_score_struct* table, int score);
|
||||
static int place_new_score_into(high_score_struct* table, int score, LPSTR scoreStr, int position);
|
||||
static high_score_struct highscore_table[5];
|
||||
|
||||
static void show_high_score_dialog(high_score_struct* table);
|
||||
static void show_and_set_high_score_dialog(high_score_struct* table, int score, int pos, LPCSTR defaultName);
|
||||
static int read();
|
||||
static int write();
|
||||
static int get_score_position(int score);
|
||||
|
||||
static void show_high_score_dialog();
|
||||
static void show_and_set_high_score_dialog(high_score_entry score);
|
||||
static void RenderHighScoreDialog();
|
||||
private :
|
||||
static int dlg_enter_name;
|
||||
static int dlg_score;
|
||||
static int dlg_position;
|
||||
static char default_name[32];
|
||||
static high_score_struct* dlg_hst;
|
||||
private:
|
||||
static bool dlg_enter_name;
|
||||
static high_score_entry DlgData;
|
||||
static bool ShowDialog;
|
||||
static std::vector<high_score_entry> ScoreQueue;
|
||||
|
||||
static void clear_table();
|
||||
static void place_new_score_into(high_score_entry data);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue