Merge branch 'master' into jgrpp-nrt
# Conflicts: # src/console_cmds.cpp # src/script/api/script_order.cpp # src/station_cmd.cpp # src/statusbar_gui.cpp # src/town_gui.cpp
This commit is contained in:
@@ -1258,6 +1258,7 @@ void SQGSWindow_Register(Squirrel *engine)
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TE_SWITCH_BAR, "WID_TE_SWITCH_BAR");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_SORT_ORDER, "WID_TD_SORT_ORDER");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_SORT_CRITERIA, "WID_TD_SORT_CRITERIA");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_FILTER, "WID_TD_FILTER");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_LIST, "WID_TD_LIST");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_SCROLLBAR, "WID_TD_SCROLLBAR");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_WORLD_POPULATION, "WID_TD_WORLD_POPULATION");
|
||||
|
@@ -109,7 +109,7 @@
|
||||
return g != nullptr && g->completed;
|
||||
}
|
||||
|
||||
/* static */ bool ScriptGoal::DoQuestion(uint16 uniqueid, uint8 target, bool is_client, Text *question, QuestionType type, int buttons)
|
||||
/* static */ bool ScriptGoal::DoQuestion(uint16 uniqueid, uint32 target, bool is_client, Text *question, QuestionType type, uint32 buttons)
|
||||
{
|
||||
CCountedPtr<Text> counter(question);
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
EnforcePrecondition(false, buttons < (1 << ::GOAL_QUESTION_BUTTON_COUNT));
|
||||
EnforcePrecondition(false, (int)type < ::GOAL_QUESTION_TYPE_COUNT);
|
||||
|
||||
return ScriptObject::DoCommand(0, uniqueid | (target << 16) | (type << 24) | (is_client ? (1 << 31) : 0), buttons, CMD_GOAL_QUESTION, text);
|
||||
return ScriptObject::DoCommand(0, uniqueid | (target << 16), buttons | (type << 29) | (is_client ? (1 << 31) : 0), CMD_GOAL_QUESTION, text);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptGoal::Question(uint16 uniqueid, ScriptCompany::CompanyID company, Text *question, QuestionType type, int buttons)
|
||||
@@ -137,8 +137,9 @@
|
||||
{
|
||||
EnforcePrecondition(false, ScriptGame::IsMultiplayer());
|
||||
EnforcePrecondition(false, ScriptClient::ResolveClientID(client) != ScriptClient::CLIENT_INVALID);
|
||||
ClientIndex c = NetworkClientInfo::GetByClientID((::ClientID)client)->index;
|
||||
return DoQuestion(uniqueid, c, true, question, type, buttons);
|
||||
/* Can only send 16 bits of client_id before proper fix is implemented */
|
||||
EnforcePrecondition(false, client < (1 << 16));
|
||||
return DoQuestion(uniqueid, client, true, question, type, buttons);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptGoal::CloseQuestion(uint16 uniqueid)
|
||||
|
@@ -211,7 +211,7 @@ protected:
|
||||
/**
|
||||
* Does common checks and asks the question.
|
||||
*/
|
||||
static bool DoQuestion(uint16 uniqueid, uint8 target, bool is_client, Text *question, QuestionType type, int buttons);
|
||||
static bool DoQuestion(uint16 uniqueid, uint32 target, bool is_client, Text *question, QuestionType type, uint32 buttons);
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_GOAL_HPP */
|
||||
|
@@ -845,7 +845,7 @@ SQInteger ScriptList::Valuate(HSQUIRRELVM vm)
|
||||
int nparam = sq_gettop(vm) - 1;
|
||||
|
||||
if (nparam < 1) {
|
||||
return sq_throwerror(vm, "You need to give a least a Valuator as parameter to ScriptList::Valuate");
|
||||
return sq_throwerror(vm, "You need to give at least a Valuator as parameter to ScriptList::Valuate");
|
||||
}
|
||||
|
||||
/* Make sure the valuator function is really a function, and not any
|
||||
|
@@ -2528,6 +2528,7 @@ public:
|
||||
enum TownDirectoryWidgets {
|
||||
WID_TD_SORT_ORDER = ::WID_TD_SORT_ORDER, ///< Direction of sort dropdown.
|
||||
WID_TD_SORT_CRITERIA = ::WID_TD_SORT_CRITERIA, ///< Criteria of sort dropdown.
|
||||
WID_TD_FILTER = ::WID_TD_FILTER, ///< Filter of name.
|
||||
WID_TD_LIST = ::WID_TD_LIST, ///< List of towns.
|
||||
WID_TD_SCROLLBAR = ::WID_TD_SCROLLBAR, ///< Scrollbar for the town list.
|
||||
WID_TD_WORLD_POPULATION = ::WID_TD_WORLD_POPULATION, ///< The world's population.
|
||||
@@ -2536,6 +2537,7 @@ public:
|
||||
/** Widgets of the #TownAuthorityWindow class. */
|
||||
enum TownAuthorityWidgets {
|
||||
WID_TA_CAPTION = ::WID_TA_CAPTION, ///< Caption of window.
|
||||
WID_TA_ZONE_BUTTON = ::WID_TA_ZONE_BUTTON, ///< Turn on/off showing local authority zone.
|
||||
WID_TA_RATING_INFO = ::WID_TA_RATING_INFO, ///< Overview with ratings for each company.
|
||||
WID_TA_COMMAND_LIST = ::WID_TA_COMMAND_LIST, ///< List of commands for the player.
|
||||
WID_TA_SCROLLBAR = ::WID_TA_SCROLLBAR, ///< Scrollbar of the list of commands.
|
||||
|
Reference in New Issue
Block a user