Skip to content

Commit

Permalink
Rearrange startup buttons, add tutorial button with stub event
Browse files Browse the repository at this point in the history
Fix #173
  • Loading branch information
NQNStudios authored and CelticMinstrel committed Dec 1, 2024
1 parent 96c71bd commit df3839a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 13 deletions.
10 changes: 8 additions & 2 deletions src/game/boe.actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ void init_screen_locs() {
startup_button[btn].offset(301 * (btn / 3), 48 * (btn % 3));
}
startup_top.top = 7;
startup_top.bottom = startup_button[STARTBTN_LOAD].top;
startup_top.bottom = startup_button[STARTBTN_TUTORIAL].top;
startup_top.left = startup_base.left;
startup_top.right = startup_button[STARTBTN_JOIN].right;
startup_top.right = startup_button[STARTBTN_NEW].right;

// icon, name, use, give, drip, info, sell/id each one 13 down
item_buttons[0][ITEMBTN_ICON].top = 15;
Expand Down Expand Up @@ -3244,6 +3244,12 @@ void start_new_game(bool force) {
univ.file = file;
}

void start_tutorial() {
// Start by using the default party
start_new_game(true);
// TODO start the tutorial scenario, which we need to design.
}

location get_cur_direction(location the_point) {
location store_dir;

Expand Down
1 change: 1 addition & 0 deletions src/game/boe.actions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void handle_new_pc();
void new_party();
void handle_death();
void start_new_game(bool force = false);
void start_tutorial();
location get_cur_direction(location the_point);
bool outd_move_party(location destination,bool forced);
bool town_move_party(location destination,short forced);
Expand Down
15 changes: 9 additions & 6 deletions src/game/boe.consts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,16 @@ enum eTrapType {

// Startup buttons
enum eStartButton {
STARTBTN_LOAD = 0,
STARTBTN_NEW = 1,
STARTBTN_ORDER = 2,
STARTBTN_JOIN = 3,
STARTBTN_CUSTOM = 4,
// Left Column
STARTBTN_TUTORIAL = 0,
STARTBTN_LOAD = 1,
STARTBTN_PREFS = 2,
// Right Column
STARTBTN_NEW = 3,
STARTBTN_JOIN = 4,
STARTBTN_SCROLL = 5,
MAX_eStartButton // keep last
// Keep last:
MAX_eStartButton = 6
};

// Shop rects
Expand Down
11 changes: 8 additions & 3 deletions src/game/boe.graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,14 @@ void draw_startup_stats() {

void draw_start_button(eStartButton which_position,short which_button) {
rectangle from_rect,to_rect;
// TODO: Change third button (Windows calls it "Support and Downloads")
const char *button_labels[] = {"Load Game","Make New Party","Preferences",
"Start Scenario","Custom Scenario","Quit"};
const char *button_labels[MAX_eStartButton];
button_labels[STARTBTN_TUTORIAL] = "Tutorial";
button_labels[STARTBTN_LOAD] = "Load Game";
button_labels[STARTBTN_PREFS] = "Preferences";
button_labels[STARTBTN_NEW] = "Make New Party";
button_labels[STARTBTN_JOIN] = "Start Scenario";
button_labels[STARTBTN_SCROLL] = "";

// The 0..65535 version of the blue component was 14472; the commented version was 43144431
sf::Color base_color = {0,0,57};

Expand Down
6 changes: 4 additions & 2 deletions src/game/boe.startup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ void handle_startup_button_click(eStartButton btn, eKeyMod mods) {
draw_startup(0);
break;

case STARTBTN_ORDER:
case STARTBTN_PREFS:
// pass false so another action is not recorded (the start button action is enough)
pick_preferences(false);
break;

case STARTBTN_CUSTOM: break; // Currently unused
case STARTBTN_TUTORIAL:
start_tutorial();
break;

case STARTBTN_SCROLL: case MAX_eStartButton:
// These aren't buttons
Expand Down

0 comments on commit df3839a

Please sign in to comment.