44 #define NUM_PLAYER_SELECT_BUTTONS 8 // button control defines
46 #define CREATE_PILOT_BUTTON 0 //
47 #define CLONE_BUTTON 1 //
48 #define DELETE_BUTTON 2 //
49 #define SCROLL_LIST_UP_BUTTON 3 //
50 #define SCROLL_LIST_DOWN_BUTTON 4 //
51 #define ACCEPT_BUTTON 5 //
52 #define SINGLE_BUTTON 6 //
53 #define MULTI_BUTTON 7 //
75 #define PLAYER_SELECT_MAIN_HALL_OVERLAY NOX("MainHall1") // main hall help overlay
84 barracks_buttons(
char *
name,
int x1,
int y1,
int xt1,
int yt1,
int h) : filename(name), x(x1), y(y1), xt(xt1), yt(yt1), hotspot(h) {}
121 #define PLAYER_SELECT_NUM_TEXT 1
162 static int Player_select_no_save_pilot = 0;
220 if (
Pilot.
verify(filename.c_str(), NULL, pilot_lang)) {
221 if (!strcmp(current_lang, pilot_lang)) {
265 b->
button.
create(&Player_select_window, NULL, b->
x, b->
y, 60, 30, 1, 1);
293 Player_select_list_region.
hide();
298 Player_select_input_box.
hide();
299 Player_select_input_box.
disable();
345 static bool Startup_warning_dialog_displayed =
false;
354 sprintf(text,
"Warning!\n\nThe currently active mod has generated %d warnings and/or errors during program startup. These could have been caused by anything from incorrectly formated table files to corrupt models. While FreeSpace Open will attempt to compensate for these issues, it cannot guarantee a trouble-free gameplay experience. Source Code Project staff cannot provide assistance or support for these problems, as they are caused by the mod's data files, not FreeSpace Open's source code.",
Global_warning_count +
Global_error_count);
356 Startup_warning_dialog_displayed =
true;
365 k = Player_select_window.
process();
403 Player_select_no_save_pilot = 1;
421 Player_select_window.
draw();
451 Player_select_window.
destroy();
459 if (Player_select_no_save_pilot) {
466 nprintf((
"General",
"WARNING! No pilot selected! We should be exiting the game now!\n"));
534 Player_select_input_box.
enable();
535 Player_select_input_box.
unhide();
537 Player_select_input_box.
hide();
538 Player_select_input_box.
disable();
568 "Selected pilot was created with a different language\n"
569 "to the currently active language.\n\n"
570 "Please select a different pilot or change the language", 1637));
648 "Deleting a multi-player pilot will also delete all single-player data for that pilot.\n\nAs a safety precaution, pilots can only be "
649 "deleted from the single-player menu.", 1610));
715 int play_scroll_sound = 1;
717 if ( play_scroll_sound ) {
742 Player_select_input_box.
set_text(
"");
771 Player_select_num_pilots--;
772 if (Player_select_pilot >= Player_select_num_pilots) {
773 Player_select_pilot = Player_select_num_pilots - 1;
821 if (last_player == NULL) {
867 Player_select_num_pilots = 0;
901 if (i != Player_select_num_pilots) {
902 for (j = i; j > 0; --j) {
985 if (Player_select_list_region.
pressed()) {
1023 Player_select_input_box.
get_text(buf);
1026 if (!isalpha(*buf)) {
1029 for (idx=1; buf[
idx]; idx++) {
1030 if (!isalpha(buf[idx]) && !isdigit(buf[idx]) && !strchr(
VALID_PILOT_CHARS, buf[idx])) {
1055 if (!*buf || (idx < Player_select_num_pilots)) {
1123 char Copyright_msg1[256], Copyright_msg2[256];
1250 DCF(bastion,
"Sets the player to be on the bastion (or any other main hall)")
1255 dc_printf(
"This command can only be run while in the initial player select screen.\n");
1261 dc_printf(
" [index] -- optional main hall index; if not supplied, defaults to 1\n");
1273 dc_printf(
"Main hall index out of range\n");
1283 dc_printf(
"Player is now on the Bastion... hopefully\n");
1287 #define MAX_PLAYER_TIPS 40
1296 Num_player_tips = 0;
1314 mprintf((
"TABLES: Unable to parse '%s'! Error message = %s.\n",
"tips.tbl", e.what()));
1325 if (Player_tips[i] != NULL) {
1327 Player_tips[
i] = NULL;
1341 if(Player_tips_shown == 1) {
1344 Player_tips_shown = 1;
1352 sprintf(all_txt,
XSTR(
"NEW USER TIP\n\n%s", 1565), Player_tips[tip]);
1359 if(tip >= Num_player_tips - 1) {
void set_text(const char *in)
void set_highlight_action(void(*_user_function)(void))
void add_XSTR(char *string, int _xstr_id, int _x, int _y, UI_GADGET *_assoc, int _color_type, int _font_id=-1)
#define UI_INPUTBOX_FLAG_LETTER_FIRST
#define VALID_PILOT_CHARS
GLfloat GLfloat GLfloat GLfloat h
float frand_range(float min, float max)
Return a floating point number in the range min..max.
void init_new_pilot(player *p, int reset)
char * stuff_and_malloc_string(int type, char *terminators)
int gameseq_get_state(void)
bool dc_maybe_stuff_int(int *i)
Tries to stuff an int from the Command_string.
#define GR_NUM_RESOLUTIONS
__inline void gr_string(int x, int y, const char *string, int resize_mode=GR_RESIZE_FULL)
general failure sound for any event
char * drop_white_space(char *str)
void main_hall_start_ambient()
#define GR_MAYBE_CLEAR_RES(bmap)
const char * os_config_read_string(const char *section, const char *name, const char *default_value)
void gr_set_color_fast(color *dst)
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
void gr_set_bitmap(int bitmap_num, int alphablend_mode, int bitblt_mode, float alpha)
GLenum GLuint GLenum GLsizei const GLchar * buf
bool verify(const char *fname, int *rank=NULL, char *valid_language=NULL)
int bm_release(int handle, int clear_render_targets)
Frees both a bitmap's data and it's associated slot.
char callsign[CALLSIGN_LEN+1]
SCP_vector< SCP_vector< main_hall_defines > > Main_hall_defines
#define DCF(function_name, help_text)
The potent DCF macro, used to define new debug commands for the console.
int cf_get_file_list_preallocated(int max, char arr[][MAX_FILENAME_LEN], char **list, int type, const char *filter, int sort=CF_SORT_NONE, file_list_info *info=NULL)
void draw_forced(int frame_num)
player Players[MAX_PLAYERS]
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void set_mask_bmap(char *fname)
int set_bmaps(char *ani_filename, int nframes=3, int start_frame=1)
char current_campaign[MAX_FILENAME_LEN+1]
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
void get_version_string()
int required_string(const char *pstr)
int optional_string(const char *pstr)
bool dc_optional_string_either(const char *str1, const char *str2)
Searches for an optional string and it's alias.
void read_file_text(const char *filename, int mode, char *processed_text, char *raw_text)
bool save_player(player *_p=NULL)
void main_hall_get_name(SCP_string &name, unsigned int index)
const char * XSTR(const char *str, int index)
user_click (mouse selects a control)
void _cdecl void void _cdecl Error(const char *filename, int line, SCP_FORMAT_STRING const char *format,...) SCP_FORMAT_STRING_ARGS(3
int pilot_verify_overwrite()
void set_hotkey(int keycode)
void reset_parse(char *text)
GLuint const GLchar * name
int bm_load(const char *real_filename)
Loads a bitmap so we can draw with it later.
GLboolean GLboolean GLboolean b
void update_dimensions(int _x, int _y, int _w, int _h)
bool load_savefile(const char *campaign)
scroll pressed (and scroll)
void link_hotspot(int num)
void create(UI_WINDOW *wnd, char *_text, int _x, int _y, int _w, int _h, int do_repeat=0, int ignore_focus=0)
#define UI_XSTR_COLOR_PINK
bool load_player(const char *callsign, player *_p=NULL)
void create(int _x, int _y, int _w, int _h, int _flags, int _f_id=-1)
void gr_get_string_size(int *w, int *h, const char *text, int len=9999)
#define PLAYER_FLAGS_STRUCTURE_IN_USE
An overhauled/updated debug console to allow monitoring, testing, and general debugging of new featur...
#define LCL_LANG_NAME_LEN
void common_play_highlight_sound()
void create(UI_WINDOW *wnd, int _x, int _y, int _w, int _textlen, char *_text, int _flags=0, int pixel_lim=-1, color *clr=NULL)
void get_mouse_pos(int *xx, int *yy)
#define UI_INPUTBOX_FLAG_INVIS
void game_feature_disabled_popup()
void gr_bitmap(int _x, int _y, int resize_mode)
#define UI_XSTR_COLOR_GREEN
void set_valid_chars(char *vchars)
#define PLAYER_FLAGS_IS_MULTI
int Cmdline_use_last_pilot
void gamesnd_play_iface(int n)
void _cdecl void void _cdecl void _cdecl void _cdecl void _cdecl int Global_warning_count
#define STATS_FLAG_MULTIPLAYER
int process(int key_in=-1, int process_mouse=1)
void _cdecl gr_printf_menu(int x, int y, const char *format,...)
void gameseq_post_event(int event)
void main_hall_init(const SCP_string &main_hall_name)
#define UI_INPUTBOX_FLAG_KEYTHRU
multi_global_options Multi_options_g
void game_process_cheats(int k)
void lcl_get_language_name(char *lang_name)
bool Cmdline_benchmark_mode
int(* Get_file_list_filter)(const char *filename)