summaryrefslogtreecommitdiff
path: root/src/script/api/script_goal.hpp
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2013-05-26 19:54:43 +0000
committerzuu <zuu@openttd.org>2013-05-26 19:54:43 +0000
commita4cddc3e082e2bba80644792b2f6623979328e65 (patch)
tree803c694f123792d7b54f45fdd2d3f83dc3bcc8a5 /src/script/api/script_goal.hpp
parent05c472f08afdfc6d56fa45f941c17657358d0733 (diff)
downloadopenttd-a4cddc3e082e2bba80644792b2f6623979328e65.tar.xz
(svn r25296) -Feature: Goals can now have a progress text and/or be marked as completed.
Diffstat (limited to 'src/script/api/script_goal.hpp')
-rw-r--r--src/script/api/script_goal.hpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/script/api/script_goal.hpp b/src/script/api/script_goal.hpp
index a8511e0d6..5416fadf3 100644
--- a/src/script/api/script_goal.hpp
+++ b/src/script/api/script_goal.hpp
@@ -109,6 +109,50 @@ public:
static bool Remove(GoalID goal_id);
/**
+ * Update goal text of a goal.
+ * @param goal_id The goal to update.
+ * @param goal The new goal text (can be either a raw string, or a ScriptText object).
+ * @return True if the action succeeded.
+ * @pre No ScriptCompanyMode may be in scope.
+ * @pre goal != NULL && len(goal) != 0.
+ * @pre IsValidGoal(goal_id).
+ */
+ static bool SetText(GoalID goal_id, Text *goal);
+
+ /**
+ * Update the progress text of a goal. The progress text is a text that
+ * is shown adjacent to the goal but in a separate column. Try to keep
+ * the progress string short.
+ * @param goal_id The goal to update.
+ * @param progress The new progress text for the goal (can be either a raw string,
+ * or a ScriptText object). To clear the progress string you can pass NULL or an
+ * empty string.
+ * @return True if the action succeeded.
+ * @pre No ScriptCompanyMode may be in scope.
+ * @pre IsValidGoal(goal_id).
+ */
+ static bool SetProgress(GoalID goal_id, Text *progress);
+
+ /**
+ * Update completed status of goal
+ * @param goal_id The goal to update.
+ * @param complete The new goal completed status.
+ * @return True if the action succeeded.
+ * @pre No ScriptCompanyMode may be in scope.
+ * @pre IsValidGoal(goal_id).
+ */
+ static bool SetCompleted(GoalID goal_id, bool complete);
+
+ /**
+ * Checks if a given goal have been marked as completed.
+ * @param goal_id The goal to check complete status.
+ * @return True if the goal is completed, otherwise false.
+ * @pre No ScriptCompanyMode may be in scope.
+ * @pre IsValidGoal(goal_id).
+ */
+ static bool IsCompleted(GoalID goal_id);
+
+ /**
* Ask a question.
* @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.