Move noAction to cLed since its purpose is mainly to prevent the default LED toggle-selected action without introducing any alternate behaviour.

This commit is contained in:
2014-12-06 01:21:36 -05:00
parent d35b2137be
commit f904389be8
3 changed files with 2 additions and 2 deletions

View File

@@ -72,6 +72,7 @@ protected:
class cLed : public cButton {
public:
static void init();
static bool noAction(cDialog&,std::string,eKeyMod) {return true;}
void attachClickHandler(click_callback_t f) throw();
void attachFocusHandler(focus_callback_t f) throw();
bool triggerClickHandler(cDialog& me, std::string id, eKeyMod mods);

View File

@@ -44,7 +44,6 @@ class cDialog {
std::vector<std::pair<std::string,cTextField*>> tabOrder;
public:
static void init();
static bool noAction(cDialog&,std::string,eKeyMod) {return true;}
static const short BG_LIGHT, BG_DARK;
static short defaultBackground;
explicit cDialog(cDialog* p = NULL); // dialog with no items

View File

@@ -308,7 +308,7 @@ void display_alchemy(bool allowEdit)
std::string id = "potion" + boost::lexical_cast<std::string>(i + 1);
showAlch->addLabelFor(id, alch_names[i], LABEL_LEFT, 83, true);
if(!allowEdit)
showAlch->getControl(id).attachClickHandler(&cDialog::noAction);
showAlch->getControl(id).attachClickHandler(&cLed::noAction);
cLed& led = dynamic_cast<cLed&>(showAlch->getControl(id));
if (univ.party.alchemy[i] > 0)
led.setState(led_red);