From 162ef18a2613bd7aa6d949a7293a3a6686923de9 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 16 Apr 2022 16:58:48 +0200 Subject: [PATCH 1/5] =?UTF-8?q?Add=20eye=20glyph=20(=F0=9F=91=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/g2/font/eye.png | Bin 0 -> 150 bytes resources/g2/sprites.json | 18 ++++++++++++++++++ src/openrct2/drawing/Font.cpp | 1 + src/openrct2/localisation/FormatCodes.h | 1 + src/openrct2/localisation/Language.h | 1 + src/openrct2/sprites.h | 4 +++- 6 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 resources/g2/font/eye.png diff --git a/resources/g2/font/eye.png b/resources/g2/font/eye.png new file mode 100644 index 0000000000000000000000000000000000000000..ec9be5068a16e439c6c1c67efa7f0f612c34373b GIT binary patch literal 150 zcmeAS@N?(olHy`uVBq!ia0y~yVBlk5VBlh6W?*3WxxGDvfq{W1z$e7@|Ns9T4F8Rd z|Nm#`2w0X<$iTqBSQ6wH%;50sMj8VHgN3JyV@O3@a>54t0|yS&Y;9|7-2TOix%uVI zOUyjmvlk0XylZFT{JeTAuR~`x506i{v4n)g7AXmaw#WPi;o*Bq7#J8BJYD@<);T3K F0RUCIF;4&h literal 0 HcmV?d00001 diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index 7c472f3bac..ee20fa5e9a 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -1127,6 +1127,12 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/eye.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, { "path": "font/latin/ae-uc-bold.png", "y_offset": 0, @@ -1726,6 +1732,12 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/eye.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, { "path": "font/latin/ae-uc-tiny.png", "y_offset": 0, @@ -2332,6 +2344,12 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/eye.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, { "path": "support/flat_to_steep_1_1.png", "x_offset": -32, diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index 604398c0b8..325d7c0442 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -219,6 +219,7 @@ static const std::unordered_map codepointOffsetMap = { // Emoji { UnicodeChar::cross, CSChar::cross - CS_SPRITE_FONT_OFFSET }, { UnicodeChar::water, CSChar::water - CS_SPRITE_FONT_OFFSET }, + { UnicodeChar::eye, SPR_G2_EYE - SPR_CHAR_START }, { UnicodeChar::road, CSChar::road - CS_SPRITE_FONT_OFFSET }, { UnicodeChar::railway, CSChar::railway - CS_SPRITE_FONT_OFFSET }, diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index 7b84e44e21..fe9b9791ad 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -320,6 +320,7 @@ namespace UnicodeChar constexpr char32_t cross = 0x274C; constexpr char32_t variation_selector = 0xFE0F; constexpr char32_t water = 0x1F30A; + constexpr char32_t eye = 0x1F441; constexpr char32_t road = 0x1F6E3; constexpr char32_t railway = 0x1F6E4; diff --git a/src/openrct2/localisation/Language.h b/src/openrct2/localisation/Language.h index d3b9d89bd3..f29eb2911a 100644 --- a/src/openrct2/localisation/Language.h +++ b/src/openrct2/localisation/Language.h @@ -90,6 +90,7 @@ constexpr const char* BlackDownArrowString = u8"{BLACK}▼"; constexpr const char* BlackLeftArrowString = u8"{BLACK}◀"; constexpr const char* BlackRightArrowString = u8"{BLACK}▶"; constexpr const char* CheckBoxMarkString = u8"✓"; +constexpr const char* EyeString = u8"👁"; uint8_t language_get_id_from_locale(const char* locale); const char* language_get_string(rct_string_id id); diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 2fa4f8598e..900efba87a 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -1023,7 +1023,9 @@ enum SPR_G2_RIGHT_BRACE, SPR_G2_TILDE, - SPR_G2_GLYPH_COUNT = (SPR_G2_TILDE - SPR_G2_CHAR_BEGIN) + 1, + SPR_G2_EYE, + + SPR_G2_GLYPH_COUNT = (SPR_G2_EYE - SPR_G2_CHAR_BEGIN) + 1, SPR_G2_CHAR_END = SPR_G2_CHAR_BEGIN + SPR_G2_GLYPH_COUNT * 3, SPR_G2_SUPPORT_BEGIN = SPR_G2_CHAR_END, From 9da63961deb8ca5b2d0b39cf1de7a0a3a2b8b554 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sat, 16 Apr 2022 17:01:43 +0200 Subject: [PATCH 2/5] Use eye glyph instead of checkbox for visibility --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/TileInspector.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e77fc38233..9b42c38377 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#17080] “Remove litter” cheat does not empty litter bins. - Fix: [#17099] Object selection thumbnail box is one pixel too tall. - Improved: [#16978] Tree placement is more natural during map generation. +- Improved: [#16992] The checkbox in the visibility column of the Tile Inspector has been replaced with an eye symbol. - Improved: [#16999] The maximum price for the park entry has been raised to £999. - Improved: [#17050] Transparency can be enabled directly without needing see-through enabled first. - Removed: [#16864] Title sequence editor (replaced by plug-in). diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 916886e296..78e57fb992 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -197,9 +197,9 @@ constexpr auto ToolbarButtonOffsetX = ScreenSize{ -24, 0 }; // List's column offsets constexpr auto InvisibleFlagColumnXY = ScreenCoordsXY{ 3, 42 }; -constexpr auto InvisibleFlagColumnSize = ScreenSize{ 15, 14 }; +constexpr auto InvisibleFlagColumnSize = ScreenSize{ 20, 14 }; constexpr auto TypeColumnXY = InvisibleFlagColumnXY + ScreenSize{ InvisibleFlagColumnSize.width, 0 }; -constexpr auto TypeColumnSize = ScreenSize{ 257, 14 }; +constexpr auto TypeColumnSize = ScreenSize{ 252, 14 }; constexpr auto BaseHeightColumnXY = TypeColumnXY + ScreenSize{ TypeColumnSize.width, 0 }; constexpr auto BaseHeightColumnSize = ScreenSize{ 30, 14 }; constexpr auto ClearanceHeightColumnXY = BaseHeightColumnXY + ScreenCoordsXY{ BaseHeightColumnSize.width, 0 }; @@ -1338,7 +1338,7 @@ static void WindowTileInspectorScrollmousedown(rct_window* w, int32_t scrollInde // Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1; - const ScreenRect checkboxColumnRect{ { 2, 0 }, { 11, screenCoords.y } }; + const ScreenRect checkboxColumnRect{ { 2, 0 }, { 15, screenCoords.y } }; if (index >= 0 && checkboxColumnRect.Contains(screenCoords)) { // Checkbox was clicked WindowTileInspectorToggleInvisibility(index); @@ -2299,10 +2299,13 @@ static void WindowTileInspectorScrollpaint(rct_window* w, rct_drawpixelinfo* dpi checkboxFormatter.Add(CheckBoxMarkString); // Draw checkbox and check if visible - gfx_fill_rect_inset(dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, w->colours[1], INSET_RECT_F_E0); + gfx_fill_rect_inset(dpi, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, w->colours[1], INSET_RECT_F_E0); if (!tileElement->IsInvisible()) { - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 0 }, stringFormat, checkboxFormatter); + auto eyeFormatter = Formatter(); + eyeFormatter.Add(STR_STRING); + eyeFormatter.Add(EyeString); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter); } const auto type = tileElement->GetType(); From 0c34e7b26991131e497c89228951ee46f9ff69eb Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Sun, 17 Apr 2022 11:14:00 +0200 Subject: [PATCH 3/5] Use eye glyph in column header --- data/language/en-GB.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 6910ceefc6..5ba269d179 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3544,7 +3544,7 @@ STR_6434 :Remove all bindings for this shortcut. STR_6435 :{WINDOW_COLOUR_2}Vandals stopped: {BLACK}{COMMA32} STR_6436 :Toggle invisibility STR_6437 :Visible -STR_6438 :V +STR_6438 :{MOVE_X}{2}👁 STR_6439 :Tile Inspector: Toggle invisibility STR_6440 :Transparent water STR_6441 :At least one non-queue footpath surface object must be selected. From 218030dcd91d2c51c6b7bc73db81212915b62a00 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Fri, 22 Apr 2022 19:09:35 +0200 Subject: [PATCH 4/5] Add missing emojis that have inline sprites --- src/openrct2/drawing/Drawing.String.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index e1c7a7ad75..41165d0348 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -800,6 +800,10 @@ static bool ShouldUseSpriteForCodepoint(char32_t codepoint) case UnicodeChar::german_quote_open: case UnicodeChar::plus: case UnicodeChar::minus: + case UnicodeChar::variation_selector: + case UnicodeChar::eye: + case UnicodeChar::road: + case UnicodeChar::railway: return true; default: return false; From b47ec536053fcbb266d2cbf0d95b04597fc28975 Mon Sep 17 00:00:00 2001 From: Hielke Morsink Date: Mon, 2 May 2022 22:35:52 +0200 Subject: [PATCH 5/5] Add tiny eye sprite --- resources/g2/font/eye-tiny.png | Bin 0 -> 130 bytes resources/g2/sprites.json | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 resources/g2/font/eye-tiny.png diff --git a/resources/g2/font/eye-tiny.png b/resources/g2/font/eye-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..eb182fb520a260b70121083c37d3d40d1d9fd75b GIT binary patch literal 130 zcmeAS@N?(olHy`uVBq!ia0y~yU;we%nV1+yd|+T;;0f>vasB`Qe+R>VW8?q- z89D-%r4%wSFff(``2{mLJiC#`z`&s5>Eakt5tp3s@9=>G(&r8&h*dT`eD;-v?eh&b iwsQt-Y|BJ>7*gfg9^7{Kn8Luoz~JfX=d#Wzp$PzEl__oj literal 0 HcmV?d00001 diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index ee20fa5e9a..ca5c1fad5d 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -2345,7 +2345,7 @@ "forceBmp": true }, { - "path": "font/eye.png", + "path": "font/eye-tiny.png", "y_offset": 0, "palette": "keep", "forceBmp": true