Clean up, fix, and tweak the spellcasting dialog
- Includes new status effect images for the forcecage and for hypothetical inverses of dumbfound and magic resistance, as well as icons for the whole-party statuses.
This commit is contained in:
@@ -158,10 +158,12 @@ bool mod_contains(eKeyMod mods, eKeyMod mod) {
|
||||
|
||||
void cControl::show(){
|
||||
visible = true;
|
||||
if(labelCtrl) labelCtrl->show();
|
||||
}
|
||||
|
||||
void cControl::hide(){
|
||||
visible = false;
|
||||
if(labelCtrl) labelCtrl->hide();
|
||||
}
|
||||
|
||||
bool cControl::isVisible(){
|
||||
@@ -170,6 +172,10 @@ bool cControl::isVisible(){
|
||||
else return false;
|
||||
}
|
||||
|
||||
void cControl::setLabelCtrl(cControl* label) {
|
||||
labelCtrl = label;
|
||||
}
|
||||
|
||||
cKey cControl::getAttachedKey() {
|
||||
return key;
|
||||
}
|
||||
|
@@ -200,6 +200,10 @@ public:
|
||||
/// should be hilited in some way while pressed and is cancelled by releasing the mouse
|
||||
/// button outside the control's bounds.
|
||||
virtual bool handleClick(location where);
|
||||
/// Specifies that another control acts as a label for this one.
|
||||
/// The practical effect of this is that hiding or showing this control automatically hides or shows the label as well.
|
||||
/// @param label A pointer to the control that acts as a label.
|
||||
void setLabelCtrl(cControl* label);
|
||||
/// Create a new control attached to an arbitrary window, rather than a dialog.
|
||||
/// @param t The type of the control.
|
||||
/// @param p The parent window.
|
||||
@@ -217,6 +221,8 @@ protected:
|
||||
/// The parent dialog of the control.
|
||||
/// May be null, if the control was created via cControl(eControlType,sf::RenderWindow&).
|
||||
cDialog* parent;
|
||||
/// This control's labelling control.
|
||||
cControl* labelCtrl = NULL;
|
||||
/// The parent window of the control.
|
||||
/// This is for use in implementing draw().
|
||||
sf::RenderWindow* inWindow;
|
||||
|
@@ -1217,6 +1217,7 @@ bool cDialog::addLabelFor(std::string key, std::string label, eLabelPos where, s
|
||||
if(bg == BG_DARK && dynamic_cast<cButton*>(&ctrl) != NULL)
|
||||
labelCtrl->setColour(defTextClr);
|
||||
else labelCtrl->setColour(ctrl.getColour());
|
||||
ctrl.setLabelCtrl(labelCtrl);
|
||||
return add(labelCtrl, labelRect, key);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user