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) void GameModel::SetDecoration(bool decorationState)
{ {
ren->decorations_enable = decorationState?1:0; if (ren->decorations_enable != decorationState)
notifyDecorationChanged(); {
UpdateQuickOptions(); ren->decorations_enable = decorationState?1:0;
if (decorationState) notifyDecorationChanged();
SetInfoTip("Decorations Layer: On"); UpdateQuickOptions();
else if (decorationState)
SetInfoTip("Decorations Layer: Off"); SetInfoTip("Decorations Layer: On");
else
SetInfoTip("Decorations Layer: Off");
}
} }
bool GameModel::GetDecoration() bool GameModel::GetDecoration()

View File

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