Tweak text colours to be less blindingly bright and closer to the original Mac BoE

This commit is contained in:
2020-02-01 19:53:23 -05:00
parent 5675ab8c71
commit 3e686cb908
10 changed files with 50 additions and 33 deletions

View File

@@ -1511,7 +1511,7 @@ void frame_space(location where,short mode,short width,short height) {
to_frame.right = 41 + where_put.x * 28 + 28 * (width - 1);
to_frame.offset(win_to_rects[WINRECT_TERVIEW].topLeft());
frame_roundrect(mainPtr, to_frame, 8, (mode == 0) ? sf::Color::Red : sf::Color::Green);
frame_roundrect(mainPtr, to_frame, 8, (mode == 0) ? Colours::RED : Colours::GREEN);
}

View File

@@ -274,7 +274,7 @@ void frame_active_pc(location center) {
active_pc_rect.right = 46 + where_draw.x * 28;
active_pc_rect.offset(14,2);
frame_roundrect(mainPtr, active_pc_rect, 8, sf::Color::Magenta);
frame_roundrect(mainPtr, active_pc_rect, 8, Colours::PINK);
}
void draw_pcs(location center) {

View File

@@ -38,6 +38,7 @@
#include "button.hpp"
#include "spell.hpp"
#include "cursors.hpp"
#include "render_shapes.hpp" // for colour constants
extern short skill_bonus[21];
@@ -1660,7 +1661,7 @@ static void put_pc_caster_buttons(cDialog& me) {
std::string n = boost::lexical_cast<std::string>(i + 1);
if(me["caster" + n].isVisible()) {
if(i == pc_casting)
me["pc" + n].setColour(sf::Color::Red);
me["pc" + n].setColour(Colours::RED);
else me["pc" + n].setColour(me.getDefTextClr());
}
}
@@ -1670,8 +1671,8 @@ static void put_pc_target_buttons(cDialog& me, short& store_last_target_darkened
if(store_spell_target < 6) {
std::string n = boost::lexical_cast<std::string>(store_spell_target + 1);
me["hp" + n].setColour(sf::Color::Red);
me["sp" + n].setColour(sf::Color::Red);
me["hp" + n].setColour(Colours::RED);
me["sp" + n].setColour(Colours::RED);
}
if((store_last_target_darkened < 6) && (store_last_target_darkened != store_spell_target)) {
std::string n = boost::lexical_cast<std::string>(store_last_target_darkened + 1);

View File

@@ -102,7 +102,7 @@ void put_pc_screen() {
TextStyle style;
style.font = FONT_BOLD;
style.pointSize = 10;
style.colour = sf::Color::Yellow;
style.colour = Colours::YELLOW;
style.lineHeight = 10;
win_draw_string(pc_stats_gworld,food_rect[1],"Food:",eTextMode::WRAP,style);
win_draw_string(pc_stats_gworld,gold_rect[1],"Gold:",eTextMode::WRAP,style);
@@ -126,7 +126,7 @@ void put_pc_screen() {
flag = true;
if(i == univ.cur_pc) {
style.italic = true;
style.colour = sf::Color::Blue;
style.colour = Colours::BLUE;
}
std::ostringstream sout;
@@ -141,16 +141,16 @@ void put_pc_screen() {
switch(univ.party[i].main_status) {
case eMainStatus::ALIVE:
if(univ.party[i].cur_health == univ.party[i].max_health)
style.colour = sf::Color::Green;
style.colour = Colours::GREEN;
else if(univ.party[i].cur_health > univ.party[i].max_health)
style.colour = {0xff,0x80,0}; // Orange
else style.colour = sf::Color::Red;
style.colour = Colours::ORANGE;
else style.colour = Colours::RED;
win_draw_string( pc_stats_gworld,pc_buttons[i][PCBTN_HP],std::to_string(univ.party[i].cur_health),eTextMode::WRAP,style);
if(univ.party[i].cur_sp == univ.party[i].max_sp)
style.colour = sf::Color::Blue;
style.colour = Colours::BLUE;
else if(univ.party[i].cur_sp > univ.party[i].max_sp)
style.colour = {0,0xff,0x80}; // Teal
else style.colour = sf::Color::Magenta;
style.colour = Colours::TEAL;
else style.colour = Colours::PINK;
win_draw_string( pc_stats_gworld,pc_buttons[i][PCBTN_SP],std::to_string(univ.party[i].cur_sp),eTextMode::WRAP,style);
draw_pc_effects(i);
break;
@@ -230,7 +230,7 @@ void put_item_screen(eItemWinMode screen_num) {
TextStyle style;
style.lineHeight = 10;
style.font = FONT_BOLD;
style.colour = sf::Color::Yellow;
style.colour = Colours::YELLOW;
switch(screen_num) {
case ITEM_WIN_SPECIAL:
win_draw_string(item_stats_gworld,upper_frame_rect,"Special items:",eTextMode::WRAP,style);
@@ -271,7 +271,7 @@ void put_item_screen(eItemWinMode screen_num) {
if(i_num < spec_item_array.size()) {
int which_quest = spec_item_array[i_num] % 10000;
if(spec_item_array[i_num] / 10000 == 2)
style.colour = sf::Color::Red;
style.colour = Colours::RED;
win_draw_string(item_stats_gworld,item_buttons[i][ITEMBTN_NAME],univ.scenario.quests[which_quest].name,eTextMode::WRAP,style);
@@ -280,7 +280,7 @@ void put_item_screen(eItemWinMode screen_num) {
from = to = item_buttons[i][ITEMBTN_NAME].centre();
from.x = item_buttons[i][ITEMBTN_NAME].left;
to.x = from.x + string_length(univ.scenario.quests[which_quest].name, style);
draw_line(item_stats_gworld, from, to, 1, sf::Color::Green);
draw_line(item_stats_gworld, from, to, 1, Colours::GREEN);
}
place_item_button(3,i,ITEMBTN_INFO);
@@ -309,11 +309,11 @@ void put_item_screen(eItemWinMode screen_num) {
if(who.equip[i_num]) {
style.italic = true;
if(item.variety == eItemType::ONE_HANDED || item.variety == eItemType::TWO_HANDED)
style.colour = sf::Color::Magenta;
style.colour = Colours::PINK;
else if((*item.variety).is_armour)
style.colour = sf::Color::Green;
else style.colour = sf::Color::Blue;
} else style.colour = sf::Color::Black;
style.colour = Colours::GREEN;
else style.colour = Colours::BLUE;
} else style.colour = Colours::BLACK;
sout.str("");
if(!item.ident)
@@ -496,7 +496,7 @@ void place_item_bottom_buttons() {
style.lineHeight = 10;
style.pointSize = 12;
style.font = FONT_BOLD;
style.colour = sf::Color::Yellow;
style.colour = Colours::YELLOW;
sf::Texture& invenbtn_gworld = *ResMgr::graphics.get("invenbtns");
for(short i = 0; i < 6; i++) {

View File

@@ -1510,8 +1510,8 @@ void draw_map(bool need_refresh) {
draw_rect.right = draw_rect.left + 6;
draw_rect.bottom = draw_rect.top + 6;
fill_rect(mini_map, draw_rect, sf::Color::Green);
frame_circle(mini_map, draw_rect, sf::Color::Blue);
fill_rect(mini_map, draw_rect, Colours::GREEN);
frame_circle(mini_map, draw_rect, Colours::BLUE);
}
}
if((overall_mode != MODE_SHOPPING) && (overall_mode != MODE_TALKING)) {
@@ -1521,7 +1521,7 @@ void draw_map(bool need_refresh) {
draw_rect.top = area_to_draw_on.top + 6 * (where.y - view_rect.top);
draw_rect.right = draw_rect.left + 6;
draw_rect.bottom = draw_rect.top + 6;
fill_rect(mini_map, draw_rect, sf::Color::Red);
fill_rect(mini_map, draw_rect, Colours::RED);
frame_circle(mini_map, draw_rect, sf::Color::Black);
}

View File

@@ -43,4 +43,18 @@ void clip_rect(sf::RenderTarget& where, rectangle rect);
void clip_region(sf::RenderWindow& where, Region& region);
void undo_clip(sf::RenderTarget& where);
// reference colours for BoE's UI
namespace Colours {
const sf::Color WHITE = sf::Color::White;
const sf::Color BLACK = sf::Color::Black;
const sf::Color RED { 0xdd, 0x00, 0x00};
const sf::Color GREEN { 0x00, 0x88, 0x00};
const sf::Color BLUE { 0x00, 0x00, 0xdd};
const sf::Color TEAL { 0x59, 0x97, 0x8f};
const sf::Color PINK { 0xff, 0x00, 0x99};
const sf::Color YELLOW { 0xff, 0xff, 0x31};
const sf::Color ORANGE { 0xff, 0x80, 0x00};
}
#endif

View File

@@ -11,6 +11,7 @@
#include "choicedlog.hpp"
#include "winutil.hpp"
#include "cursors.hpp"
#include "render_shapes.hpp" // for colour constants
#include <boost/lexical_cast.hpp>
/*
@@ -339,7 +340,7 @@ static void draw_xp_skills(cDialog& me,xp_dlog_state& save) {
eSkill skill = eSkill(i);
cControl& cur = me[boost::lexical_cast<std::string>(skill)];
if(can_change_skill(skill, save, true))
cur.setColour(sf::Color::Red);
cur.setColour(Colours::RED);
else cur.setColour(me.getDefTextClr());
if(i < 19)
cur.setTextToNum(save.skills[skill]);

View File

@@ -393,7 +393,7 @@ void display_party() {
win_draw_string(mainPtr,from_rect,"Party is in a scenario (day " + std::to_string(1 + univ.party.age / 3700) + ").",eTextMode::WRAP,style);
for(short i = 0; i < 6; i++) {
if(i == current_active_pc) // active pc is drawn in blue
fill_rect(mainPtr, pc_area_buttons[i][0], sf::Color::Blue);
fill_rect(mainPtr, pc_area_buttons[i][0], Colours::BLUE);
else fill_rect(mainPtr, pc_area_buttons[i][0], sf::Color::Black);
from_rect = (current_pressed_button == i) ? ed_buttons_from[1] : ed_buttons_from[0];

View File

@@ -465,7 +465,7 @@ void draw_lb_slot (short which,short mode) {
}
else text_rect.offset(0,2);
if(mode > 0)
style.colour = sf::Color::Blue;
style.colour = Colours::BLUE;
style.lineHeight = 12;
win_draw_string(mainPtr,text_rect,left_button_status[which].label,eTextMode::WRAP,style);
}
@@ -492,7 +492,7 @@ void draw_rb_slot (short which,short mode) {
TextStyle style;
if(mode > 0)
style.colour = sf::Color::Red;
style.colour = Colours::RED;
style.lineHeight = 12;
win_draw_string(mainPtr,text_rect,right_button_status[which].label,eTextMode::WRAP,style);
}
@@ -929,7 +929,7 @@ void draw_terrain(){
draw_rect.bottom = 24 + 36 * (town->area_desc[i].bottom - cen_y + 4);
draw_rect.inset(-10, -13);
draw_rect.offset(TER_RECT_UL_X,TER_RECT_UL_Y);
frame_rect(mainPtr, draw_rect, sf::Color::Red);
frame_rect(mainPtr, draw_rect, Colours::RED);
}
// draw border rect
draw_rect.left = 21 + 28 * (town->in_town_rect.left - cen_x + 4);
@@ -950,7 +950,7 @@ void draw_terrain(){
draw_rect.bottom = 24 + 36 * (current_terrain->area_desc[i].bottom - cen_y + 4);
draw_rect.inset(-10, -13);
draw_rect.offset(TER_RECT_UL_X, TER_RECT_UL_Y);
frame_rect(mainPtr, draw_rect, sf::Color::Red);
frame_rect(mainPtr, draw_rect, Colours::RED);
}
}
clip_rect(mainPtr, terrain_rect);
@@ -1258,12 +1258,12 @@ void draw_frames() {
if((which_pt.x == town->wandering_locs[i].x) &&
(which_pt.y == town->wandering_locs[i].y)) {
frame_rect(mainPtr, draw_rect, sf::Color::Red);
frame_rect(mainPtr, draw_rect, Colours::RED);
}
for(short i = 0; i < town->start_locs.size(); i++)
if((which_pt.x == town->start_locs[i].x) &&
(which_pt.y == town->start_locs[i].y)) {
frame_rect(mainPtr, draw_rect, sf::Color::Magenta);
frame_rect(mainPtr, draw_rect, Colours::PINK);
}

View File

@@ -20,6 +20,7 @@
#include "pictchoice.hpp"
#include "res_strings.hpp"
#include "spell.hpp"
#include "render_shapes.hpp" // for colour constants
extern short cen_x, cen_y;
extern bool mouse_button_held;
@@ -129,7 +130,7 @@ short choose_background(short cur_choice, cDialog* parent) {
auto set_colour_for = [&](int which) {
sf::Color to = sf::Color::Black;
if(which == 2)
to = sf::Color::Red;
to = Colours::RED;
else if(which == 3)
to = {0x00, 0x00, 0x80};
else if(which == 11)