Fix a lot of bugs in the PC editor

- Alchemy dialog had black text on dark background
- Buttons didn't depress when clicked
- Edit XP button just said "Edit"
- Two menuitems in Special Edit menu had been left with default names
- Callbacks in Special Edit and Free Extras menu weren't correctly assigned
- Edit XP dialog put the XP to next level in the wrong place
- Fixed alchemy dialog LED naming

Supporting changes in the dialog engine:
- Getting or setting control text as a number now uses the long long type to allow maximal precision
- When adding a label to a button, the dialog's default text colour is used instead of the button's text colour if the dialog's background is dark
This commit is contained in:
2014-04-17 02:24:35 -04:00
parent 9a19383423
commit f449b47f36
11 changed files with 58 additions and 95 deletions

View File

@@ -1135,6 +1135,7 @@ bool cDialog::addLabelFor(std::string key, std::string label, eLabelPos where, s
labelRect.inset(0, -expand);
} else labelRect.offset(0, labelRect.height() / 6);
cControl* labelCtrl;
// TODO: Refactor this to do without exceptions
try {
labelCtrl = &this->getControl(key);
} catch(std::invalid_argument x) {
@@ -1142,8 +1143,9 @@ bool cDialog::addLabelFor(std::string key, std::string label, eLabelPos where, s
}
labelCtrl->setText(label);
labelCtrl->setFormat(TXT_FONT, bold ? SILOM : GENEVA);
// TODO: Do we need to set colour to white if background is dark?
labelCtrl->setColour(ctrl.getColour());
if(bg == BG_DARK && dynamic_cast<cButton*>(&ctrl) != NULL)
labelCtrl->setColour(defTextClr);
else labelCtrl->setColour(ctrl.getColour());
return add(labelCtrl, labelRect, key);
}