From bfafc42d46f2d56d1bcaebd08c7f44a504b52ff8 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 16 Dec 2014 17:34:00 -0500 Subject: [PATCH] Fix some issue with dialog picture display, mainly in special node dialogs --- osx/dialogxml/dlogutil.cpp | 37 +++---------------------------------- osx/dialogxml/pict.cpp | 2 +- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/osx/dialogxml/dlogutil.cpp b/osx/dialogxml/dlogutil.cpp index 63b9c50e..ac7a8e59 100644 --- a/osx/dialogxml/dlogutil.cpp +++ b/osx/dialogxml/dlogutil.cpp @@ -422,43 +422,12 @@ void cThreeChoice::init_buttons(cBasicButtonType btn1, cBasicButtonType btn2, cB } void cThreeChoice::init_pict(pic_num_t pic){ - RECT pic_rect; - switch(type){ - case PIC_DLOG: - case PIC_CUSTOM_DLOG: - pic_rect = {0,0,36,36}; - break; - case PIC_TALK: - case PIC_CUSTOM_TALK: - case PIC_SCEN: - case PIC_CUSTOM_SCEN: - pic_rect = {0,0,32,32}; - break; - case PIC_MISSILE: - case PIC_CUSTOM_MISSILE: - pic_rect = {0,0,18,18}; - break; - case PIC_DLOG_LG: - case PIC_CUSTOM_DLOG_LG: - pic_rect = {0,0,72,72}; - break; - case PIC_SCEN_LG: - pic_rect = {0,0,64,64}; - break; - case PIC_TER_MAP: - case PIC_CUSTOM_TER_MAP: - pic_rect = {0,0,24,24}; - break; - case PIC_STATUS: - pic_rect = {0,0,12,12}; - default: - pic_rect = {0,0,28,36}; - } - pic_rect.offset(8,8); cDialog* me = operator->(); cPict* pic_ctrl = new cPict(*me); + pic_ctrl->setBounds({8,8,8,8}); pic_ctrl->setPict(pic,type); - me->add(pic_ctrl, pic_rect, "pict"); + pic_ctrl->recalcRect(); + me->add(pic_ctrl, pic_ctrl->getBounds(), "pict"); } std::string cThreeChoice::show(){ diff --git a/osx/dialogxml/pict.cpp b/osx/dialogxml/pict.cpp index 70df74f9..be7e22a1 100644 --- a/osx/dialogxml/pict.cpp +++ b/osx/dialogxml/pict.cpp @@ -109,7 +109,7 @@ sf::Color cPict::getColour() throw(xUnsupportedProp) { void cPict::setPict(pic_num_t num, ePicType type){ picNum = num; picType = type; - switch(picType){ + switch(picType + PIC_PRESET){ case PIC_DLOG: frame.right = frame.left + 36; frame.bottom = frame.top + 36;