1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

Add theme support for console background colour.

This commit is contained in:
Aaron van Geffen
2017-10-18 08:58:07 +02:00
committed by Michael Steenbeek
parent a0fb2a6d7c
commit 9f67fafc43
6 changed files with 23 additions and 7 deletions

View File

@@ -4465,6 +4465,7 @@ STR_6153 :Pay to enter park / Pay per ride
STR_6154 :It is not recommended to run OpenRCT2 with elevated permissions.
STR_6155 :Neither KDialog nor Zenity are installed. Please install one, or configure from the command line.
STR_6156 :Name is reserved
STR_6157 :Console
#############
# Scenarios #

View File

@@ -244,6 +244,7 @@ static rct_windowclass window_themes_tab_6_classes[] = {
WC_MULTIPLAYER,
WC_PLAYER,
WC_CHAT,
WC_CONSOLE,
};
static rct_windowclass window_themes_tab_7_classes[] = {

View File

@@ -173,6 +173,7 @@ static const WindowThemeDesc WindowThemeDescriptors[] =
{ THEME_WC(WC_NETWORK_STATUS), STR_THEMES_WINDOW_NETWORK_STATUS, COLOURS_1(COLOUR_LIGHT_BLUE ) },
{ THEME_WC(WC_SERVER_LIST), STR_SERVER_LIST, COLOURS_2(COLOUR_LIGHT_BLUE, COLOUR_LIGHT_BLUE ) },
{ THEME_WC(WC_CHAT), STR_CHAT, COLOURS_1(TRANSLUCENT(COLOUR_GREY) ) },
{ THEME_WC(WC_CONSOLE), STR_CONSOLE, COLOURS_1(TRANSLUCENT(COLOUR_LIGHT_BLUE) ) },
};
#pragma endregion

View File

@@ -22,6 +22,7 @@
#include "../Editor.h"
#include "../game.h"
#include "../input.h"
#include "../interface/themes.h"
#include "../localisation/localisation.h"
#include "../localisation/user.h"
#include "../management/Finance.h"
@@ -176,9 +177,13 @@ void console_draw(rct_drawpixelinfo *dpi)
lines++;
}
// Background
console_invalidate();
gfx_filter_rect(dpi, _consoleLeft, _consoleTop, _consoleRight, _consoleBottom, PALETTE_TRANSLUCENT_LIGHT_BLUE_HIGHLIGHT);
// Paint background colour.
uint8 backgroundColour = theme_get_colour(WC_CONSOLE, 0);
gfx_filter_rect(dpi, _consoleLeft, _consoleTop, _consoleRight, _consoleBottom, PALETTE_51);
gfx_fill_rect_inset(dpi, _consoleLeft, _consoleTop, _consoleRight, _consoleBottom, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
gfx_fill_rect_inset(dpi, _consoleLeft + 1, _consoleTop + 1, _consoleRight - 1, _consoleBottom - 1, backgroundColour, INSET_RECT_FLAG_BORDER_INSET);
sint32 x = _consoleLeft + 4;
sint32 y = _consoleTop + 4;
@@ -247,16 +252,21 @@ void console_draw(rct_drawpixelinfo *dpi)
sint32 caretX = x + gfx_get_string_width(lineBuffer);
sint32 caretY = y + lineHeight;
gfx_fill_rect(dpi, caretX, caretY, caretX + 6, caretY + 1, PALETTE_INDEX_144);
uint8 caretColour = ColourMapA[BASE_COLOUR(backgroundColour)].dark;
gfx_fill_rect(dpi, caretX, caretY, caretX + 6, caretY + 1, caretColour);
}
// What about border colours?
uint8 borderColour1 = ColourMapA[BASE_COLOUR(backgroundColour)].light;
uint8 borderColour2 = ColourMapA[BASE_COLOUR(backgroundColour)].mid_dark;
// Input area top border
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - lineHeight - 11, _consoleRight, _consoleBottom - lineHeight - 11, PALETTE_INDEX_14);
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - lineHeight - 10, _consoleRight, _consoleBottom - lineHeight - 10, PALETTE_INDEX_11);
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - lineHeight - 11, _consoleRight, _consoleBottom - lineHeight - 11, borderColour1);
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - lineHeight - 10, _consoleRight, _consoleBottom - lineHeight - 10, borderColour2);
// Input area bottom border
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - 1, _consoleRight, _consoleBottom - 1, PALETTE_INDEX_14);
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - 0, _consoleRight, _consoleBottom - 0, PALETTE_INDEX_12);
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - 1, _consoleRight, _consoleBottom - 1, borderColour1);
gfx_fill_rect(dpi, _consoleLeft, _consoleBottom - 0, _consoleRight, _consoleBottom - 0, borderColour2);
}
void console_input(CONSOLE_INPUT input)

View File

@@ -494,6 +494,7 @@ enum {
WC_EDITOR_TRACK_BOTTOM_TOOLBAR = 221,
WC_EDITOR_SCENARIO_BOTTOM_TOOLBAR = 222,
WC_CHAT = 223,
WC_CONSOLE = 224,
WC_NULL = 255,
};

View File

@@ -3811,6 +3811,8 @@ enum {
STR_ERROR_RESERVED_NAME = 6156,
STR_CONSOLE = 6157,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768
};