Disable most of the palette buttons for the empty palette.

This commit is contained in:
fendrin 2013-05-17 12:17:02 +02:00
parent 7cc1327719
commit 5a5f3d7e94
2 changed files with 24 additions and 12 deletions

View file

@ -30,7 +30,7 @@ public:
empty_palette(display& gui) :
common_palette(gui),
/*gui_(gui),*/ empty_() {};
gui_(gui), empty_() {};
//event handling
virtual bool mouse_click() { return false;};
@ -45,16 +45,26 @@ public:
//drawing
virtual void adjust_size(const SDL_Rect& /*target*/) {};
virtual void draw() {
/*
gui::button* upscroll_button = gui_.find_action_button("upscroll-button-editor");
upscroll_button->hide(true);
gui::button* downscroll_button = gui_.find_action_button("downscroll-button-editor");
downscroll_button->hide(true);
gui::button* palette_menu_button = gui_.find_menu_button("menu-editor-terrain");
palette_menu_button->hide(true);
*/
};
virtual void draw() {};
void hide(bool hidden) {
if (!hidden) {
gui::button* upscroll_button = gui_.find_action_button("upscroll-button-editor");
upscroll_button->enable(false);
gui::button* downscroll_button = gui_.find_action_button("downscroll-button-editor");
downscroll_button->enable(false);
gui::button* palette_menu_button = gui_.find_menu_button("menu-editor-terrain");
palette_menu_button->set_overlay("");
palette_menu_button->enable(false);
} else {
gui::button* upscroll_button = gui_.find_action_button("upscroll-button-editor");
upscroll_button->enable(true);
gui::button* downscroll_button = gui_.find_action_button("downscroll-button-editor");
downscroll_button->enable(true);
gui::button* palette_menu_button = gui_.find_menu_button("menu-editor-terrain");
palette_menu_button->enable(true);
}
}
std::vector<gui::widget>* get_widgets() { return NULL; };
@ -76,7 +86,7 @@ public:
virtual void swap() {};
private:
// display& gui_;
display& gui_;
std::vector<item_group> empty_;
};

View file

@ -119,6 +119,8 @@ void button::load_images() {
if (overlayPressedDisabledImage_.null())
overlayPressedDisabledImage_ = blend_surface(greyscale_image(overlayPressedImage_),
disabled_btn_adjust, disabled_btn_color);
} else {
overlayImage_.assign(NULL);
}
if (disabled_image == NULL) {