Refactor dialog parsing to reduce code duplication

- Refactor dialog format parameter management to use a single protected control function
- Format parameters "frame" and "frame style" merged
- Colour is now a first-class format parameter (though it still has a separate setter)
This commit is contained in:
2020-02-20 23:41:40 -05:00
parent 3c748ca071
commit 12bde373b1
20 changed files with 805 additions and 980 deletions

View File

@@ -1620,7 +1620,7 @@ static void put_target_status_graphics(cDialog& me, short for_pc) {
for(auto next : univ.party[for_pc].status) {
std::string id2 = id + "-stat" + std::to_string(slot + 1);
cPict& pic = dynamic_cast<cPict&>(me[id2]);
pic.setFormat(TXT_FRAME, false);
pic.setFormat(TXT_FRAME, FRM_NONE);
if(isAlive) {
short placedIcon = -1;
if(next.first == eStatus::POISON && next.second > 4) placedIcon = 1;

View File

@@ -1486,7 +1486,7 @@ void draw_map(bool need_refresh) {
cPict theGraphic(mini_map);
theGraphic.setBounds(dlogpicrect);
theGraphic.setPict(21, PIC_DLOG);
theGraphic.setFormat(TXT_FRAME, false);
theGraphic.setFormat(TXT_FRAME, FRM_NONE);
theGraphic.draw();
style.colour = sf::Color::White;
style.lineHeight = 12;