1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Mute Button Implemented like in RCT1

Added the Mute button, like requested in the Issue #1421.
This commit is contained in:
Pulkit
2017-04-18 16:33:41 -04:00
committed by Ted John
parent 1ab90d86ca
commit ffa3896b24
3 changed files with 23 additions and 1 deletions

View File

@@ -4364,6 +4364,7 @@ STR_6052 :The heightmap is too big, and will be cut off
STR_6053 :The heightmap cannot be normalised
STR_6054 :Only 24-bit bitmaps are supported
STR_6055 :OpenRCT2 Heightmap File
STR_6056 :{SMALLFONT}{BLACK}Mute
#############
# Scenarios #

View File

@@ -3715,6 +3715,8 @@ enum {
STR_ERROR_24_BIT_BITMAP = 6054,
STR_OPENRCT2_HEIGHTMAP_FILE = 6055,
STR_SHOW_MUTE = 6056,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};

View File

@@ -47,6 +47,7 @@ enum {
WIDX_ROTATE,
WIDX_VIEW_MENU,
WIDX_MAP,
WIDX_MUTE,
WIDX_LAND,
WIDX_WATER,
@@ -155,6 +156,7 @@ static const sint32 left_aligned_widgets_order[] = {
WIDX_ROTATE,
WIDX_VIEW_MENU,
WIDX_MAP,
WIDX_MUTE,
};
// from right to left
@@ -187,7 +189,7 @@ static rct_widget window_top_toolbar_widgets[] = {
{ WWT_TRNBTN, 1, 0x0082 + 30, 0x009F + 30, 0, 27, 0x20000000 | SPR_TOOLBAR_ROTATE, STR_ROTATE_TIP }, // Rotate camera
{ WWT_TRNBTN, 1, 0x00A0 + 30, 0x00BD + 30, 0, 27, 0x20000000 | SPR_TOOLBAR_VIEW, STR_VIEW_OPTIONS_TIP }, // Transparency menu
{ WWT_TRNBTN, 1, 0x00BE + 30, 0x00DB + 30, 0, 27, 0x20000000 | SPR_TOOLBAR_MAP, STR_SHOW_MAP_TIP }, // Map
{ WWT_TRNBTN, 1, 0x00DC + 30, 0x00F9 + 30, 0, 27, 0x20000000 | SPR_TAB_TOOLBAR, STR_SHOW_MUTE }, // Mute
{ WWT_TRNBTN, 2, 0x010B, 0x0128, 0, 27, 0x20000000 | SPR_TOOLBAR_LAND, STR_ADJUST_LAND_TIP }, // Land
{ WWT_TRNBTN, 2, 0x0129, 0x0146, 0, 27, 0x20000000 | SPR_TOOLBAR_WATER, STR_ADJUST_WATER_TIP }, // Water
{ WWT_TRNBTN, 2, 0x0147, 0x0164, 0, 27, 0x20000000 | SPR_TOOLBAR_SCENERY, STR_PLACE_SCENERY_TIP }, // Scenery
@@ -361,6 +363,12 @@ static void window_top_toolbar_mouseup(rct_window *w, sint32 widgetIndex)
case WIDX_NEWS:
window_news_open();
break;
case WIDX_MUTE:
if(gGameSoundsOff)
audio_unpause_sounds();
else
audio_pause_sounds();
break;
}
}
@@ -648,6 +656,7 @@ static void window_top_toolbar_invalidate(rct_window *w)
window_top_toolbar_widgets[WIDX_ROTATE].type = WWT_TRNBTN;
window_top_toolbar_widgets[WIDX_VIEW_MENU].type = WWT_TRNBTN;
window_top_toolbar_widgets[WIDX_MAP].type = WWT_TRNBTN;
window_top_toolbar_widgets[WIDX_MUTE].type = WWT_TRNBTN;
window_top_toolbar_widgets[WIDX_LAND].type = WWT_TRNBTN;
window_top_toolbar_widgets[WIDX_WATER].type = WWT_TRNBTN;
window_top_toolbar_widgets[WIDX_SCENERY].type = WWT_TRNBTN;
@@ -668,6 +677,7 @@ static void window_top_toolbar_invalidate(rct_window *w)
if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) {
window_top_toolbar_widgets[WIDX_PAUSE].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_MUTE].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_RIDES].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_PARK].type = WWT_EMPTY;
window_top_toolbar_widgets[WIDX_STAFF].type = WWT_EMPTY;
@@ -830,6 +840,15 @@ static void window_top_toolbar_paint(rct_window *w, rct_drawpixelinfo *dpi)
}
}
//Draw Mute Button
if (window_top_toolbar_widgets[WIDX_FASTFORWARD].type != WWT_EMPTY) {
x = w->x + window_top_toolbar_widgets[WIDX_MUTE].left + 0;
y = w->y + window_top_toolbar_widgets[WIDX_MUTE].top + 0;
if (widget_is_pressed(w, WIDX_MUTE))
y++;
imgId = SPR_TAB_MUSIC_0;
gfx_draw_sprite(dpi, imgId, x, y, 0);
}
// Draw cheats button
if (window_top_toolbar_widgets[WIDX_CHEATS].type != WWT_EMPTY) {
x = w->x + window_top_toolbar_widgets[WIDX_CHEATS].left - 1;