Get the edit monster abilities dialog all working and updated (except for editing individual abilities)
Game changes: - Remove support for playing a sound and displaying strings when a monster is first seen, since these behaviours can easily be obtained by using the special node called in the same context. Dialog engine changes: - Support for changing the font size of LEDs - When setting the page, a stack now applies a default value if the map is missing the required data - Add utility "addPage" method to stacks - If reducing the page count means the current page is deleted, a stack now switches to the last page
This commit is contained in:
@@ -225,11 +225,13 @@ bool cLed::triggerClickHandler(cDialog& me, std::string id, eKeyMod mods){
|
||||
|
||||
void cLed::setFormat(eFormat prop, short val) throw(xUnsupportedProp){
|
||||
if(prop == TXT_FONT) textFont = (eFont) val;
|
||||
else if(prop == TXT_SIZE) textSize = val;
|
||||
else throw xUnsupportedProp(prop);
|
||||
}
|
||||
|
||||
short cLed::getFormat(eFormat prop) throw(xUnsupportedProp){
|
||||
if(prop == TXT_FONT) return textFont;
|
||||
else if(prop == TXT_SIZE) return textSize;
|
||||
else throw xUnsupportedProp(prop);
|
||||
}
|
||||
|
||||
@@ -240,8 +242,8 @@ void cLed::draw(){
|
||||
|
||||
if(visible){
|
||||
TextStyle style;
|
||||
style.pointSize = 9;
|
||||
style.lineHeight = 8;
|
||||
style.pointSize = textSize;
|
||||
style.lineHeight = textSize - 1;
|
||||
from_rect = ledRects[state][depressed];
|
||||
to_rect = frame;
|
||||
to_rect.right = to_rect.left + 14;
|
||||
@@ -265,6 +267,7 @@ void cLed::restore(storage_t to) {
|
||||
cButton::restore(to);
|
||||
if(to.find("led-state") != to.end())
|
||||
setState(boost::any_cast<eLedState>(to["led-state"]));
|
||||
else setState(led_off);
|
||||
}
|
||||
|
||||
cLedGroup::cLedGroup(cDialog* parent) :
|
||||
@@ -501,4 +504,5 @@ void cLedGroup::restore(storage_t to) {
|
||||
cControl::restore(to);
|
||||
if(to.find("led-select") != to.end())
|
||||
setSelected(boost::any_cast<std::string>(to["led-select"]));
|
||||
else setSelected("");
|
||||
}
|
||||
|
Reference in New Issue
Block a user