1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-31 10:45:16 +01:00

Change map toolbar icon with current rotation (#9154)

This commit is contained in:
Aaron van Geffen
2019-05-02 00:07:20 +02:00
committed by GitHub
parent 181a722c3b
commit df42cfe1e1
12 changed files with 49 additions and 1 deletions

View File

@@ -849,6 +849,20 @@ static void window_top_toolbar_invalidate(rct_window* w)
else
window_top_toolbar_widgets[WIDX_MUTE].image = IMAGE_TYPE_REMAP | SPR_G2_TOOLBAR_UNMUTE;
// Set map button to the right image.
if (window_top_toolbar_widgets[WIDX_MAP].type != WWT_EMPTY)
{
static constexpr uint32_t imageIdByRotation[] = {
SPR_G2_MAP_NORTH,
SPR_G2_MAP_WEST,
SPR_G2_MAP_SOUTH,
SPR_G2_MAP_EAST,
};
uint32_t mapImageId = imageIdByRotation[get_current_rotation()];
window_top_toolbar_widgets[WIDX_MAP].image = IMAGE_TYPE_REMAP | mapImageId;
}
// Zoomed out/in disable. Not sure where this code is in the original.
if (window_get_main()->viewport->zoom == 0)
{

View File

@@ -829,7 +829,16 @@ enum
SPR_G2_EYEDROPPER = SPR_G2_BEGIN + 112,
SPR_G2_CHAT = SPR_G2_BEGIN + 113,
SPR_G2_CHAR_BEGIN = SPR_G2_BEGIN + 114,
SPR_G2_MAP_NORTH = SPR_G2_BEGIN + 114,
SPR_G2_MAP_NORTH_PRESSED = SPR_G2_BEGIN + 115,
SPR_G2_MAP_WEST = SPR_G2_BEGIN + 116,
SPR_G2_MAP_WEST_PRESSED = SPR_G2_BEGIN + 117,
SPR_G2_MAP_SOUTH = SPR_G2_BEGIN + 118,
SPR_G2_MAP_SOUTH_PRESSED = SPR_G2_BEGIN + 119,
SPR_G2_MAP_EAST = SPR_G2_BEGIN + 120,
SPR_G2_MAP_EAST_PRESSED = SPR_G2_BEGIN + 121,
SPR_G2_CHAR_BEGIN = SPR_G2_BEGIN + 122,
SPR_G2_AE_UPPER = SPR_G2_CHAR_BEGIN,
SPR_G2_AE_LOWER = SPR_G2_CHAR_BEGIN + 1,