summaryrefslogtreecommitdiff
path: root/src/script/api/script_goal.hpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2012-01-21 12:03:55 +0000
committerrubidium <rubidium@openttd.org>2012-01-21 12:03:55 +0000
commit9f162e7115031cb42f80db399d63774f479c4125 (patch)
tree42ece87142f91c22e55202c1bb4dcdd986554e56 /src/script/api/script_goal.hpp
parent70c7fbd90eb0ace75d759725ba4d0085283f152c (diff)
downloadopenttd-9f162e7115031cb42f80db399d63774f479c4125.tar.xz
(svn r23827) -Feature [FS#4992]: [NoGo] Allow to chose the goal question window's title from a (small) set of options
Diffstat (limited to 'src/script/api/script_goal.hpp')
-rw-r--r--src/script/api/script_goal.hpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/script/api/script_goal.hpp b/src/script/api/script_goal.hpp
index 781b9bc07..5ad89666d 100644
--- a/src/script/api/script_goal.hpp
+++ b/src/script/api/script_goal.hpp
@@ -41,6 +41,17 @@ public:
GT_COMPANY = ::GT_COMPANY, ///< Destination is a company.
};
+ /**
+ * Types of queries we could do to the user.
+ * Basically the title of the question window.
+ */
+ enum QuestionType {
+ QT_QUESTION, ///< Asking a simple question; title: Question.
+ QT_INFORMATION, ///< Showing an informational message; title: Information.
+ QT_WARNING, ///< Showing a warning; title: Warning.
+ QT_ERROR, ///< Showing an error; title: Error.
+ };
+
enum QuestionButton {
/* Note: these values represent part of the string list starting with STR_GOAL_QUESTION_BUTTON_CANCEL */
BUTTON_CANCEL = (1 << 0), ///< Cancel button.
@@ -97,6 +108,7 @@ public:
* @param uniqueid Your unique id to distinguish results of multiple questions in the returning event.
* @param company The company to ask the question, or ScriptCompany::COMPANY_INVALID for all.
* @param question The question to ask (can be either a raw string, or a ScriptText object).
+ * @param type The type of question that is being asked.
* @param buttons Any combinations (at least 1, up to 3) of buttons defined in QuestionButton. Like BUTTON_YES + BUTTON_NO.
* @return True if the action succeeded.
* @pre No ScriptCompanyMode may be in scope.
@@ -106,7 +118,7 @@ public:
* @note Replies to the question are given by you via the event ScriptEvent_GoalQuestionAnswer.
* @note There is no guarantee you ever get a reply on your question.
*/
- static bool Question(uint16 uniqueid, ScriptCompany::CompanyID company, Text *question, int buttons);
+ static bool Question(uint16 uniqueid, ScriptCompany::CompanyID company, Text *question, QuestionType type, int buttons);
/**
* Close the question on all clients.