refactor dialogue word button on/off colors to constants
This commit is contained in:
@@ -603,8 +603,8 @@ void start_talk_mode(short m_num,short personality,mon_num_t monst_type,short st
|
|||||||
// Place buttons at bottom.
|
// Place buttons at bottom.
|
||||||
for(short i = 0; i < 9; i++) {
|
for(short i = 0; i < 9; i++) {
|
||||||
word_rect_t preset_word(preset_words[i], preset_rects[i]);
|
word_rect_t preset_word(preset_words[i], preset_rects[i]);
|
||||||
preset_word.on = Colours::DARK_GREEN;
|
preset_word.on = PRESET_WORD_ON;
|
||||||
preset_word.off = Colours::LIGHT_GREEN;
|
preset_word.off = PRESET_WORD_OFF;
|
||||||
switch(i) {
|
switch(i) {
|
||||||
case 0: preset_word.node = TALK_LOOK; break;
|
case 0: preset_word.node = TALK_LOOK; break;
|
||||||
case 1: preset_word.node = TALK_NAME; break;
|
case 1: preset_word.node = TALK_NAME; break;
|
||||||
|
@@ -878,9 +878,9 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col
|
|||||||
|
|
||||||
// Place buttons at bottom.
|
// Place buttons at bottom.
|
||||||
if(color == 0)
|
if(color == 0)
|
||||||
style.colour = Colours::DARK_GREEN;
|
style.colour = PRESET_WORD_OFF;
|
||||||
else
|
else
|
||||||
style.colour = Colours::LIGHT_GREEN;
|
style.colour = PRESET_WORD_ON;
|
||||||
for(short i = 0; i < 9; i++) {
|
for(short i = 0; i < 9; i++) {
|
||||||
if(!talk_end_forced || i == 6 || i == 5)
|
if(!talk_end_forced || i == 6 || i == 5)
|
||||||
win_draw_string(talk_gworld,talk_words[i].rect,talk_words[i].word,eTextMode::LEFT_TOP,style);
|
win_draw_string(talk_gworld,talk_words[i].rect,talk_words[i].word,eTextMode::LEFT_TOP,style);
|
||||||
@@ -907,7 +907,7 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<rectangle> word_rects = draw_string_hilite(talk_gworld, word_place_rect, str, style, hilites, color ? Colours::DARK_BLUE : Colours::DARK_RED);
|
std::vector<rectangle> word_rects = draw_string_hilite(talk_gworld, word_place_rect, str, style, hilites, color ? CUSTOM_WORD_ON : CUSTOM_WORD_OFF);
|
||||||
|
|
||||||
if(!talk_end_forced) {
|
if(!talk_end_forced) {
|
||||||
// Now build the list of word rects
|
// Now build the list of word rects
|
||||||
@@ -916,8 +916,8 @@ void place_talk_str(std::string str_to_place,std::string str_to_place2,short col
|
|||||||
thisRect.word = str.substr(hilites[i].first, hilites[i].second - hilites[i].first);
|
thisRect.word = str.substr(hilites[i].first, hilites[i].second - hilites[i].first);
|
||||||
thisRect.rect = word_rects[i];
|
thisRect.rect = word_rects[i];
|
||||||
thisRect.node = nodes[i];
|
thisRect.node = nodes[i];
|
||||||
thisRect.on = Colours::DARK_BLUE;
|
thisRect.on = CUSTOM_WORD_ON;
|
||||||
thisRect.off = Colours::NAVY; // Note: "off" is never used
|
thisRect.off = CUSTOM_WORD_OFF; // Note: "off" is never used
|
||||||
talk_words.push_back(thisRect);
|
talk_words.push_back(thisRect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -66,4 +66,11 @@ namespace Colours {
|
|||||||
const sf::Color DARK_RED { 0xa0, 0x00, 0x14}; // formerly c[7] (clickable text, new in OBoE)
|
const sf::Color DARK_RED { 0xa0, 0x00, 0x14}; // formerly c[7] (clickable text, new in OBoE)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const sf::Color PRESET_WORD_ON = Colours::DARK_GREEN;
|
||||||
|
const sf::Color PRESET_WORD_OFF = Colours::LIGHT_GREEN;
|
||||||
|
|
||||||
|
const sf::Color CUSTOM_WORD_ON = Colours::DARK_BLUE;
|
||||||
|
const sf::Color CUSTOM_WORD_OFF = Colours::DARK_RED;
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user