summaryrefslogtreecommitdiff
path: root/src/gui/npcdialog.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-03 23:28:26 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-03 23:41:59 +0200
commitf4e01badebdc5975c9ded35a93f7ac501e4f73c8 (patch)
tree5024e9be339bd47be410278072153c8fd9a1ad8c /src/gui/npcdialog.h
parent3a274b8e8c1183e2ef37a5ac0d75849db5560fb3 (diff)
downloadMana-f4e01badebdc5975c9ded35a93f7ac501e4f73c8.tar.gz
Mana-f4e01badebdc5975c9ded35a93f7ac501e4f73c8.tar.bz2
Mana-f4e01badebdc5975c9ded35a93f7ac501e4f73c8.tar.xz
Mana-f4e01badebdc5975c9ded35a93f7ac501e4f73c8.zip
Fixed compile warnings and other tweaks
Warnings were about initialization order and signed variables compared to unsigned variables. Please pay attention to these things. Also made some getters const and turned some std::string parameters into const std::string &.
Diffstat (limited to 'src/gui/npcdialog.h')
-rw-r--r--src/gui/npcdialog.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h
index 2adcc9c1..7800d828 100644
--- a/src/gui/npcdialog.h
+++ b/src/gui/npcdialog.h
@@ -111,14 +111,14 @@ class NpcDialog : public Window, public gcn::ActionListener,
std::string getElementAt(int i);
/**
- * Makes this dialog request a choice selection from the user
+ * Makes this dialog request a choice selection from the user.
*/
void choiceRequest();
/**
- * Adds a choice to the list box
+ * Adds a choice to the list box.
*/
- void addChoice(std::string);
+ void addChoice(const std::string &);
/**
* Fills the options list for an NPC dialog.
@@ -130,9 +130,9 @@ class NpcDialog : public Window, public gcn::ActionListener,
/**
* Requests a text string from the user.
*/
- void textRequest(std::string defaultText = "");
+ void textRequest(const std::string &defaultText = "");
- bool isInputFocused();
+ bool isInputFocused() const;
/**
* Requests a interger from the user.
@@ -176,24 +176,28 @@ class NpcDialog : public Window, public gcn::ActionListener,
// Will reset the text and integer input to the provided default
Button *mResetButton;
- enum NPCInputState {
+ enum NpcInputState
+ {
NPC_INPUT_NONE,
NPC_INPUT_LIST,
NPC_INPUT_STRING,
NPC_INPUT_INTEGER
};
- NPCInputState mInputState;
- enum NPCActionState {
+ enum NpcActionState
+ {
NPC_ACTION_WAIT,
NPC_ACTION_NEXT,
NPC_ACTION_INPUT,
NPC_ACTION_CLOSE
};
- NPCActionState mActionState;
+
+ NpcInputState mInputState;
+ NpcActionState mActionState;
};
// TODO: This should be made not to be global, later.
extern NpcDialog* npcDialog;
+
#endif // NPCDIALOG_H