From: Holger Schemel Date: Fri, 7 Mar 2014 10:02:33 +0000 (+0100) Subject: rnd-20140307-2-src X-Git-Tag: 4.0.0.0-rc1~379 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=d41504f21368105b5818ccee3b33d5acd739aa6c rnd-20140307-2-src --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 82f508fd..a2406193 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -6023,8 +6023,6 @@ struct ConfigInfo image_config[] = { "main.input.name.valign", "top" }, { "main.input.name.font", "font.input_1" }, - { "main.show_game_buttons", "false" }, - { "preview.x", "272" }, { "preview.y", "380" }, { "preview.align", "center" }, @@ -7081,6 +7079,8 @@ struct ConfigInfo image_config[] = { "tape.text.time.digits", "-1" }, { "tape.text.time.font", "font.tape_recorder" }, + { "tape.show_game_buttons", "false" }, + { "editor.palette.x", "5" }, { "editor.palette.y", "30" }, { "editor.palette.cols", "4" }, diff --git a/src/conf_var.c b/src/conf_var.c index 73f11967..03ab11dd 100644 --- a/src/conf_var.c +++ b/src/conf_var.c @@ -2044,10 +2044,6 @@ struct TokenIntPtrInfo image_config_vars[] = "main.input.name.font", &menu.main.input.name.font }, - { - "main.show_game_buttons", - &menu.main.show_game_buttons - }, { "preview.x", &preview.x @@ -6088,6 +6084,10 @@ struct TokenIntPtrInfo image_config_vars[] = "tape.text.time.font", &tape.text.time.font }, + { + "tape.show_game_buttons", + &tape.show_game_buttons + }, { "editor.palette.x", &editor.palette.x diff --git a/src/conftime.h b/src/conftime.h index 45332a0a..725b3fdc 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2014-03-07 01:21" +#define COMPILE_DATE_STRING "2014-03-07 10:48" diff --git a/src/game.c b/src/game.c index 11a6fed8..1a201dc1 100644 --- a/src/game.c +++ b/src/game.c @@ -16831,6 +16831,8 @@ void CreateGameButtons() int button_type; boolean checked; unsigned int event_mask; + int base_x = (tape.show_game_buttons ? VX : DX); + int base_y = (tape.show_game_buttons ? VY : DY); int gd_x = gfx->src_x; int gd_y = gfx->src_y; int gd_xp = gfx->src_x + gfx->pressed_xoffset; @@ -16870,8 +16872,8 @@ void CreateGameButtons() gi = CreateGadget(GDI_CUSTOM_ID, id, GDI_INFO_TEXT, gamebutton_info[i].infotext, - GDI_X, DX + GDI_ACTIVE_POS(pos->x), - GDI_Y, DY + GDI_ACTIVE_POS(pos->y), + GDI_X, base_x + GDI_ACTIVE_POS(pos->x), + GDI_Y, base_y + GDI_ACTIVE_POS(pos->y), GDI_WIDTH, gfx->width, GDI_HEIGHT, gfx->height, GDI_TYPE, button_type, @@ -16927,12 +16929,19 @@ void RedrawGameButtons() static void HandleGameButtonsExt(int id) { - if (game_status != GAME_MODE_PLAYING) + boolean handle_game_buttons = + (game_status == GAME_MODE_PLAYING || + (game_status == GAME_MODE_MAIN && tape.show_game_buttons)); + + if (!handle_game_buttons) return; switch (id) { case GAME_CTRL_ID_STOP: + if (game_status == GAME_MODE_MAIN) + break; + if (tape.playing) TapeStop(); else @@ -16940,7 +16949,7 @@ static void HandleGameButtonsExt(int id) break; case GAME_CTRL_ID_PAUSE: - if (options.network) + if (options.network && game_status == GAME_MODE_PLAYING) { #if defined(NETWORK_AVALIABLE) if (tape.pausing) @@ -16954,7 +16963,11 @@ static void HandleGameButtonsExt(int id) break; case GAME_CTRL_ID_PLAY: - if (tape.pausing) + if (game_status == GAME_MODE_MAIN) + { + StartGameActions(options.network, setup.autorecord, level.random_seed); + } + else if (tape.pausing) { #if defined(NETWORK_AVALIABLE) if (options.network) diff --git a/src/main.h b/src/main.h index 5653a982..2a335bba 100644 --- a/src/main.h +++ b/src/main.h @@ -2240,8 +2240,6 @@ struct MenuMainInfo struct MenuMainButtonInfo button; struct MenuMainTextInfo text; struct MenuMainInputInfo input; - - boolean show_game_buttons; }; struct TitleFadingInfo diff --git a/src/tape.c b/src/tape.c index cebc9289..782db9be 100644 --- a/src/tape.c +++ b/src/tape.c @@ -1471,6 +1471,9 @@ void MapTapeButtons() if (tape.recording || tape.playing) MapTapeWarpButton(); + + if (tape.show_game_buttons) + MapGameButtons(); } void UnmapTapeButtons() diff --git a/src/tape.h b/src/tape.h index 6a5107cb..f23d7c9a 100644 --- a/src/tape.h +++ b/src/tape.h @@ -178,6 +178,8 @@ struct TapeInfo struct TapeLabelInfo label; struct TapeTextInfo text; + boolean show_game_buttons; /* show game buttons in tape viewport */ + boolean no_valid_file; /* set when tape file missing or invalid */ };