Skip to content

Commit

Permalink
video,game: Add and use COLOR_DARK_GREEN
Browse files Browse the repository at this point in the history
  • Loading branch information
mrannanj committed Jun 30, 2024
1 parent d8f2076 commit 733aae7
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/game/gui/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ void dialog_create(dialog *dlg, dialog_style style, const char *text, int x, int
text_settings tconf;
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

text_settings tconf_desc;
text_defaults(&tconf_desc);
tconf_desc.font = FONT_SMALL;
tconf_desc.cforeground = color_create(0, 121, 0, 255);
tconf_desc.cforeground = COLOR_DARK_GREEN;

dlg->x = x;
dlg->y = y;
Expand Down
2 changes: 1 addition & 1 deletion src/game/gui/textbutton.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void textbutton_render(component *c) {
} else if(component_is_disabled(c)) {
tb->tconf.cforeground = color_create(121, 121, 121, 255);
} else {
tb->tconf.cforeground = color_create(0, 121, 0, 255);
tb->tconf.cforeground = COLOR_DARK_GREEN;
}
text_render(&tb->tconf, c->x, c->y, c->w, c->h, tb->text);

Expand Down
2 changes: 1 addition & 1 deletion src/game/gui/textinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void textinput_render(component *c) {
}
} else {
if(chars > 0) {
tb->tconf.cforeground = color_create(0, 121, 0, 255);
tb->tconf.cforeground = COLOR_DARK_GREEN;
text_render(&tb->tconf, c->x, c->y, c->w, c->h, tb->buf);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/gui/textselector.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void textselector_render(component *c) {
} else if(component_is_disabled(c)) {
tb->tconf.cforeground = color_create(121, 121, 121, 255);
} else {
tb->tconf.cforeground = color_create(0, 121, 0, 255);
tb->tconf.cforeground = COLOR_DARK_GREEN;
}
text_render(&tb->tconf, c->x, c->y, c->w, c->h, buf);
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/gui/textslider.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void textslider_render(component *c) {
} else if(component_is_disabled(c)) {
tb->tconf.cforeground = color_create(121, 121, 121, 255);
} else {
tb->tconf.cforeground = color_create(0, 121, 0, 255);
tb->tconf.cforeground = COLOR_DARK_GREEN;
}
text_render(&tb->tconf, c->x, c->y, c->w, c->h, str_c(&txt));
str_free(&txt);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ int arena_create(scene *scene) {
text_settings tconf;
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;
tconf.halign = TEXT_CENTER;

// Arena menu
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ component *menu_audio_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

// Create menu and its header
component *menu = menu_create(11);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ component *menu_configuration_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
menu_attach(menu, label_create(&tconf, "CONFIGURATION"));
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ component *menu_connect_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
menu_attach(menu, label_create(&tconf, "CONNECT TO SERVER"));
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_gameplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ component *menu_gameplay_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
menu_attach(menu, label_create(&tconf, "GAMEPLAY"));
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ component *menu_input_create(scene *s, int player_id) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
menu_attach(menu, label_create(&tconf, "CHOOSE INPUT"));
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ guiframe *menu_keyboard_create(scene *s, int selected_player) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

local->frame = guiframe_create(25, 5, 270, 140);
component *menu = menu_create(11);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_listen.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ component *menu_listen_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

// Create the menu
component *menu = menu_create(11);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ component *menu_main_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
menu_attach(menu, textbutton_create(&tconf, "ONE PLAYER GAME", COM_ENABLED, mainmenu_1v1, s));
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ component *menu_net_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
menu_attach(menu, label_create(&tconf, "NETWORK PLAY"));
Expand Down
4 changes: 2 additions & 2 deletions src/game/scenes/mainmenu/menu_presskey.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void menu_presskey_tick(component *c) {
if(local->warn_timeout == 0) {
for(int i = 0; i < 2; i++) {
text_settings *tconf = label_get_text_settings(local->text[i]);
tconf->cforeground = color_create(0, 121, 0, 255);
tconf->cforeground = COLOR_DARK_GREEN;
}
}
}
Expand Down Expand Up @@ -114,7 +114,7 @@ component *menu_presskey_create(char **key) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
local->text[0] = label_create(&tconf, "PRESS A KEY FOR");
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ component *menu_video_create(scene *s) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

// Create menu and its header
component *menu = menu_create(11);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mainmenu/menu_video_confirm.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ component *menu_video_confirm_create(scene *s, settings_video *old_settings) {
text_defaults(&tconf);
tconf.font = FONT_BIG;
tconf.halign = TEXT_CENTER;
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;

component *menu = menu_create(11);
menu_attach(menu, label_create(&tconf, "ACCEPT RESOLUTION?"));
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mechlab/lab_dash_newplayer.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ component *lab_dash_newplayer_create(scene *s, newplayer_widgets *nw) {
xysizer_attach(xy, label_create(&tconf, lang_get(192)), 110, 43, 100, 50);

// Input field
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;
nw->input = textinput_create(&tconf, "Name", "");
component_select(nw->input, 1);
textinput_enable_background(nw->input, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mechlab/lab_menu_confirm.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ component *lab_menu_confirm_create(scene *s, lab_menu_select_cb yes, void *yesda
trnmenu_attach(menu, button);

// Add text label
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;
component *label = label_create(&tconf, title);
component_set_pos_hints(label, 10, 155);
component_set_size_hints(label, 300, 10);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mechlab/lab_menu_difficultyselect.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ component *lab_menu_difficultyselect_create(scene *s) {
}

// Add text label
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;
component *label = label_create(&tconf, "SELECT A DIFFICULTY LEVEL");
component_set_pos_hints(label, 87, 155);
component_set_size_hints(label, 150, 10);
Expand Down
2 changes: 1 addition & 1 deletion src/game/scenes/mechlab/lab_menu_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ component *lab_menu_select_create(scene *s, lab_menu_select_cb select, void *sel
// TODO the left-right buttons apply on focus, not select

// Add text label
tconf.cforeground = color_create(0, 121, 0, 255);
tconf.cforeground = COLOR_DARK_GREEN;
// TODO interpolate %s in the string here with blank
component *label = label_create(&tconf, lang_get(title));
component_set_pos_hints(label, 87, 155);
Expand Down
1 change: 1 addition & 0 deletions src/video/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#define COLOR_RED color_create(255, 0, 0, 255)
#define COLOR_GREEN color_create(0, 255, 0, 255)
#define COLOR_DARK_GREEN color_create(0, 121, 0, 255)
#define COLOR_BLUE color_create(0, 0, 255, 255)
#define COLOR_YELLOW color_create(255, 255, 0, 255)
#define COLOR_WHITE color_create(255, 255, 255, 255)
Expand Down

0 comments on commit 733aae7

Please sign in to comment.