fix multiple deco presets being able to be selected at once, fix "Decorations: Enable" coming up every time you open the deco editor, presets deselected when you leave editor

This commit is contained in:
jacob1 2013-07-16 11:24:11 -04:00
parent e0d982367b
commit 5773e6afb5
2 changed files with 13 additions and 15 deletions

View File

@ -799,13 +799,16 @@ bool GameModel::GetPaused()
void GameModel::SetDecoration(bool decorationState)
{
ren->decorations_enable = decorationState?1:0;
notifyDecorationChanged();
UpdateQuickOptions();
if (decorationState)
SetInfoTip("Decorations Layer: On");
else
SetInfoTip("Decorations Layer: Off");
if (ren->decorations_enable != decorationState)
{
ren->decorations_enable = decorationState?1:0;
notifyDecorationChanged();
UpdateQuickOptions();
if (decorationState)
SetInfoTip("Decorations Layer: On");
else
SetInfoTip("Decorations Layer: Off");
}
}
bool GameModel::GetDecoration()

View File

@ -741,6 +741,7 @@ void GameView::NotifyColourSelectorVisibilityChanged(GameModel * sender)
AddComponent(button);
}
AddComponent(colourPicker);
c->SetActiveColourPreset(-1);
}
}
@ -754,14 +755,8 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender)
ColourPresetAction(GameView * _v, int preset) : preset(preset) { v = _v; }
void ActionCallback(ui::Button * sender_)
{
ToolButton *sender = (ToolButton*)sender_;
if(sender->GetSelectionState() == 0)
{
v->c->SetActiveColourPreset(preset);
v->c->SetColour(sender->Appearance.BackgroundInactive);
}
else
sender->SetSelectionState(0);
v->c->SetActiveColourPreset(preset);
v->c->SetColour(sender_->Appearance.BackgroundInactive);
}
};