mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
4 Commits
1bd1a5624f
...
80f8579a90
Author | SHA1 | Date |
---|---|---|
|
80f8579a90 | |
|
614a01907a | |
|
f51067f9f5 | |
|
185ca3a7f5 |
|
@ -7,6 +7,19 @@
|
|||
|
||||
/* This file contains code to downgrade the API from 15 to 14. */
|
||||
|
||||
AIDate <- AIEconomyDate;
|
||||
AIDate.IsValidDate <- function(date) { return AIDate(date).IsValid(); }
|
||||
AIDate.GetCurrentDateCompat14 <- AIDate.GetCurrentDate;
|
||||
AIDate.GetCurrentDate <- function() { return AIDate.GetCurrentDateCompat14().date(); }
|
||||
AIDate.GetYearCompat14 <- AIDate.GetYear;
|
||||
AIDate.GetYear <- function(date) { return AIDate(date).GetYearCompat14(); }
|
||||
AIDate.GetMonthCompat14 <- AIDate.GetMonth;
|
||||
AIDate.GetMonth <- function(date) { return AIDate(date).GetMonthCompat14(); }
|
||||
AIDate.GetDayOfMonthCompat14 <- AIDate.GetDayOfMonth;
|
||||
AIDate.GetDayOfMonth <- function(date) { return AIDate(date).GetDayOfMonthCompat14(); }
|
||||
AIDate.GetDateCompat14 <- AIDate.GetDate;
|
||||
AIDate.GetDate <- function(year, month, day) { return AIDate.GetDateCompat14(year, month, day).date(); }
|
||||
|
||||
AIBridge.GetBridgeID <- AIBridge.GetBridgeType;
|
||||
|
||||
class AICompat14 {
|
||||
|
@ -17,6 +30,8 @@ class AICompat14 {
|
|||
}
|
||||
}
|
||||
|
||||
AIBaseStation.GetConstructionDateCompat14 <- AIBaseStation.GetConstructionDate;
|
||||
AIBaseStation.GetConstructionDate <- function(station_id) { return AIBaseStation.GetConstructionDateCompat14(station_id).date(); }
|
||||
AIBaseStation.SetNameCompat14 <- AIBaseStation.SetName;
|
||||
AIBaseStation.SetName <- function(id, name) { return AIBaseStation.SetNameCompat14(id, AICompat14.Text(name)); }
|
||||
|
||||
|
@ -25,12 +40,18 @@ AICompany.SetName <- function(name) { return AICompany.SetNameCompat14(AICompat1
|
|||
AICompany.SetPresidentNameCompat14 <- AICompany.SetPresidentName;
|
||||
AICompany.SetPresidentName <- function(name) { return AICompany.SetPresidentNameCompat14(AICompat14.Text(name)); }
|
||||
|
||||
AIEngine.GetDesignDateCompat14 <- AIEngine.GetDesignDate;
|
||||
AIEngine.GetDesignDate <- function(engine_id) { return AIEngine.GetDesignDateCompat14(engine_id).date(); }
|
||||
|
||||
AIGroup.SetNameCompat14 <- AIGroup.SetName;
|
||||
AIGroup.SetName <- function(id, name) { return AIGroup.SetNameCompat14(id, AICompat14.Text(name)); }
|
||||
|
||||
AISign.BuildSignCompat14 <- AISign.BuildSign;
|
||||
AISign.BuildSign <- function(id, name) { return AISign.BuildSignCompat14(id, AICompat14.Text(name)); }
|
||||
|
||||
AISubsidy.GetExpireDateCompat14 <- AISubsidy.GetExpireDate;
|
||||
AISubsidy.GetExpireDate <- function(subsidy_id) { return AISubsidy.GetExpireDateCompat14(subsidy_id).date(); }
|
||||
|
||||
AITown.FoundTownCompat14 <- AITown.FoundTown;
|
||||
AITown.FoundTown <- function(tile, size, city, layout, name) { return AITown.FoundTownCompat14(tile, size, city, layout, AICompat14.Text(name)); }
|
||||
|
||||
|
|
|
@ -7,6 +7,19 @@
|
|||
|
||||
/* This file contains code to downgrade the API from 15 to 14. */
|
||||
|
||||
GSDate <- GSEconomyDate;
|
||||
GSDate.IsValidDate <- function(date) { return GSDate(date).IsValid(); }
|
||||
GSDate.GetCurrentDateCompat14 <- GSDate.GetCurrentDate;
|
||||
GSDate.GetCurrentDate <- function() { return GSDate.GetCurrentDateCompat14().date(); }
|
||||
GSDate.GetYearCompat14 <- GSDate.GetYear;
|
||||
GSDate.GetYear <- function(date) { return GSDate(date).GetYearCompat14(); }
|
||||
GSDate.GetMonthCompat14 <- GSDate.GetMonth;
|
||||
GSDate.GetMonth <- function(date) { return GSDate(date).GetMonthCompat14(); }
|
||||
GSDate.GetDayOfMonthCompat14 <- GSDate.GetDayOfMonth;
|
||||
GSDate.GetDayOfMonth <- function(date) { return GSDate(date).GetDayOfMonthCompat14(); }
|
||||
GSDate.GetDateCompat14 <- GSDate.GetDate;
|
||||
GSDate.GetDate <- function(year, month, day) { return GSDate.GetDateCompat14(year, month, day).date(); }
|
||||
|
||||
GSBridge.GetBridgeID <- GSBridge.GetBridgeType;
|
||||
|
||||
/* Emulate old GSText parameter padding behaviour */
|
||||
|
@ -21,6 +34,8 @@ class GSCompat14 {
|
|||
}
|
||||
}
|
||||
|
||||
GSBaseStation.GetConstructionDateCompat14 <- GSBaseStation.GetConstructionDate;
|
||||
GSBaseStation.GetConstructionDate <- function(station_id) { return GSBaseStation.GetConstructionDateCompat14(station_id).date(); }
|
||||
GSBaseStation.SetNameCompat14 <- GSBaseStation.SetName;
|
||||
GSBaseStation.SetName <- function(id, name) { return GSBaseStation.SetNameCompat14(id, GSCompat14.Text(name)); }
|
||||
|
||||
|
@ -29,6 +44,9 @@ GSCompany.SetName <- function(name) { return GSCompany.SetNameCompat14(GSCompat1
|
|||
GSCompany.SetPresidentNameCompat14 <- GSCompany.SetPresidentName;
|
||||
GSCompany.SetPresidentName <- function(name) { return GSCompany.SetPresidentNameCompat14(GSCompat14.Text(name)); }
|
||||
|
||||
GSEngine.GetDesignDateCompat14 <- GSEngine.GetDesignDate;
|
||||
GSEngine.GetDesignDate <- function(engine_id) { return GSEngine.GetDesignDateCompat14(engine_id).date(); }
|
||||
|
||||
GSGoal.NewCompat14 <- GSGoal.New;
|
||||
GSGoal.New <- function(company, goal, type, dest) { return GSGoal.NewCompat14(company, GSCompat14.Text(goal), type, dest); }
|
||||
GSGoal.SetTextCompat14 <- GSGoal.SetText;
|
||||
|
@ -43,6 +61,10 @@ GSGoal.QuestionClient <- function(id, target, is_client, question, type, buttons
|
|||
GSGroup.SetNameCompat14 <- GSGroup.SetName;
|
||||
GSGroup.SetName <- function(id, name) { return GSGroup.SetNameCompat14(id, GSCompat14.Text(name)); }
|
||||
|
||||
GSIndustry.GetConstructionDateCompat14 <- GSIndustry.GetConstructionDate;
|
||||
GSIndustry.GetConstructionDate <- function(industry_id) { return GSIndustry.GetConstructionDateCompat14(industry_id).date(); }
|
||||
GSIndustry.GetCargoLastAcceptedDateCompat14 <- GSIndustry.GetCargoLastAcceptedDate;
|
||||
GSIndustry.GetCargoLastAcceptedDate <- function(industry_id, cargo_type) { return GSIndustry.GetCargoLastAcceptedDateCompat14(industry_id, cargo_type).date(); }
|
||||
GSIndustry.SetTextCompat14 <- GSIndustry.SetText;
|
||||
GSIndustry.SetText <- function(id, text) { return GSIndustry.SetTextCompat14(id, GSCompat14.Text(text)); }
|
||||
GSIndustry.SetProductionLevelCompat14 <- GSIndustry.SetProductionLevel;
|
||||
|
@ -63,15 +85,22 @@ GSNews.Create <- function(type, text, company, ref_type, ref) { return GSNews.Cr
|
|||
GSSign.BuildSignCompat14 <- GSSign.BuildSign;
|
||||
GSSign.BuildSign <- function(id, name) { return GSSign.BuildSignCompat14(id, GSCompat14.Text(name)); }
|
||||
|
||||
GSStoryPage.GetDateCompat14 <- GSStoryPage.GetDate;
|
||||
GSStoryPage.GetDate <- function(story_page_id) { return GSStoryPage.GetDateCompat14(story_page_id).date(); }
|
||||
GSStoryPage.NewCompat14 <- GSStoryPage.New;
|
||||
GSStoryPage.New <- function(company, title) { return GSStoryPage.NewCompat14(company, GSCompat14.Text(title)); }
|
||||
GSStoryPage.NewElementCompat14 <- GSStoryPage.NewElement;
|
||||
GSStoryPage.NewElement <- function(page, type, ref, text) { return GSStoryPage.NewElementCompat14(page, type, ref, GSCompat14.Text(text)); }
|
||||
GSStoryPage.UpdateElementCompat14 <- GSStoryPage.UpdateElement;
|
||||
GSStoryPage.UpdateElement <- function(id, ref, text) { return GSStoryPage.UpdateElementCompat14(id, ref, GSCompat14.Text(text)); }
|
||||
GSStoryPage.SetDateCompat14 <- GSStoryPage.SetDate;
|
||||
GSStoryPage.SetDate <- function(story_page_id, date) { return GSStoryPage.SetDateCompat14(story_page_id, GSCalendarDate(date)); }
|
||||
GSStoryPage.SetTitleCompat14 <- GSStoryPage.SetTitle;
|
||||
GSStoryPage.SetTitle <- function(page, tile) { return GSStoryPage.SetTitleCompat14(page, GSCompat14.Text(title)); }
|
||||
|
||||
GSSubsidy.GetExpireDateCompat14 <- GSSubsidy.GetExpireDate;
|
||||
GSSubsidy.GetExpireDate <- function(subsidy_id) { return GSSubsidy.GetExpireDateCompat14(subsidy_id).date(); }
|
||||
|
||||
GSTown.SetNameCompat14 <- GSTown.SetName;
|
||||
GSTown.SetName <- function(id, name) { return GSTown.SetNameCompat14(id, GSCompat14.Text(name)); }
|
||||
GSTown.SetTextCompat14 <- GSTown.SetText;
|
||||
|
|
|
@ -509,7 +509,7 @@ public:
|
|||
this->SetWidgetLoweredState(WID_AP_BTN_DONTHILIGHT, !_settings_client.gui.station_show_coverage);
|
||||
this->SetWidgetLoweredState(WID_AP_BTN_DOHILIGHT, _settings_client.gui.station_show_coverage);
|
||||
this->SetDirty();
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->UpdateSelectSize();
|
||||
SetViewportCatchmentStation(nullptr, true);
|
||||
break;
|
||||
|
|
|
@ -469,7 +469,7 @@ public:
|
|||
this->RaiseWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF);
|
||||
_settings_client.gui.station_show_coverage = (widget != BDSW_LT_OFF);
|
||||
this->LowerWidget(_settings_client.gui.station_show_coverage + BDSW_LT_OFF);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
SetViewportCatchmentStation(nullptr, true);
|
||||
break;
|
||||
|
@ -580,7 +580,7 @@ public:
|
|||
this->RaiseWidget(WID_BDD_X + _ship_depot_direction);
|
||||
_ship_depot_direction = (widget == WID_BDD_X ? AXIS_X : AXIS_Y);
|
||||
this->LowerWidget(WID_BDD_X + _ship_depot_direction);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
UpdateDocksDirection();
|
||||
this->SetDirty();
|
||||
break;
|
||||
|
|
|
@ -323,7 +323,7 @@ static void StartGeneratingLandscape(GenerateLandscapeWindowMode mode)
|
|||
MakeNewgameSettingsLive();
|
||||
ResetGRFConfig(true);
|
||||
|
||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
||||
SndConfirmBeep();
|
||||
switch (mode) {
|
||||
case GLWM_GENERATE: _switch_mode = (_game_mode == GM_EDITOR) ? SM_GENRANDLAND : SM_NEWGAME; break;
|
||||
case GLWM_HEIGHTMAP: _switch_mode = (_game_mode == GM_EDITOR) ? SM_LOAD_HEIGHTMAP : SM_START_HEIGHTMAP; break;
|
||||
|
|
|
@ -3076,7 +3076,7 @@ struct IndustryCargoesWindow : public Window {
|
|||
case WID_IC_NOTIFY:
|
||||
this->ToggleWidgetLoweredState(WID_IC_NOTIFY);
|
||||
this->SetWidgetDirty(WID_IC_NOTIFY);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
|
||||
if (this->IsWidgetLowered(WID_IC_NOTIFY)) {
|
||||
if (FindWindowByClass(WC_SMALLMAP) == nullptr) ShowSmallMap();
|
||||
|
|
|
@ -64,7 +64,7 @@ bool HandlePlacePushButton(Window *w, WidgetID widget, CursorID cursor, HighLigh
|
|||
{
|
||||
if (w->IsWidgetDisabled(widget)) return false;
|
||||
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
w->SetDirty();
|
||||
|
||||
if (w->IsWidgetLowered(widget)) {
|
||||
|
|
|
@ -319,7 +319,7 @@ public:
|
|||
if (_object_gui.sel_type != std::numeric_limits<uint16_t>::max()) {
|
||||
_object_gui.sel_view = this->GetWidget<NWidgetBase>(widget)->GetParentWidget<NWidgetMatrix>()->GetCurrentElement();
|
||||
this->InvalidateData(PickerInvalidation::Position);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ void PickerWindow::OnClick(Point pt, WidgetID widget, int)
|
|||
this->callbacks.SetSelectedClass(*it);
|
||||
this->InvalidateData({PickerInvalidation::Type, PickerInvalidation::Position, PickerInvalidation::Validate});
|
||||
}
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
}
|
||||
|
@ -434,7 +434,7 @@ void PickerWindow::OnClick(Point pt, WidgetID widget, int)
|
|||
this->callbacks.SetSelectedType(item.index);
|
||||
this->InvalidateData(PickerInvalidation::Position);
|
||||
}
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -357,7 +357,7 @@ static void BuildRailClick_Remove(Window *w)
|
|||
{
|
||||
if (w->IsWidgetDisabled(WID_RAT_REMOVE)) return;
|
||||
ToggleRailButton_Remove(w);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
|
||||
/* handle station builder */
|
||||
if (w->IsWidgetLowered(WID_RAT_BUILD_STATION)) {
|
||||
|
@ -1239,7 +1239,7 @@ public:
|
|||
this->RaiseWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
||||
_station_gui.axis = (Axis)(widget - WID_BRAS_PLATFORM_DIR_X);
|
||||
this->LowerWidget(WID_BRAS_PLATFORM_DIR_X + _station_gui.axis);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
|
@ -1271,7 +1271,7 @@ public:
|
|||
|
||||
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
||||
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
|
@ -1304,7 +1304,7 @@ public:
|
|||
|
||||
this->LowerWidget(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN);
|
||||
this->LowerWidget(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
|
@ -1338,7 +1338,7 @@ public:
|
|||
|
||||
this->SetWidgetLoweredState(_settings_client.gui.station_numtracks + WID_BRAS_PLATFORM_NUM_BEGIN, !_settings_client.gui.station_dragdrop);
|
||||
this->SetWidgetLoweredState(_settings_client.gui.station_platlength + WID_BRAS_PLATFORM_LEN_BEGIN, !_settings_client.gui.station_dragdrop);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
|
@ -1350,7 +1350,7 @@ public:
|
|||
|
||||
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_OFF, !_settings_client.gui.station_show_coverage);
|
||||
this->SetWidgetLoweredState(WID_BRAS_HIGHLIGHT_ON, _settings_client.gui.station_show_coverage);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
SetViewportCatchmentStation(nullptr, true);
|
||||
break;
|
||||
|
@ -1743,7 +1743,7 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
|||
this->RaiseWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
||||
_build_depot_direction = (DiagDirection)(widget - WID_BRAD_DEPOT_NE);
|
||||
this->LowerWidget(WID_BRAD_DEPOT_NE + _build_depot_direction);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -582,7 +582,7 @@ struct BuildRoadToolbarWindow : Window {
|
|||
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
ToggleRoadButton_Remove(this);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_ROT_CONVERT_ROAD:
|
||||
|
@ -1145,7 +1145,7 @@ struct BuildRoadDepotWindow : public PickerWindowBase {
|
|||
this->RaiseWidget(WID_BROD_DEPOT_NE + _road_depot_orientation);
|
||||
_road_depot_orientation = (DiagDirection)(widget - WID_BROD_DEPOT_NE);
|
||||
this->LowerWidget(WID_BROD_DEPOT_NE + _road_depot_orientation);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
break;
|
||||
|
||||
|
@ -1477,7 +1477,7 @@ public:
|
|||
this->RaiseWidget(WID_BROS_STATION_NE + _roadstop_gui.orientation);
|
||||
_roadstop_gui.orientation = (DiagDirection)(widget - WID_BROS_STATION_NE);
|
||||
this->LowerWidget(WID_BROS_STATION_NE + _roadstop_gui.orientation);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
CloseWindowById(WC_SELECT_STATION, 0);
|
||||
break;
|
||||
|
@ -1487,7 +1487,7 @@ public:
|
|||
this->RaiseWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF);
|
||||
_settings_client.gui.station_show_coverage = (widget != WID_BROS_LT_OFF);
|
||||
this->LowerWidget(_settings_client.gui.station_show_coverage + WID_BROS_LT_OFF);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
SetViewportCatchmentStation(nullptr, true);
|
||||
break;
|
||||
|
|
|
@ -40,13 +40,15 @@ foreach(API "ai;AI" "game;GS" "template;Template")
|
|||
list(GET API 1 APIUC)
|
||||
|
||||
foreach(SCRIPT_API_FILE IN LISTS SCRIPT_API_FILES)
|
||||
if("${SCRIPT_API_FILE}" MATCHES ".*script_controller.*")
|
||||
continue()
|
||||
endif()
|
||||
get_filename_component(SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE}" NAME_WE)
|
||||
string(REPLACE "script_" "${APILC}_" SCRIPT_API_FILE_NAME "${SCRIPT_API_FILE_NAME}")
|
||||
set(SCRIPT_API_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${SCRIPT_API_FILE_NAME}.sq.hpp")
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${SCRIPT_API_FILE_NAME}.sq.hpp")
|
||||
file(REMOVE "${SCRIPT_API_BINARY_FILE}")
|
||||
continue()
|
||||
endif()
|
||||
|
||||
add_custom_command_timestamp(OUTPUT ${SCRIPT_API_BINARY_FILE}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DSCRIPT_API_SOURCE_FILE=${CMAKE_CURRENT_SOURCE_DIR}/squirrel_export.sq.hpp.in
|
||||
|
@ -74,6 +76,7 @@ foreach(API "ai;AI" "game;GS" "template;Template")
|
|||
|
||||
if(NOT "${APILC}" STREQUAL "template")
|
||||
list(APPEND SCRIPT_${APIUC}_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${APILC}_controller.sq.hpp")
|
||||
list(APPEND SCRIPT_${APIUC}_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${APILC}/${APILC}_date.sq.hpp")
|
||||
set(INCLUDES_BINARY_FILE "${CMAKE_BINARY_DIR}/generated/script/api/${APILC}/${APILC}_includes.hpp")
|
||||
set(API_FILES "${CMAKE_CURRENT_BINARY_DIR}/${APILC}.files")
|
||||
file(GENERATE OUTPUT ${API_FILES} CONTENT "${SCRIPT_${APIUC}_BINARY_FILES}")
|
||||
|
@ -120,6 +123,7 @@ foreach(API "ai;AI" "game;GS" "template;Template")
|
|||
)
|
||||
endif()
|
||||
else()
|
||||
list(APPEND SCRIPT_Template_BINARY_FILES "${CMAKE_CURRENT_SOURCE_DIR}/template/template_date.sq.hpp")
|
||||
add_dependencies(script_api
|
||||
script_${APILC}
|
||||
)
|
||||
|
@ -233,7 +237,6 @@ add_files(
|
|||
script_company.cpp
|
||||
script_companymode.cpp
|
||||
script_controller.cpp
|
||||
script_date.cpp
|
||||
script_depotlist.cpp
|
||||
script_engine.cpp
|
||||
script_enginelist.cpp
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../script_date.hpp"
|
||||
#include "../template/template_date.sq.hpp"
|
||||
|
||||
|
||||
template <> SQInteger PushClassName<ScriptEconomyDate, ScriptType::AI>(HSQUIRRELVM vm) { sq_pushstring(vm, "AIEconomyDate"); return 1; }
|
||||
template <> SQInteger PushClassName<ScriptCalendarDate, ScriptType::AI>(HSQUIRRELVM vm) { sq_pushstring(vm, "AICalendarDate"); return 1; }
|
||||
|
||||
void SQAIDate_Register(Squirrel &engine)
|
||||
{
|
||||
DefSQClass<ScriptEconomyDate, ScriptType::AI> SQAIEconomyDate("AIEconomyDate");
|
||||
SQAIEconomyDate.PreRegister(engine, "AIObject");
|
||||
SQAIEconomyDate.AddSQAdvancedConstructor(engine);
|
||||
|
||||
SQAIEconomyDate.DefSQConst(engine, ScriptEconomyDate::DATE_INVALID, "DATE_INVALID");
|
||||
|
||||
SQAIEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetCurrentDate, "GetCurrentDate", ".");
|
||||
SQAIEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetDate, "GetDate", ".iii");
|
||||
|
||||
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::IsValid, "IsValid", ".");
|
||||
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetYear, "GetYear", ".");
|
||||
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetMonth, "GetMonth", ".");
|
||||
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetDayOfMonth, "GetDayOfMonth", ".");
|
||||
SQAIEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::date, "date", ".");
|
||||
|
||||
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_tostring, "_tostring");
|
||||
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_add, "_add");
|
||||
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_sub, "_sub");
|
||||
SQAIEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_cmp, "_cmp");
|
||||
|
||||
SQAIEconomyDate.PostRegister(engine);
|
||||
|
||||
|
||||
DefSQClass<ScriptCalendarDate, ScriptType::AI> SQAICalendarDate("AICalendarDate");
|
||||
SQAICalendarDate.PreRegister(engine, "AIObject");
|
||||
SQAICalendarDate.AddSQAdvancedConstructor(engine);
|
||||
|
||||
SQAICalendarDate.DefSQConst(engine, ScriptCalendarDate::DATE_INVALID, "DATE_INVALID");
|
||||
|
||||
SQAICalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetCurrentDate, "GetCurrentDate", ".");
|
||||
SQAICalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetDate, "GetDate", ".iii");
|
||||
|
||||
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::IsValid, "IsValid", ".");
|
||||
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetYear, "GetYear", ".");
|
||||
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetMonth, "GetMonth", ".");
|
||||
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetDayOfMonth, "GetDayOfMonth", ".");
|
||||
SQAICalendarDate.DefSQMethod(engine, &ScriptCalendarDate::date, "date", ".");
|
||||
|
||||
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_tostring, "_tostring");
|
||||
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_add, "_add");
|
||||
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_sub, "_sub");
|
||||
SQAICalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_cmp, "_cmp");
|
||||
|
||||
SQAICalendarDate.PostRegister(engine);
|
||||
|
||||
}
|
|
@ -28,6 +28,11 @@
|
|||
* \li AICargo::CC_POTABLE
|
||||
* \li AICargo::CC_NON_POTABLE
|
||||
* \li AIVehicleList_Waypoint
|
||||
* \li AIEconomyDate
|
||||
* \li AICalendarDate
|
||||
*
|
||||
* API removals:
|
||||
* \li AIDate
|
||||
*
|
||||
* Other changes:
|
||||
* \li AIBridge::GetBridgeID renamed to AIBridge::GetBridgeType
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../script_date.hpp"
|
||||
#include "../template/template_date.sq.hpp"
|
||||
|
||||
template <> SQInteger PushClassName<ScriptEconomyDate, ScriptType::GS>(HSQUIRRELVM vm) { sq_pushstring(vm, "GSEconomyDate"); return 1; }
|
||||
template <> SQInteger PushClassName<ScriptCalendarDate, ScriptType::GS>(HSQUIRRELVM vm) { sq_pushstring(vm, "GSCalendarDate"); return 1; }
|
||||
|
||||
void SQGSDate_Register(Squirrel &engine)
|
||||
{
|
||||
DefSQClass<ScriptEconomyDate, ScriptType::GS> SQGSEconomyDate("GSEconomyDate");
|
||||
SQGSEconomyDate.PreRegister(engine, "GSObject");
|
||||
SQGSEconomyDate.AddSQAdvancedConstructor(engine);
|
||||
|
||||
SQGSEconomyDate.DefSQConst(engine, ScriptEconomyDate::DATE_INVALID, "DATE_INVALID");
|
||||
|
||||
SQGSEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetCurrentDate, "GetCurrentDate", ".");
|
||||
SQGSEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetDate, "GetDate", ".iii");
|
||||
SQGSEconomyDate.DefSQStaticMethod(engine, &ScriptEconomyDate::GetSystemTime, "GetSystemTime", ".");
|
||||
|
||||
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::IsValid, "IsValid", ".");
|
||||
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetYear, "GetYear", ".");
|
||||
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetMonth, "GetMonth", ".");
|
||||
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::GetDayOfMonth, "GetDayOfMonth", ".");
|
||||
SQGSEconomyDate.DefSQMethod(engine, &ScriptEconomyDate::date, "date", ".");
|
||||
|
||||
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_tostring, "_tostring");
|
||||
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_add, "_add");
|
||||
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_sub, "_sub");
|
||||
SQGSEconomyDate.DefSQAdvancedMethod(engine, &ScriptEconomyDate::_cmp, "_cmp");
|
||||
|
||||
SQGSEconomyDate.PostRegister(engine);
|
||||
|
||||
|
||||
DefSQClass<ScriptCalendarDate, ScriptType::GS> SQGSCalendarDate("GSCalendarDate");
|
||||
SQGSCalendarDate.PreRegister(engine, "GSObject");
|
||||
SQGSCalendarDate.AddSQAdvancedConstructor(engine);
|
||||
|
||||
SQGSCalendarDate.DefSQConst(engine, ScriptCalendarDate::DATE_INVALID, "DATE_INVALID");
|
||||
|
||||
SQGSCalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetCurrentDate, "GetCurrentDate", ".");
|
||||
SQGSCalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetDate, "GetDate", ".iii");
|
||||
SQGSCalendarDate.DefSQStaticMethod(engine, &ScriptCalendarDate::GetSystemTime, "GetSystemTime", ".");
|
||||
|
||||
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::IsValid, "IsValid", ".");
|
||||
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetYear, "GetYear", ".");
|
||||
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetMonth, "GetMonth", ".");
|
||||
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::GetDayOfMonth, "GetDayOfMonth", ".");
|
||||
SQGSCalendarDate.DefSQMethod(engine, &ScriptCalendarDate::date, "date", ".");
|
||||
|
||||
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_tostring, "_tostring");
|
||||
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_add, "_add");
|
||||
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_sub, "_sub");
|
||||
SQGSCalendarDate.DefSQAdvancedMethod(engine, &ScriptCalendarDate::_cmp, "_cmp");
|
||||
|
||||
SQGSCalendarDate.PostRegister(engine);
|
||||
}
|
|
@ -29,6 +29,11 @@
|
|||
* \li GSCargo::CC_NON_POTABLE
|
||||
* \li GSVehicleList_Waypoint
|
||||
* \li GSBaseStation::GetOwner
|
||||
* \li GSEconomyDate
|
||||
* \li GSCalendarDate
|
||||
*
|
||||
* API removals:
|
||||
* \li GSDate
|
||||
*
|
||||
* Other changes:
|
||||
* \li GSBridge::GetBridgeID renamed to GSBridge::GetBridgeType
|
||||
|
|
|
@ -66,9 +66,9 @@
|
|||
return ::BaseStation::Get(station_id)->xy;
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptBaseStation::GetConstructionDate(StationID station_id)
|
||||
/* static */ ScriptCalendarDate *ScriptBaseStation::GetConstructionDate(StationID station_id)
|
||||
{
|
||||
if (!IsValidBaseStation(station_id)) return ScriptDate::DATE_INVALID;
|
||||
if (!IsValidBaseStation(station_id)) return new ScriptCalendarDate();
|
||||
|
||||
return (ScriptDate::Date)::BaseStation::Get(station_id)->build_date.base();
|
||||
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(::BaseStation::Get(station_id)->build_date.base()));
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
* @return The last calendar-date some part of this station was build.
|
||||
* @see \ref ScriptCalendarTime
|
||||
*/
|
||||
static ScriptDate::Date GetConstructionDate(StationID station_id);
|
||||
static ScriptCalendarDate *GetConstructionDate(StationID station_id);
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_BASESTATION_HPP */
|
||||
|
|
|
@ -46,9 +46,9 @@ static NetworkClientInfo *FindClientInfo(ScriptClient::ClientID client)
|
|||
return ScriptCompany::ToScriptCompanyID(ci->client_playas);
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptClient::GetJoinDate(ScriptClient::ClientID client)
|
||||
/* static */ ScriptEconomyDate *ScriptClient::GetJoinDate(ScriptClient::ClientID client)
|
||||
{
|
||||
NetworkClientInfo *ci = FindClientInfo(client);
|
||||
if (ci == nullptr) return ScriptDate::DATE_INVALID;
|
||||
return (ScriptDate::Date)ci->join_date.base();
|
||||
if (ci == nullptr) return new ScriptEconomyDate();
|
||||
return new ScriptEconomyDate(static_cast<ScriptEconomyDate::Date>(ci->join_date.base()));
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
* @return The economy-date when client has joined.
|
||||
* @see \ref ScriptEconomyTime
|
||||
*/
|
||||
static ScriptDate::Date GetJoinDate(ClientID client);
|
||||
static ScriptEconomyDate *GetJoinDate(ClientID client);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** @file script_date.cpp Implementation of ScriptDate. */
|
||||
|
||||
#include "../../stdafx.h"
|
||||
#include "script_date.hpp"
|
||||
#include "../../timer/timer_game_economy.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "../../safeguards.h"
|
||||
|
||||
/* static */ bool ScriptDate::IsValidDate(Date date)
|
||||
{
|
||||
return date >= 0;
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptDate::GetCurrentDate()
|
||||
{
|
||||
return (ScriptDate::Date)TimerGameEconomy::date.base();
|
||||
}
|
||||
|
||||
/* static */ SQInteger ScriptDate::GetYear(ScriptDate::Date date)
|
||||
{
|
||||
if (date < 0) return DATE_INVALID;
|
||||
|
||||
::TimerGameEconomy::YearMonthDay ymd = ::TimerGameEconomy::ConvertDateToYMD(::TimerGameEconomy::Date{date});
|
||||
return ymd.year.base();
|
||||
}
|
||||
|
||||
/* static */ SQInteger ScriptDate::GetMonth(ScriptDate::Date date)
|
||||
{
|
||||
if (date < 0) return DATE_INVALID;
|
||||
|
||||
::TimerGameEconomy::YearMonthDay ymd = ::TimerGameEconomy::ConvertDateToYMD(::TimerGameEconomy::Date{date});
|
||||
return ymd.month + 1;
|
||||
}
|
||||
|
||||
/* static */ SQInteger ScriptDate::GetDayOfMonth(ScriptDate::Date date)
|
||||
{
|
||||
if (date < 0) return DATE_INVALID;
|
||||
|
||||
::TimerGameEconomy::YearMonthDay ymd = ::TimerGameEconomy::ConvertDateToYMD(::TimerGameEconomy::Date{date});
|
||||
return ymd.day;
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptDate::GetDate(SQInteger year, SQInteger month, SQInteger day_of_month)
|
||||
{
|
||||
if (month < 1 || month > 12) return DATE_INVALID;
|
||||
if (day_of_month < 1 || day_of_month > 31) return DATE_INVALID;
|
||||
|
||||
::TimerGameEconomy::Year timer_year{ClampTo<int32_t>(year)};
|
||||
if (timer_year < EconomyTime::MIN_YEAR || timer_year > EconomyTime::MAX_YEAR) return DATE_INVALID;
|
||||
|
||||
return static_cast<ScriptDate::Date>(::TimerGameEconomy::ConvertYMDToDate(timer_year, month - 1, day_of_month).base());
|
||||
}
|
||||
|
||||
/* static */ SQInteger ScriptDate::GetSystemTime()
|
||||
{
|
||||
time_t t;
|
||||
time(&t);
|
||||
return t;
|
||||
}
|
|
@ -12,7 +12,175 @@
|
|||
|
||||
#include "script_object.hpp"
|
||||
#include "../../timer/timer_game_economy.h"
|
||||
#include "../squirrel_helper.hpp"
|
||||
|
||||
#ifndef DOXYGEN_API
|
||||
template <size_t N>
|
||||
struct StringLiteral {
|
||||
constexpr StringLiteral(const char (&str)[N])
|
||||
{
|
||||
std::copy_n(str, N, this->value);
|
||||
}
|
||||
|
||||
char value[N];
|
||||
};
|
||||
|
||||
template <class Timer, class Time, StringLiteral Tag>
|
||||
class ScriptDateBase : public ScriptObject {
|
||||
public:
|
||||
using YearMonthDay = Timer::YearMonthDay;
|
||||
using Year = Timer::Year;
|
||||
|
||||
enum Date {
|
||||
DATE_INVALID = Time::INVALID_DATE.base(),
|
||||
};
|
||||
|
||||
ScriptDateBase(Date date = DATE_INVALID) : _date(date) {}
|
||||
ScriptDateBase(HSQUIRRELVM vm) : _date(DATE_INVALID)
|
||||
{
|
||||
int nparam = sq_gettop(vm) - 1;
|
||||
if (nparam >= 1) {
|
||||
SQInteger date;
|
||||
if (SQ_FAILED(sq_getinteger(vm, 2, &date))) {
|
||||
throw sq_throwerror(vm, "Argument must be an integer");
|
||||
}
|
||||
this->_date = static_cast<Date>(date);
|
||||
}
|
||||
}
|
||||
|
||||
bool IsValid()
|
||||
{
|
||||
return this->_date > 0;
|
||||
}
|
||||
|
||||
static ScriptDateBase *GetCurrentDate()
|
||||
{
|
||||
return new ScriptDateBase(static_cast<Date>(Timer::date.base()));
|
||||
}
|
||||
|
||||
SQInteger GetYear()
|
||||
{
|
||||
if (!this->IsValid()) return DATE_INVALID;
|
||||
|
||||
YearMonthDay ymd = Timer::ConvertDateToYMD(static_cast<Timer::Date>(this->_date));
|
||||
return ymd.year.base();
|
||||
}
|
||||
|
||||
SQInteger GetMonth()
|
||||
{
|
||||
if (!this->IsValid()) return DATE_INVALID;
|
||||
|
||||
YearMonthDay ymd = Timer::ConvertDateToYMD(static_cast<Timer::Date>(this->_date));
|
||||
return ymd.month + 1;
|
||||
}
|
||||
|
||||
SQInteger GetDayOfMonth()
|
||||
{
|
||||
if (!this->IsValid()) return DATE_INVALID;
|
||||
|
||||
YearMonthDay ymd = Timer::ConvertDateToYMD(static_cast<Timer::Date>(this->_date));
|
||||
return ymd.day;
|
||||
}
|
||||
|
||||
static ScriptDateBase *GetDate(SQInteger year, SQInteger month, SQInteger day_of_month)
|
||||
{
|
||||
if (month < 1 || month > 12) return new ScriptDateBase();
|
||||
if (day_of_month < 1 || day_of_month > 31) return new ScriptDateBase();
|
||||
|
||||
Year timer_year{ClampTo<int32_t>(year)};
|
||||
if (timer_year < Time::MIN_YEAR || timer_year > Time::MAX_YEAR) return new ScriptDateBase();
|
||||
|
||||
return new ScriptDateBase(static_cast<Date>(Timer::ConvertYMDToDate(timer_year, month - 1, day_of_month).base()));
|
||||
}
|
||||
|
||||
static SQInteger GetSystemTime()
|
||||
{
|
||||
time_t t;
|
||||
time(&t);
|
||||
return t;
|
||||
}
|
||||
|
||||
Date date() { return this->_date; }
|
||||
|
||||
SQInteger _tostring(HSQUIRRELVM vm)
|
||||
{
|
||||
sq_pushstring(vm, fmt::format("{}", this->_date));
|
||||
return 1;
|
||||
}
|
||||
|
||||
SQInteger _add(HSQUIRRELVM vm)
|
||||
{
|
||||
SQInteger days = 0;
|
||||
switch (sq_gettype(vm, 2)) {
|
||||
case OT_INTEGER:
|
||||
sq_getinteger(vm, 2, &days);
|
||||
break;
|
||||
case OT_INSTANCE: {
|
||||
ScriptDateBase *other = static_cast<ScriptDateBase *>(Squirrel::GetRealInstance(vm, 2, Tag.value));
|
||||
if (other == nullptr) return SQ_ERROR;
|
||||
days = other->_date;
|
||||
break;
|
||||
}
|
||||
default: return SQ_ERROR;
|
||||
}
|
||||
ScriptDateBase *res = new ScriptDateBase(static_cast<Date>(this->_date + days));
|
||||
res->AddRef();
|
||||
Squirrel::CreateClassInstanceVM(vm, Tag.value, res, nullptr, SQConvert::DefSQDestructorCallback<ScriptDateBase>, true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
SQInteger _sub(HSQUIRRELVM vm)
|
||||
{
|
||||
SQInteger days = 0;
|
||||
switch (sq_gettype(vm, 2)) {
|
||||
case OT_INTEGER:
|
||||
sq_getinteger(vm, 2, &days);
|
||||
break;
|
||||
case OT_INSTANCE: {
|
||||
ScriptDateBase *other = static_cast<ScriptDateBase *>(Squirrel::GetRealInstance(vm, 2, Tag.value));
|
||||
if (other == nullptr) return SQ_ERROR;
|
||||
days = other->_date;
|
||||
break;
|
||||
}
|
||||
default: return SQ_ERROR;
|
||||
}
|
||||
ScriptDateBase *res = new ScriptDateBase(static_cast<Date>(this->_date - days));
|
||||
res->AddRef();
|
||||
Squirrel::CreateClassInstanceVM(vm, Tag.value, res, nullptr, SQConvert::DefSQDestructorCallback<ScriptDateBase>, true);
|
||||
return 1;
|
||||
}
|
||||
|
||||
SQInteger _cmp(HSQUIRRELVM vm)
|
||||
{
|
||||
ScriptDateBase *other = static_cast<ScriptDateBase *>(Squirrel::GetRealInstance(vm, 2, Tag.value));
|
||||
if (other == nullptr) return SQ_ERROR;
|
||||
sq_pushinteger(vm, this->_date - other->_date);
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool SaveObject(HSQUIRRELVM vm) override
|
||||
{
|
||||
sq_pushstring(vm, Tag.value);
|
||||
sq_pushinteger(vm, this->_date);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LoadObject(HSQUIRRELVM vm) override
|
||||
{
|
||||
if (sq_gettype(vm, -1) != OT_INTEGER) return false;
|
||||
SQInteger val;
|
||||
sq_getinteger(vm, -1, &val);
|
||||
this->_date = static_cast<Date>(val);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
Date _date = DATE_INVALID;
|
||||
};
|
||||
|
||||
using ScriptEconomyDate = ScriptDateBase<TimerGameEconomy, EconomyTime, "EconomyDate">;
|
||||
using ScriptCalendarDate = ScriptDateBase<TimerGameCalendar, CalendarTime, "CalendarDate">;
|
||||
#else
|
||||
/**
|
||||
* Class that handles all date related (calculation) functions.
|
||||
* @api ai game
|
||||
|
@ -48,22 +216,23 @@
|
|||
* Economy-time will use a 360 day calendar (12 months with 30 days each), which runs at a constant speed of one economy-month per realtime-minute.
|
||||
* Calendar-time will use a Gregorian calendar, which can be slowed to stopped via game settings.
|
||||
*/
|
||||
class ScriptDate : public ScriptObject {
|
||||
class ScriptEconomyDate : public ScriptObject {
|
||||
public:
|
||||
/**
|
||||
* Date data type is an integer value. Use ScriptDate::GetDate to
|
||||
* Date data type is an integer value. Use ScriptEconomyDate::GetDate to
|
||||
* compose valid date values for a known year, month and day.
|
||||
*/
|
||||
enum Date {
|
||||
DATE_INVALID = ::EconomyTime::INVALID_DATE.base(), ///< A value representing an invalid date.
|
||||
DATE_INVALID, ///< A value representing an invalid date.
|
||||
};
|
||||
|
||||
ScriptEconomyDate(Date date = DATE_INVALID);
|
||||
|
||||
/**
|
||||
* Validates if a date value represent a valid date.
|
||||
* @param date The date to validate.
|
||||
* @return True if the date is valid, otherwise false
|
||||
*/
|
||||
static bool IsValidDate(Date date);
|
||||
bool IsValid();
|
||||
|
||||
/**
|
||||
* Get the current date.
|
||||
|
@ -72,28 +241,25 @@ public:
|
|||
* 100 but not by 400.
|
||||
* @return The current date.
|
||||
*/
|
||||
static Date GetCurrentDate();
|
||||
static ScriptEconomyDate GetCurrentDate();
|
||||
|
||||
/**
|
||||
* Get the year of the given date.
|
||||
* @param date The date to get the year of.
|
||||
* @return The year.
|
||||
*/
|
||||
static SQInteger GetYear(Date date);
|
||||
SQInteger GetYear();
|
||||
|
||||
/**
|
||||
* Get the month of the given date.
|
||||
* @param date The date to get the month of.
|
||||
* @return The month.
|
||||
*/
|
||||
static SQInteger GetMonth(Date date);
|
||||
SQInteger GetMonth();
|
||||
|
||||
/**
|
||||
* Get the day (of the month) of the given date.
|
||||
* @param date The date to get the day of.
|
||||
* @return The day.
|
||||
*/
|
||||
static SQInteger GetDayOfMonth(Date date);
|
||||
SQInteger GetDayOfMonth();
|
||||
|
||||
/**
|
||||
* Get the date given a year, month and day of month.
|
||||
|
@ -102,7 +268,7 @@ public:
|
|||
* @param day_of_month The day of month of the to-be determined date.
|
||||
* @return The date.
|
||||
*/
|
||||
static Date GetDate(SQInteger year, SQInteger month, SQInteger day_of_month);
|
||||
static ScriptEconomyDate GetDate(SQInteger year, SQInteger month, SQInteger day_of_month);
|
||||
|
||||
/**
|
||||
* Get the time of the host system.
|
||||
|
@ -111,6 +277,84 @@ public:
|
|||
* @note This uses the clock of the host system, which can skew or be set back. Use with caution.
|
||||
*/
|
||||
static SQInteger GetSystemTime();
|
||||
|
||||
/**
|
||||
* Get the date.
|
||||
* @return The date.
|
||||
*/
|
||||
Date date();
|
||||
};
|
||||
|
||||
|
||||
|
||||
class ScriptCalendarDate : public ScriptObject {
|
||||
public:
|
||||
/**
|
||||
* Date data type is an integer value. Use ScriptCalendarDate::GetDate to
|
||||
* compose valid date values for a known year, month and day.
|
||||
*/
|
||||
enum Date {
|
||||
DATE_INVALID, ///< A value representing an invalid date.
|
||||
};
|
||||
|
||||
ScriptCalendarDate(Date date = DATE_INVALID);
|
||||
|
||||
/**
|
||||
* Validates if a date value represent a valid date.
|
||||
* @return True if the date is valid, otherwise false
|
||||
*/
|
||||
bool IsValid();
|
||||
|
||||
/**
|
||||
* Get the current date.
|
||||
* This is the number of days since epoch under the assumption that
|
||||
* there is a leap year every 4 years, except when dividable by
|
||||
* 100 but not by 400.
|
||||
* @return The current date.
|
||||
*/
|
||||
static ScriptCalendarDate GetCurrentDate();
|
||||
|
||||
/**
|
||||
* Get the year of the given date.
|
||||
* @return The year.
|
||||
*/
|
||||
SQInteger GetYear();
|
||||
|
||||
/**
|
||||
* Get the month of the given date.
|
||||
* @return The month.
|
||||
*/
|
||||
SQInteger GetMonth();
|
||||
|
||||
/**
|
||||
* Get the day (of the month) of the given date.
|
||||
* @return The day.
|
||||
*/
|
||||
SQInteger GetDayOfMonth();
|
||||
|
||||
/**
|
||||
* Get the date given a year, month and day of month.
|
||||
* @param year The year of the to-be determined date.
|
||||
* @param month The month of the to-be determined date.
|
||||
* @param day_of_month The day of month of the to-be determined date.
|
||||
* @return The date.
|
||||
*/
|
||||
static ScriptCalendarDate GetDate(SQInteger year, SQInteger month, SQInteger day_of_month);
|
||||
|
||||
/**
|
||||
* Get the time of the host system.
|
||||
* @return The amount of seconds passed since 1 Jan 1970.
|
||||
* @api -ai
|
||||
* @note This uses the clock of the host system, which can skew or be set back. Use with caution.
|
||||
*/
|
||||
static SQInteger GetSystemTime();
|
||||
|
||||
/**
|
||||
* Get the date.
|
||||
* @return The date.
|
||||
*/
|
||||
Date date();
|
||||
};
|
||||
#endif /* DOXYGEN_API */
|
||||
|
||||
#endif /* SCRIPT_DATE_HPP */
|
||||
|
|
|
@ -169,11 +169,11 @@
|
|||
return ::Engine::Get(engine_id)->GetDisplayMaxTractiveEffort() / 1000;
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptEngine::GetDesignDate(EngineID engine_id)
|
||||
/* static */ ScriptCalendarDate *ScriptEngine::GetDesignDate(EngineID engine_id)
|
||||
{
|
||||
if (!IsValidEngine(engine_id)) return ScriptDate::DATE_INVALID;
|
||||
if (!IsValidEngine(engine_id)) return new ScriptCalendarDate();
|
||||
|
||||
return (ScriptDate::Date)::Engine::Get(engine_id)->intro_date.base();
|
||||
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(::Engine::Get(engine_id)->intro_date.base()));
|
||||
}
|
||||
|
||||
/* static */ ScriptVehicle::VehicleType ScriptEngine::GetVehicleType(EngineID engine_id)
|
||||
|
|
|
@ -173,7 +173,7 @@ public:
|
|||
* @return The calendar-date this engine was designed.
|
||||
* @see \ref ScriptCalendarTime
|
||||
*/
|
||||
static ScriptDate::Date GetDesignDate(EngineID engine_id);
|
||||
static ScriptCalendarDate *GetDesignDate(EngineID engine_id);
|
||||
|
||||
/**
|
||||
* Get the type of an engine.
|
||||
|
|
|
@ -49,11 +49,11 @@
|
|||
return ::StrMakeValid(::GetString(STR_INDUSTRY_NAME, industry_id), {});
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptIndustry::GetConstructionDate(IndustryID industry_id)
|
||||
/* static */ ScriptCalendarDate *ScriptIndustry::GetConstructionDate(IndustryID industry_id)
|
||||
{
|
||||
const Industry *i = Industry::GetIfValid(industry_id);
|
||||
if (i == nullptr) return ScriptDate::DATE_INVALID;
|
||||
return (ScriptDate::Date)i->construction_date.base();
|
||||
if (i == nullptr) return new ScriptCalendarDate();
|
||||
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(i->construction_date.base()));
|
||||
}
|
||||
|
||||
/* static */ bool ScriptIndustry::SetText(IndustryID industry_id, Text *text)
|
||||
|
@ -226,18 +226,18 @@
|
|||
return i->last_prod_year.base();
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptIndustry::GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type)
|
||||
/* static */ ScriptEconomyDate *ScriptIndustry::GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type)
|
||||
{
|
||||
const Industry *i = Industry::GetIfValid(industry_id);
|
||||
if (i == nullptr) return ScriptDate::DATE_INVALID;
|
||||
if (i == nullptr) return new ScriptEconomyDate();
|
||||
|
||||
if (!::IsValidCargoType(cargo_type)) {
|
||||
auto it = std::max_element(std::begin(i->accepted), std::end(i->accepted), [](const auto &a, const auto &b) { return a.last_accepted < b.last_accepted; });
|
||||
return (ScriptDate::Date)it->last_accepted.base();
|
||||
return new ScriptEconomyDate(static_cast<ScriptEconomyDate::Date>(it->last_accepted.base()));
|
||||
} else {
|
||||
auto it = i->GetCargoAccepted(cargo_type);
|
||||
if (it == std::end(i->accepted)) return ScriptDate::DATE_INVALID;
|
||||
return (ScriptDate::Date)it->last_accepted.base();
|
||||
if (it == std::end(i->accepted)) return new ScriptEconomyDate();
|
||||
return new ScriptEconomyDate(static_cast<ScriptEconomyDate::Date>(it->last_accepted.base()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public:
|
|||
* @see \ref ScriptCalendarTime
|
||||
* @api -ai
|
||||
*/
|
||||
static ScriptDate::Date GetConstructionDate(IndustryID industry_id);
|
||||
static ScriptCalendarDate *GetConstructionDate(IndustryID industry_id);
|
||||
|
||||
/**
|
||||
* Set the custom text of an industry, shown in the GUI.
|
||||
|
@ -265,11 +265,11 @@ public:
|
|||
* @param cargo_type The cargo to query, or INVALID_CARGO to query latest of all accepted cargoes.
|
||||
* @pre IsValidIndustry(industry_id).
|
||||
* @pre IsValidCargo(cargo_type) || cargo_type == INVALID_CARGO.
|
||||
* @return Economy-date the industry last received cargo from a delivery, or ScriptDate::DATE_INVALID on error.
|
||||
* @return Economy-date the industry last received cargo from a delivery, ScriptEconomyDate::IsValid() returns false on error.
|
||||
* @see \ref ScriptEconomyTime
|
||||
* @api -ai
|
||||
*/
|
||||
static ScriptDate::Date GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type);
|
||||
static ScriptEconomyDate *GetCargoLastAcceptedDate(IndustryID industry_id, CargoType cargo_type);
|
||||
|
||||
/**
|
||||
* Get the current control flags for an industry.
|
||||
|
|
|
@ -179,20 +179,21 @@ static inline bool StoryPageElementTypeRequiresText(StoryPageElementType type)
|
|||
return ScriptCompany::ToScriptCompanyID(StoryPage::Get(story_page_id)->company);
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptStoryPage::GetDate(StoryPageID story_page_id)
|
||||
/* static */ ScriptCalendarDate *ScriptStoryPage::GetDate(StoryPageID story_page_id)
|
||||
{
|
||||
EnforcePrecondition(ScriptDate::DATE_INVALID, IsValidStoryPage(story_page_id));
|
||||
EnforceDeityMode(ScriptDate::DATE_INVALID);
|
||||
EnforcePrecondition(new ScriptCalendarDate(), IsValidStoryPage(story_page_id));
|
||||
EnforceDeityMode(new ScriptCalendarDate());
|
||||
|
||||
return (ScriptDate::Date)StoryPage::Get(story_page_id)->date.base();
|
||||
return new ScriptCalendarDate(static_cast<ScriptCalendarDate::Date>(StoryPage::Get(story_page_id)->date.base()));
|
||||
}
|
||||
|
||||
/* static */ bool ScriptStoryPage::SetDate(StoryPageID story_page_id, ScriptDate::Date date)
|
||||
/* static */ bool ScriptStoryPage::SetDate(StoryPageID story_page_id, ScriptCalendarDate *date)
|
||||
{
|
||||
EnforcePrecondition(false, IsValidStoryPage(story_page_id));
|
||||
EnforceDeityMode(false);
|
||||
if (date == nullptr) date = new ScriptCalendarDate();
|
||||
|
||||
return ScriptObject::Command<CMD_SET_STORY_PAGE_DATE>::Do(story_page_id, ::TimerGameCalendar::Date{date});
|
||||
return ScriptObject::Command<CMD_SET_STORY_PAGE_DATE>::Do(story_page_id, ::TimerGameCalendar::Date{date->date()});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -256,18 +256,18 @@ public:
|
|||
* @pre IsValidStoryPage(story_page_id).
|
||||
* @see \ref ScriptCalendarTime
|
||||
*/
|
||||
static ScriptDate::Date GetDate(StoryPageID story_page_id);
|
||||
static ScriptCalendarDate *GetDate(StoryPageID story_page_id);
|
||||
|
||||
/**
|
||||
* Update date of a story page. The date is shown in the top left of the page
|
||||
* @param story_page_id The story page to set the date for.
|
||||
* @param date Calendar-date to display at the top of story page or ScriptDate::DATE_INVALID to disable showing date on this page. (also, @see ScriptDate)
|
||||
* @param date Calendar-date to display at the top of story page or null to disable showing date on this page. (also, @see ScriptCalendarDate)
|
||||
* @return True if the action succeeded.
|
||||
* @pre ScriptCompanyMode::IsDeity().
|
||||
* @pre IsValidStoryPage(story_page_id).
|
||||
* @see \ref ScriptCalendarTime
|
||||
*/
|
||||
static bool SetDate(StoryPageID story_page_id, ScriptDate::Date date);
|
||||
static bool SetDate(StoryPageID story_page_id, ScriptCalendarDate *date);
|
||||
|
||||
/**
|
||||
* Update title of a story page. The title is shown in the page selector drop down.
|
||||
|
|
|
@ -53,9 +53,9 @@
|
|||
return ScriptCompany::ToScriptCompanyID(::Subsidy::Get(subsidy_id)->awarded);
|
||||
}
|
||||
|
||||
/* static */ ScriptDate::Date ScriptSubsidy::GetExpireDate(SubsidyID subsidy_id)
|
||||
/* static */ ScriptEconomyDate *ScriptSubsidy::GetExpireDate(SubsidyID subsidy_id)
|
||||
{
|
||||
if (!IsValidSubsidy(subsidy_id)) return ScriptDate::DATE_INVALID;
|
||||
if (!IsValidSubsidy(subsidy_id)) return new ScriptEconomyDate();
|
||||
|
||||
TimerGameEconomy::YearMonthDay ymd = TimerGameEconomy::ConvertDateToYMD(TimerGameEconomy::date);
|
||||
ymd.day = 1;
|
||||
|
@ -63,7 +63,7 @@
|
|||
ymd.month = m % 12;
|
||||
ymd.year += TimerGameEconomy::Year{m / 12};
|
||||
|
||||
return (ScriptDate::Date)TimerGameEconomy::ConvertYMDToDate(ymd.year, ymd.month, ymd.day).base();
|
||||
return ScriptEconomyDate::GetDate(ymd.year.base(), ymd.month + 1, ymd.day);
|
||||
}
|
||||
|
||||
/* static */ CargoType ScriptSubsidy::GetCargoType(SubsidyID subsidy_id)
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
* awarded.
|
||||
* @see \ref ScriptEconomyTime
|
||||
*/
|
||||
static ScriptDate::Date GetExpireDate(SubsidyID subsidy_id);
|
||||
static ScriptEconomyDate *GetExpireDate(SubsidyID subsidy_id);
|
||||
|
||||
/**
|
||||
* Get the cargo type that has to be transported in order to be awarded this
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* This file is part of OpenTTD.
|
||||
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
||||
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../script_date.hpp"
|
||||
|
||||
namespace SQConvert {
|
||||
/* Allow ScriptEconomyDate to be used as Squirrel parameter */
|
||||
template <> struct Param<ScriptEconomyDate *> { static inline ScriptEconomyDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptEconomyDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
|
||||
template <> struct Param<ScriptEconomyDate &> { static inline ScriptEconomyDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptEconomyDate *>(Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
|
||||
template <> struct Param<const ScriptEconomyDate *> { static inline const ScriptEconomyDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptEconomyDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
|
||||
template <> struct Param<const ScriptEconomyDate &> { static inline const ScriptEconomyDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptEconomyDate *>(Squirrel::GetRealInstance(vm, index, "EconomyDate")); } };
|
||||
template <> struct Return<ScriptEconomyDate *> { static inline int Set(HSQUIRRELVM vm, ScriptEconomyDate *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EconomyDate", res, nullptr, DefSQDestructorCallback<ScriptEconomyDate>, true); return 1; } };
|
||||
|
||||
/* Allow ScriptCalendarDate to be used as Squirrel parameter */
|
||||
template <> struct Param<ScriptCalendarDate *> { static inline ScriptCalendarDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptCalendarDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
|
||||
template <> struct Param<ScriptCalendarDate &> { static inline ScriptCalendarDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptCalendarDate *>(Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
|
||||
template <> struct Param<const ScriptCalendarDate *> { static inline const ScriptCalendarDate *Get(HSQUIRRELVM vm, int index) { return static_cast<ScriptCalendarDate *>(sq_gettype(vm, index) == OT_NULL ? nullptr : Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
|
||||
template <> struct Param<const ScriptCalendarDate &> { static inline const ScriptCalendarDate &Get(HSQUIRRELVM vm, int index) { return *static_cast<ScriptCalendarDate *>(Squirrel::GetRealInstance(vm, index, "CalendarDate")); } };
|
||||
template <> struct Return<ScriptCalendarDate *> { static inline int Set(HSQUIRRELVM vm, ScriptCalendarDate *res) { if (res == nullptr) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "CalendarDate", res, nullptr, DefSQDestructorCallback<ScriptCalendarDate>, true); return 1; } };
|
||||
} // namespace SQConvert
|
|
@ -1717,7 +1717,7 @@ public:
|
|||
const NWidgetBase *wid = this->GetWidget<NWidgetBase>(WID_SM_MAP);
|
||||
Point zoom_pt = { (int)wid->current_x / 2, (int)wid->current_y / 2};
|
||||
this->SetZoomLevel((widget == WID_SM_ZOOM_IN) ? ZLC_ZOOM_IN : ZLC_ZOOM_OUT, &zoom_pt);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1729,13 +1729,13 @@ public:
|
|||
case WID_SM_VEGETATION: // Show vegetation
|
||||
case WID_SM_OWNERS: // Show land owners
|
||||
this->SwitchMapType((SmallMapType)(widget - WID_SM_CONTOUR));
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_SM_CENTERMAP: // Center the smallmap again
|
||||
this->SmallMapCenterOnCurrentPos();
|
||||
this->HandleButtonClick(WID_SM_CENTERMAP);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_SM_TOGGLETOWNNAME: // Toggle town names
|
||||
|
@ -1743,7 +1743,7 @@ public:
|
|||
this->SetWidgetLoweredState(WID_SM_TOGGLETOWNNAME, this->show_towns);
|
||||
|
||||
this->SetDirty();
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_SM_SHOW_IND_NAMES: // Toggle industry names
|
||||
|
@ -1751,7 +1751,7 @@ public:
|
|||
this->SetWidgetLoweredState(WID_SM_SHOW_IND_NAMES, this->show_ind_names);
|
||||
|
||||
this->SetDirty();
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
break;
|
||||
|
||||
case WID_SM_LEGEND: // Legend
|
||||
|
|
|
@ -247,6 +247,22 @@ void SndPlayFx(SoundID sound)
|
|||
StartSound(sound, 0.5, UINT8_MAX);
|
||||
}
|
||||
|
||||
/**
|
||||
* Play a beep sound for a click event if enabled in settings.
|
||||
*/
|
||||
void SndClickBeep()
|
||||
{
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Play a beep sound for a confirm event if enabled in settings.
|
||||
*/
|
||||
void SndConfirmBeep()
|
||||
{
|
||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
||||
}
|
||||
|
||||
/** Names corresponding to the sound set's files */
|
||||
static const std::string_view _sound_file_names[] = { "samples" };
|
||||
|
||||
|
|
|
@ -21,4 +21,7 @@ void SndPlayVehicleFx(SoundID sound, const Vehicle *v);
|
|||
void SndPlayFx(SoundID sound);
|
||||
void SndCopyToPool();
|
||||
|
||||
void SndClickBeep();
|
||||
void SndConfirmBeep();
|
||||
|
||||
#endif /* SOUND_FUNC_H */
|
||||
|
|
|
@ -47,7 +47,7 @@ static const PalSpriteID _aqueduct_sprite_table_heads[] = {
|
|||
{SPR_AQUEDUCT_RAMP_SW, PAL_NONE}, {SPR_AQUEDUCT_RAMP_SE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NE, PAL_NONE}, {SPR_AQUEDUCT_RAMP_NW, PAL_NONE},
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_4_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_oxide_north[] = {
|
||||
{ 0x9A9, PAL_NONE }, { 0x99F, PAL_NONE }, { 0x9B1, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9A5, PAL_NONE }, { 0x997, PAL_NONE }, { 0x9AD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x99D, PAL_NONE }, { 0x99F, PAL_NONE }, { 0x9B1, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -58,7 +58,7 @@ static const PalSpriteID _bridge_sprite_table_4_0[] = {
|
|||
{ 0x1116, PAL_NONE }, { 0x997, PAL_NONE }, { 0x9AD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_4_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_oxide_south[] = {
|
||||
{ 0x9AA, PAL_NONE }, { 0x9A0, PAL_NONE }, { 0x9B2, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9A6, PAL_NONE }, { 0x998, PAL_NONE }, { 0x9AE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x99E, PAL_NONE }, { 0x9A0, PAL_NONE }, { 0x9B2, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -69,7 +69,7 @@ static const PalSpriteID _bridge_sprite_table_4_1[] = {
|
|||
{ 0x1117, PAL_NONE }, { 0x998, PAL_NONE }, { 0x9AE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_4_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_oxide_inner_north[] = {
|
||||
{ 0x9AC, PAL_NONE }, { 0x9A4, PAL_NONE }, { 0x9B4, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9A8, PAL_NONE }, { 0x99C, PAL_NONE }, { 0x9B0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9A2, PAL_NONE }, { 0x9A4, PAL_NONE }, { 0x9B4, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -80,7 +80,7 @@ static const PalSpriteID _bridge_sprite_table_4_2[] = {
|
|||
{ 0x1119, PAL_NONE }, { 0x99C, PAL_NONE }, { 0x9B0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_4_3[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_oxide_inner_south[] = {
|
||||
{ 0x9AB, PAL_NONE }, { 0x9A3, PAL_NONE }, { 0x9B3, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9A7, PAL_NONE }, { 0x99B, PAL_NONE }, { 0x9AF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9A1, PAL_NONE }, { 0x9A3, PAL_NONE }, { 0x9B3, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -91,7 +91,7 @@ static const PalSpriteID _bridge_sprite_table_4_3[] = {
|
|||
{ 0x1118, PAL_NONE }, { 0x99B, PAL_NONE }, { 0x9AF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_4_4[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_oxide_middle_odd[] = {
|
||||
{ 0x9B6, PAL_NONE }, { 0x9BA, PAL_NONE }, { 0x9BC, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9B5, PAL_NONE }, { 0x9B9, PAL_NONE }, { 0x9BB, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9B8, PAL_NONE }, { 0x9BA, PAL_NONE }, { 0x9BC, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -102,7 +102,7 @@ static const PalSpriteID _bridge_sprite_table_4_4[] = {
|
|||
{ 0x111E, PAL_NONE }, { 0x9B9, PAL_NONE }, { 0x9BB, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_4_5[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_middle_even[] = {
|
||||
{ 0x9BD, PAL_NONE }, { 0x9C1, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9BE, PAL_NONE }, { 0x9C2, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9BF, PAL_NONE }, { 0x9C1, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -113,7 +113,7 @@ static const PalSpriteID _bridge_sprite_table_4_5[] = {
|
|||
{ 0x1121, PAL_NONE }, { 0x9C2, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_4_6[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_generic_oxide_heads[] = {
|
||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||
{ 0x98E, PAL_NONE }, { 0x990, PAL_NONE }, { 0x98D, PAL_NONE }, { 0x98F, PAL_NONE },
|
||||
|
@ -124,7 +124,7 @@ static const PalSpriteID _bridge_sprite_table_4_6[] = {
|
|||
{ 0x1113, PAL_NONE }, { 0x1115, PAL_NONE }, { 0x1112, PAL_NONE }, { 0x1114, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_5_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_yellow_north[] = {
|
||||
{ 0x9A9, PALETTE_TO_STRUCT_YELLOW }, { 0x99F, PALETTE_TO_STRUCT_YELLOW }, { 0x9B1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9A5, PALETTE_TO_STRUCT_YELLOW }, { 0x997, PALETTE_TO_STRUCT_YELLOW }, { 0x9AD, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x99D, PALETTE_TO_STRUCT_YELLOW }, { 0x99F, PALETTE_TO_STRUCT_YELLOW }, { 0x9B1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
|
@ -135,7 +135,7 @@ static const PalSpriteID _bridge_sprite_table_5_0[] = {
|
|||
{ 0x1116, PALETTE_TO_STRUCT_YELLOW }, { 0x997, PALETTE_TO_STRUCT_YELLOW }, { 0x9AD, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_5_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_yellow_south[] = {
|
||||
{ 0x9AA, PALETTE_TO_STRUCT_YELLOW }, { 0x9A0, PALETTE_TO_STRUCT_YELLOW }, { 0x9B2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9A6, PALETTE_TO_STRUCT_YELLOW }, { 0x998, PALETTE_TO_STRUCT_YELLOW }, { 0x9AE, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x99E, PALETTE_TO_STRUCT_YELLOW }, { 0x9A0, PALETTE_TO_STRUCT_YELLOW }, { 0x9B2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
|
@ -146,7 +146,7 @@ static const PalSpriteID _bridge_sprite_table_5_1[] = {
|
|||
{ 0x1117, PALETTE_TO_STRUCT_YELLOW }, { 0x998, PALETTE_TO_STRUCT_YELLOW }, { 0x9AE, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_5_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_yellow_inner_north[] = {
|
||||
{ 0x9AC, PALETTE_TO_STRUCT_YELLOW }, { 0x9A4, PALETTE_TO_STRUCT_YELLOW }, { 0x9B4, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9A8, PALETTE_TO_STRUCT_YELLOW }, { 0x99C, PALETTE_TO_STRUCT_YELLOW }, { 0x9B0, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9A2, PALETTE_TO_STRUCT_YELLOW }, { 0x9A4, PALETTE_TO_STRUCT_YELLOW }, { 0x9B4, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
|
@ -157,7 +157,7 @@ static const PalSpriteID _bridge_sprite_table_5_2[] = {
|
|||
{ 0x1119, PALETTE_TO_STRUCT_YELLOW }, { 0x99C, PALETTE_TO_STRUCT_YELLOW }, { 0x9B0, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_5_3[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_yellow_inner_south[] = {
|
||||
{ 0x9AB, PALETTE_TO_STRUCT_YELLOW }, { 0x9A3, PALETTE_TO_STRUCT_YELLOW }, { 0x9B3, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9A7, PALETTE_TO_STRUCT_YELLOW }, { 0x99B, PALETTE_TO_STRUCT_YELLOW }, { 0x9AF, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9A1, PALETTE_TO_STRUCT_YELLOW }, { 0x9A3, PALETTE_TO_STRUCT_YELLOW }, { 0x9B3, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
|
@ -168,7 +168,7 @@ static const PalSpriteID _bridge_sprite_table_5_3[] = {
|
|||
{ 0x1118, PALETTE_TO_STRUCT_YELLOW }, { 0x99B, PALETTE_TO_STRUCT_YELLOW }, { 0x9AF, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_5_4[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_yellow_middle_odd[] = {
|
||||
{ 0x9B6, PALETTE_TO_STRUCT_YELLOW }, { 0x9BA, PALETTE_TO_STRUCT_YELLOW }, { 0x9BC, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9B5, PALETTE_TO_STRUCT_YELLOW }, { 0x9B9, PALETTE_TO_STRUCT_YELLOW }, { 0x9BB, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0x9B8, PALETTE_TO_STRUCT_YELLOW }, { 0x9BA, PALETTE_TO_STRUCT_YELLOW }, { 0x9BC, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
|
@ -179,7 +179,7 @@ static const PalSpriteID _bridge_sprite_table_5_4[] = {
|
|||
{ 0x111E, PALETTE_TO_STRUCT_YELLOW }, { 0x9B9, PALETTE_TO_STRUCT_YELLOW }, { 0x9BB, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_5_5[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_yellow_middle_even[] = {
|
||||
{ 0x9BD, PALETTE_TO_STRUCT_YELLOW }, { 0x9C1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9BE, PALETTE_TO_STRUCT_YELLOW }, { 0x9C2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9BF, PALETTE_TO_STRUCT_YELLOW }, { 0x9C1, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -190,7 +190,7 @@ static const PalSpriteID _bridge_sprite_table_5_5[] = {
|
|||
{ 0x1121, PALETTE_TO_STRUCT_YELLOW }, { 0x9C2, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_5_6[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_generic_yellow_heads[] = {
|
||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||
{ 0x98E, PALETTE_TO_STRUCT_YELLOW }, { 0x990, PALETTE_TO_STRUCT_YELLOW }, { 0x98D, PALETTE_TO_STRUCT_YELLOW }, { 0x98F, PALETTE_TO_STRUCT_YELLOW },
|
||||
|
@ -201,7 +201,7 @@ static const PalSpriteID _bridge_sprite_table_5_6[] = {
|
|||
{ 0x1113, PALETTE_TO_STRUCT_YELLOW }, { 0x1115, PALETTE_TO_STRUCT_YELLOW }, { 0x1112, PALETTE_TO_STRUCT_YELLOW }, { 0x1114, PALETTE_TO_STRUCT_YELLOW },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_6_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_north[] = {
|
||||
{ 0x9CD, PAL_NONE }, { 0x9D9, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9CE, PAL_NONE }, { 0x9DA, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9D3, PAL_NONE }, { 0x9D9, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -212,7 +212,7 @@ static const PalSpriteID _bridge_sprite_table_6_0[] = {
|
|||
{ 0x1125, PAL_NONE }, { 0x9DA, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_6_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_south[] = {
|
||||
{ 0x9CB, PAL_NONE }, { 0x9D7, PAL_NONE }, { 0x9DD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9D0, PAL_NONE }, { 0x9DC, PAL_NONE }, { 0x9E0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9D1, PAL_NONE }, { 0x9D7, PAL_NONE }, { 0x9DD, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -223,7 +223,7 @@ static const PalSpriteID _bridge_sprite_table_6_1[] = {
|
|||
{ 0x1127, PAL_NONE }, { 0x9DC, PAL_NONE }, { 0x9E0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_6_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_middle[] = {
|
||||
{ 0x9CC, PAL_NONE }, { 0x9D8, PAL_NONE }, { 0x9DE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9CF, PAL_NONE }, { 0x9DB, PAL_NONE }, { 0x9DF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9D2, PAL_NONE }, { 0x9D8, PAL_NONE }, { 0x9DE, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -234,7 +234,7 @@ static const PalSpriteID _bridge_sprite_table_6_2[] = {
|
|||
{ 0x1126, PAL_NONE }, { 0x9DB, PAL_NONE }, { 0x9DF, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_6_3[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_oxide_heads[] = {
|
||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||
{ 0x98E, PAL_NONE }, { 0x990, PAL_NONE }, { 0x98D, PAL_NONE }, { 0x98F, PAL_NONE },
|
||||
|
@ -245,7 +245,7 @@ static const PalSpriteID _bridge_sprite_table_6_3[] = {
|
|||
{ 0x1113, PAL_NONE }, { 0x1115, PAL_NONE }, { 0x1112, PAL_NONE }, { 0x1114, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_7_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_brown_north[] = {
|
||||
{ 0x9CD, PALETTE_TO_STRUCT_BROWN }, { 0x9D9, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9CE, PALETTE_TO_STRUCT_BROWN }, { 0x9DA, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9D3, PALETTE_TO_STRUCT_BROWN }, { 0x9D9, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -256,7 +256,7 @@ static const PalSpriteID _bridge_sprite_table_7_0[] = {
|
|||
{ 0x1125, PALETTE_TO_STRUCT_BROWN }, { 0x9DA, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_7_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_brown_south[] = {
|
||||
{ 0x9CB, PALETTE_TO_STRUCT_BROWN }, { 0x9D7, PALETTE_TO_STRUCT_BROWN }, { 0x9DD, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
{ 0x9D0, PALETTE_TO_STRUCT_BROWN }, { 0x9DC, PALETTE_TO_STRUCT_BROWN }, { 0x9E0, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
{ 0x9D1, PALETTE_TO_STRUCT_BROWN }, { 0x9D7, PALETTE_TO_STRUCT_BROWN }, { 0x9DD, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
|
@ -267,7 +267,7 @@ static const PalSpriteID _bridge_sprite_table_7_1[] = {
|
|||
{ 0x1127, PALETTE_TO_STRUCT_BROWN }, { 0x9DC, PALETTE_TO_STRUCT_BROWN }, { 0x9E0, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_7_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_brown_middle[] = {
|
||||
{ 0x9CC, PALETTE_TO_STRUCT_BROWN }, { 0x9D8, PALETTE_TO_STRUCT_BROWN }, { 0x9DE, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
{ 0x9CF, PALETTE_TO_STRUCT_BROWN }, { 0x9DB, PALETTE_TO_STRUCT_BROWN }, { 0x9DF, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
{ 0x9D2, PALETTE_TO_STRUCT_BROWN }, { 0x9D8, PALETTE_TO_STRUCT_BROWN }, { 0x9DE, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
|
@ -278,7 +278,7 @@ static const PalSpriteID _bridge_sprite_table_7_2[] = {
|
|||
{ 0x1126, PALETTE_TO_STRUCT_BROWN }, { 0x9DB, PALETTE_TO_STRUCT_BROWN }, { 0x9DF, PALETTE_TO_STRUCT_BROWN }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_7_3[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_brown_heads[] = {
|
||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||
{ 0x98E, PALETTE_TO_STRUCT_BROWN }, { 0x990, PALETTE_TO_STRUCT_BROWN }, { 0x98D, PALETTE_TO_STRUCT_BROWN }, { 0x98F, PALETTE_TO_STRUCT_BROWN },
|
||||
|
@ -289,7 +289,7 @@ static const PalSpriteID _bridge_sprite_table_7_3[] = {
|
|||
{ 0x1113, PALETTE_TO_STRUCT_BROWN }, { 0x1115, PALETTE_TO_STRUCT_BROWN }, { 0x1112, PALETTE_TO_STRUCT_BROWN }, { 0x1114, PALETTE_TO_STRUCT_BROWN },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_8_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_red_north[] = {
|
||||
{ 0x9CD, PALETTE_TO_STRUCT_RED }, { 0x9D9, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9CE, PALETTE_TO_STRUCT_RED }, { 0x9DA, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9D3, PALETTE_TO_STRUCT_RED }, { 0x9D9, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -300,7 +300,7 @@ static const PalSpriteID _bridge_sprite_table_8_0[] = {
|
|||
{ 0x1125, PALETTE_TO_STRUCT_RED }, { 0x9DA, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_8_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_red_south[] = {
|
||||
{ 0x9CB, PALETTE_TO_STRUCT_RED }, { 0x9D7, PALETTE_TO_STRUCT_RED }, { 0x9DD, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
{ 0x9D0, PALETTE_TO_STRUCT_RED }, { 0x9DC, PALETTE_TO_STRUCT_RED }, { 0x9E0, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
{ 0x9D1, PALETTE_TO_STRUCT_RED }, { 0x9D7, PALETTE_TO_STRUCT_RED }, { 0x9DD, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
|
@ -311,7 +311,7 @@ static const PalSpriteID _bridge_sprite_table_8_1[] = {
|
|||
{ 0x1127, PALETTE_TO_STRUCT_RED }, { 0x9DC, PALETTE_TO_STRUCT_RED }, { 0x9E0, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_8_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_red_middle[] = {
|
||||
{ 0x9CC, PALETTE_TO_STRUCT_RED }, { 0x9D8, PALETTE_TO_STRUCT_RED }, { 0x9DE, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
{ 0x9CF, PALETTE_TO_STRUCT_RED }, { 0x9DB, PALETTE_TO_STRUCT_RED }, { 0x9DF, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
{ 0x9D2, PALETTE_TO_STRUCT_RED }, { 0x9D8, PALETTE_TO_STRUCT_RED }, { 0x9DE, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
|
@ -322,7 +322,7 @@ static const PalSpriteID _bridge_sprite_table_8_2[] = {
|
|||
{ 0x1126, PALETTE_TO_STRUCT_RED }, { 0x9DB, PALETTE_TO_STRUCT_RED }, { 0x9DF, PALETTE_TO_STRUCT_RED }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_8_3[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_cantilever_red_heads[] = {
|
||||
{ 0x986, PAL_NONE }, { 0x988, PAL_NONE }, { 0x985, PAL_NONE }, { 0x987, PAL_NONE },
|
||||
{ 0x98A, PAL_NONE }, { 0x98C, PAL_NONE }, { 0x989, PAL_NONE }, { 0x98B, PAL_NONE },
|
||||
{ 0x98E, PALETTE_TO_STRUCT_RED }, { 0x990, PALETTE_TO_STRUCT_RED }, { 0x98D, PALETTE_TO_STRUCT_RED }, { 0x98F, PALETTE_TO_STRUCT_RED },
|
||||
|
@ -399,7 +399,7 @@ static const PalSpriteID _bridge_sprite_table_archgirder_heads[] = {
|
|||
MW( SPR_BTGEN_MGLV_RAMP_X_DOWN ), MW( SPR_BTGEN_MGLV_RAMP_Y_DOWN ), MW( SPR_BTGEN_MGLV_RAMP_X_UP ), MW( SPR_BTGEN_MGLV_RAMP_Y_UP ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_A[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_concrete_north[] = {
|
||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_A ), MC( SPR_BTSUS_X_FRONT_TILE_A ), MC( SPR_BTSUS_X_PILLAR_TILE_A ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_A ), MC( SPR_BTSUS_Y_FRONT_TILE_A ), MC( SPR_BTSUS_Y_PILLAR_TILE_A ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_A ), MC( SPR_BTSUS_X_FRONT_TILE_A ), MC( SPR_BTSUS_X_PILLAR_TILE_A ), MN( 0x0 ),
|
||||
|
@ -410,7 +410,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_A[] = {
|
|||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_A ), MC( SPR_BTSUS_Y_FRONT_TILE_A ), MC( SPR_BTSUS_Y_PILLAR_TILE_A ), MN( 0x0 ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_B[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_concrete_south[] = {
|
||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_B ), MC( SPR_BTSUS_X_FRONT_TILE_B ), MC( SPR_BTSUS_X_PILLAR_TILE_B ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_B ), MC( SPR_BTSUS_Y_FRONT_TILE_B ), MC( SPR_BTSUS_Y_PILLAR_TILE_B ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_B ), MC( SPR_BTSUS_X_FRONT_TILE_B ), MC( SPR_BTSUS_X_PILLAR_TILE_B ), MN( 0x0 ),
|
||||
|
@ -421,7 +421,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_B[] = {
|
|||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_B ), MC( SPR_BTSUS_Y_FRONT_TILE_B ), MC( SPR_BTSUS_Y_PILLAR_TILE_B ), MN( 0x0 ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_C[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_concrete_inner_north[] = {
|
||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_C ), MC( SPR_BTSUS_X_FRONT_TILE_C ), MC( SPR_BTSUS_X_PILLAR_TILE_C ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_C ), MC( SPR_BTSUS_Y_FRONT_TILE_C ), MC( SPR_BTSUS_Y_PILLAR_TILE_C ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_C ), MC( SPR_BTSUS_X_FRONT_TILE_C ), MC( SPR_BTSUS_X_PILLAR_TILE_C ), MN( 0x0 ),
|
||||
|
@ -432,7 +432,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_C[] = {
|
|||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_C ), MC( SPR_BTSUS_Y_FRONT_TILE_C ), MC( SPR_BTSUS_Y_PILLAR_TILE_C ), MN( 0x0 ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_D[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_concrete_inner_south[] = {
|
||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_D ), MC( SPR_BTSUS_X_FRONT_TILE_D ), MC( SPR_BTSUS_X_PILLAR_TILE_D ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_D ), MC( SPR_BTSUS_Y_FRONT_TILE_D ), MC( SPR_BTSUS_Y_PILLAR_TILE_D ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_D ), MC( SPR_BTSUS_X_FRONT_TILE_D ), MC( SPR_BTSUS_X_PILLAR_TILE_D ), MN( 0x0 ),
|
||||
|
@ -443,7 +443,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_D[] = {
|
|||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_D ), MC( SPR_BTSUS_Y_FRONT_TILE_D ), MC( SPR_BTSUS_Y_PILLAR_TILE_D ), MN( 0x0 ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_E[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_concrete_middle_odd[] = {
|
||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_E ), MC( SPR_BTSUS_X_FRONT_TILE_E ), MC( SPR_BTSUS_X_PILLAR_TILE_E ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_E ), MC( SPR_BTSUS_Y_FRONT_TILE_E ), MC( SPR_BTSUS_Y_PILLAR_TILE_E ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_E ), MC( SPR_BTSUS_X_FRONT_TILE_E ), MC( SPR_BTSUS_X_PILLAR_TILE_E ), MN( 0x0 ),
|
||||
|
@ -454,7 +454,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_E[] = {
|
|||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_E ), MC( SPR_BTSUS_Y_FRONT_TILE_E ), MC( SPR_BTSUS_Y_PILLAR_TILE_E ), MN( 0x0 ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_F[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_suspension_concrete_middle_even[] = {
|
||||
MC( SPR_BTSUS_RAIL_X_REAR_TILE_F ), MC( SPR_BTSUS_X_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_RAIL_Y_REAR_TILE_F ), MC( SPR_BTSUS_Y_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||
MC( SPR_BTSUS_ROAD_X_REAR_TILE_F ), MC( SPR_BTSUS_X_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||
|
@ -465,7 +465,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_F[] = {
|
|||
MC( SPR_BTSUS_MGLV_Y_REAR_TILE_F ), MC( SPR_BTSUS_Y_FRONT ), MN( 0x0 ), MN( 0x0 ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_concrete_suspended_heads[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_generic_concrete_heads[] = {
|
||||
MN( SPR_BTGEN_RAIL_X_SLOPE_UP ), MN( SPR_BTGEN_RAIL_Y_SLOPE_UP ), MN( SPR_BTGEN_RAIL_X_SLOPE_DOWN ), MN( SPR_BTGEN_RAIL_Y_SLOPE_DOWN ),
|
||||
MN( SPR_BTGEN_RAIL_RAMP_X_DOWN ), MN( SPR_BTGEN_RAIL_RAMP_Y_DOWN ), MN( SPR_BTGEN_RAIL_RAMP_X_UP ), MN( SPR_BTGEN_RAIL_RAMP_Y_UP ),
|
||||
MC( SPR_BTGEN_ROAD_X_SLOPE_UP ), MC( SPR_BTGEN_ROAD_Y_SLOPE_UP ), MC( SPR_BTGEN_ROAD_X_SLOPE_DOWN ), MC( SPR_BTGEN_ROAD_Y_SLOPE_DOWN ),
|
||||
|
@ -476,7 +476,7 @@ static const PalSpriteID _bridge_sprite_table_concrete_suspended_heads[] = {
|
|||
MC( SPR_BTGEN_MGLV_RAMP_X_DOWN ), MC( SPR_BTGEN_MGLV_RAMP_Y_DOWN ), MC( SPR_BTGEN_MGLV_RAMP_X_UP ), MC( SPR_BTGEN_MGLV_RAMP_Y_UP ),
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_9_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_girder_middle[] = {
|
||||
{ 0x9F9, PAL_NONE }, { 0x9FD, PAL_NONE }, { 0x9C9, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9FA, PAL_NONE }, { 0x9FE, PAL_NONE }, { 0x9CA, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0x9FB, PAL_NONE }, { 0x9FD, PAL_NONE }, { 0x9C9, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -487,7 +487,7 @@ static const PalSpriteID _bridge_sprite_table_9_0[] = {
|
|||
{ 0x1133, PAL_NONE }, { 0x9FE, PAL_NONE }, { 0x9CA, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_10_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_oxide_north[] = {
|
||||
{ 0xA0B, PAL_NONE }, { 0xA01, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0C, PAL_NONE }, { 0xA02, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA11, PAL_NONE }, { 0xA01, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -498,7 +498,7 @@ static const PalSpriteID _bridge_sprite_table_10_0[] = {
|
|||
{ 0xA1E, PAL_NONE }, { 0xA02, PAL_NONE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_10_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_oxide_south[] = {
|
||||
{ 0xA09, PAL_NONE }, { 0x9FF, PAL_NONE }, { 0xA05, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0E, PAL_NONE }, { 0xA04, PAL_NONE }, { 0xA08, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0F, PAL_NONE }, { 0x9FF, PAL_NONE }, { 0xA05, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -509,7 +509,7 @@ static const PalSpriteID _bridge_sprite_table_10_1[] = {
|
|||
{ 0xA20, PAL_NONE }, { 0xA04, PAL_NONE }, { 0xA08, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_10_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_oxide_middle[] = {
|
||||
{ 0xA0A, PAL_NONE }, { 0xA00, PAL_NONE }, { 0xA06, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0D, PAL_NONE }, { 0xA03, PAL_NONE }, { 0xA07, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA10, PAL_NONE }, { 0xA00, PAL_NONE }, { 0xA06, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -520,7 +520,7 @@ static const PalSpriteID _bridge_sprite_table_10_2[] = {
|
|||
{ 0xA1F, PAL_NONE }, { 0xA03, PAL_NONE }, { 0xA07, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_11_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_yellow_north[] = {
|
||||
{ 0xA0B, PALETTE_TO_STRUCT_YELLOW }, { 0xA01, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0C, PALETTE_TO_STRUCT_YELLOW }, { 0xA02, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA11, PALETTE_TO_STRUCT_YELLOW }, { 0xA01, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -531,7 +531,7 @@ static const PalSpriteID _bridge_sprite_table_11_0[] = {
|
|||
{ 0xA1E, PALETTE_TO_STRUCT_YELLOW }, { 0xA02, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_11_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_yellow_south[] = {
|
||||
{ 0xA09, PALETTE_TO_STRUCT_YELLOW }, { 0x9FF, PALETTE_TO_STRUCT_YELLOW }, { 0xA05, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0xA0E, PALETTE_TO_STRUCT_YELLOW }, { 0xA04, PALETTE_TO_STRUCT_YELLOW }, { 0xA08, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0xA0F, PALETTE_TO_STRUCT_YELLOW }, { 0x9FF, PALETTE_TO_STRUCT_YELLOW }, { 0xA05, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
|
@ -542,7 +542,7 @@ static const PalSpriteID _bridge_sprite_table_11_1[] = {
|
|||
{ 0xA20, PALETTE_TO_STRUCT_YELLOW }, { 0xA04, PALETTE_TO_STRUCT_YELLOW }, { 0xA08, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_11_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_yellow_middle[] = {
|
||||
{ 0xA0A, PALETTE_TO_STRUCT_YELLOW }, { 0xA00, PALETTE_TO_STRUCT_YELLOW }, { 0xA06, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0xA0D, PALETTE_TO_STRUCT_YELLOW }, { 0xA03, PALETTE_TO_STRUCT_YELLOW }, { 0xA07, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
{ 0xA10, PALETTE_TO_STRUCT_YELLOW }, { 0xA00, PALETTE_TO_STRUCT_YELLOW }, { 0xA06, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
|
@ -553,7 +553,7 @@ static const PalSpriteID _bridge_sprite_table_11_2[] = {
|
|||
{ 0xA1F, PALETTE_TO_STRUCT_YELLOW }, { 0xA03, PALETTE_TO_STRUCT_YELLOW }, { 0xA07, PALETTE_TO_STRUCT_YELLOW }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_12_0[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_silicon_north[] = {
|
||||
{ 0xA0B, PALETTE_TO_STRUCT_CONCRETE }, { 0xA01, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0C, PALETTE_TO_STRUCT_CONCRETE }, { 0xA02, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
{ 0xA11, PALETTE_TO_STRUCT_CONCRETE }, { 0xA01, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
|
@ -564,7 +564,7 @@ static const PalSpriteID _bridge_sprite_table_12_0[] = {
|
|||
{ 0xA1E, PALETTE_TO_STRUCT_CONCRETE }, { 0xA02, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_12_1[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_silicon_south[] = {
|
||||
{ 0xA09, PALETTE_TO_STRUCT_CONCRETE }, { 0x9FF, PALETTE_TO_STRUCT_CONCRETE }, { 0xA05, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0E, PALETTE_TO_STRUCT_CONCRETE }, { 0xA04, PALETTE_TO_STRUCT_CONCRETE }, { 0xA08, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0F, PALETTE_TO_STRUCT_CONCRETE }, { 0x9FF, PALETTE_TO_STRUCT_CONCRETE }, { 0xA05, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||
|
@ -575,7 +575,7 @@ static const PalSpriteID _bridge_sprite_table_12_1[] = {
|
|||
{ 0xA20, PALETTE_TO_STRUCT_CONCRETE }, { 0xA04, PALETTE_TO_STRUCT_CONCRETE }, { 0xA08, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||
};
|
||||
|
||||
static const PalSpriteID _bridge_sprite_table_12_2[] = {
|
||||
static const PalSpriteID _bridge_sprite_table_tubular_silicon_middle[] = {
|
||||
{ 0xA0A, PALETTE_TO_STRUCT_CONCRETE }, { 0xA00, PALETTE_TO_STRUCT_CONCRETE }, { 0xA06, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||
{ 0xA0D, PALETTE_TO_STRUCT_CONCRETE }, { 0xA03, PALETTE_TO_STRUCT_CONCRETE }, { 0xA07, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||
{ 0xA10, PALETTE_TO_STRUCT_CONCRETE }, { 0xA00, PALETTE_TO_STRUCT_CONCRETE }, { 0xA06, PALETTE_TO_STRUCT_CONCRETE }, { 0x0, PAL_NONE },
|
||||
|
@ -596,64 +596,64 @@ static const std::span<const PalSpriteID> _bridge_sprite_table_archgirder[] = {
|
|||
_bridge_sprite_table_archgirder_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_4[] = {
|
||||
_bridge_sprite_table_4_0,
|
||||
_bridge_sprite_table_4_1,
|
||||
_bridge_sprite_table_4_2,
|
||||
_bridge_sprite_table_4_3,
|
||||
_bridge_sprite_table_4_4,
|
||||
_bridge_sprite_table_4_5,
|
||||
_bridge_sprite_table_4_6,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_suspension_oxide[] = {
|
||||
_bridge_sprite_table_suspension_oxide_north,
|
||||
_bridge_sprite_table_suspension_oxide_south,
|
||||
_bridge_sprite_table_suspension_oxide_inner_north,
|
||||
_bridge_sprite_table_suspension_oxide_inner_south,
|
||||
_bridge_sprite_table_suspension_oxide_middle_odd,
|
||||
_bridge_sprite_table_suspension_middle_even,
|
||||
_bridge_sprite_table_generic_oxide_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_5[] = {
|
||||
_bridge_sprite_table_5_0,
|
||||
_bridge_sprite_table_5_1,
|
||||
_bridge_sprite_table_5_2,
|
||||
_bridge_sprite_table_5_3,
|
||||
_bridge_sprite_table_5_4,
|
||||
_bridge_sprite_table_5_5,
|
||||
_bridge_sprite_table_5_6,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_suspension_yellow[] = {
|
||||
_bridge_sprite_table_suspension_yellow_north,
|
||||
_bridge_sprite_table_suspension_yellow_south,
|
||||
_bridge_sprite_table_suspension_yellow_inner_north,
|
||||
_bridge_sprite_table_suspension_yellow_inner_south,
|
||||
_bridge_sprite_table_suspension_yellow_middle_odd,
|
||||
_bridge_sprite_table_suspension_yellow_middle_even,
|
||||
_bridge_sprite_table_generic_yellow_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_concrete_suspended[] = {
|
||||
_bridge_sprite_table_concrete_suspended_A,
|
||||
_bridge_sprite_table_concrete_suspended_B,
|
||||
_bridge_sprite_table_concrete_suspended_C,
|
||||
_bridge_sprite_table_concrete_suspended_D,
|
||||
_bridge_sprite_table_concrete_suspended_E,
|
||||
_bridge_sprite_table_concrete_suspended_F,
|
||||
_bridge_sprite_table_concrete_suspended_heads,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_suspension_concrete[] = {
|
||||
_bridge_sprite_table_suspension_concrete_north,
|
||||
_bridge_sprite_table_suspension_concrete_south,
|
||||
_bridge_sprite_table_suspension_concrete_inner_north,
|
||||
_bridge_sprite_table_suspension_concrete_inner_south,
|
||||
_bridge_sprite_table_suspension_concrete_middle_odd,
|
||||
_bridge_sprite_table_suspension_concrete_middle_even,
|
||||
_bridge_sprite_table_generic_concrete_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_6[] = {
|
||||
_bridge_sprite_table_6_0,
|
||||
_bridge_sprite_table_6_1,
|
||||
_bridge_sprite_table_6_2,
|
||||
_bridge_sprite_table_6_2,
|
||||
_bridge_sprite_table_6_2,
|
||||
_bridge_sprite_table_6_2,
|
||||
_bridge_sprite_table_6_3,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_cantilever_oxide[] = {
|
||||
_bridge_sprite_table_cantilever_oxide_north,
|
||||
_bridge_sprite_table_cantilever_oxide_south,
|
||||
_bridge_sprite_table_cantilever_oxide_middle,
|
||||
_bridge_sprite_table_cantilever_oxide_middle,
|
||||
_bridge_sprite_table_cantilever_oxide_middle,
|
||||
_bridge_sprite_table_cantilever_oxide_middle,
|
||||
_bridge_sprite_table_cantilever_oxide_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_7[] = {
|
||||
_bridge_sprite_table_7_0,
|
||||
_bridge_sprite_table_7_1,
|
||||
_bridge_sprite_table_7_2,
|
||||
_bridge_sprite_table_7_2,
|
||||
_bridge_sprite_table_7_2,
|
||||
_bridge_sprite_table_7_2,
|
||||
_bridge_sprite_table_7_3,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_cantilever_brown[] = {
|
||||
_bridge_sprite_table_cantilever_brown_north,
|
||||
_bridge_sprite_table_cantilever_brown_south,
|
||||
_bridge_sprite_table_cantilever_brown_middle,
|
||||
_bridge_sprite_table_cantilever_brown_middle,
|
||||
_bridge_sprite_table_cantilever_brown_middle,
|
||||
_bridge_sprite_table_cantilever_brown_middle,
|
||||
_bridge_sprite_table_cantilever_brown_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_8[] = {
|
||||
_bridge_sprite_table_8_0,
|
||||
_bridge_sprite_table_8_1,
|
||||
_bridge_sprite_table_8_2,
|
||||
_bridge_sprite_table_8_2,
|
||||
_bridge_sprite_table_8_2,
|
||||
_bridge_sprite_table_8_2,
|
||||
_bridge_sprite_table_8_3,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_cantilever_red[] = {
|
||||
_bridge_sprite_table_cantilever_red_north,
|
||||
_bridge_sprite_table_cantilever_red_south,
|
||||
_bridge_sprite_table_cantilever_red_middle,
|
||||
_bridge_sprite_table_cantilever_red_middle,
|
||||
_bridge_sprite_table_cantilever_red_middle,
|
||||
_bridge_sprite_table_cantilever_red_middle,
|
||||
_bridge_sprite_table_cantilever_red_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_wood[] = {
|
||||
|
@ -676,60 +676,60 @@ static const std::span<const PalSpriteID> _bridge_sprite_table_concrete[] = {
|
|||
_bridge_sprite_table_concrete_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_9[] = {
|
||||
_bridge_sprite_table_9_0,
|
||||
_bridge_sprite_table_9_0,
|
||||
_bridge_sprite_table_9_0,
|
||||
_bridge_sprite_table_9_0,
|
||||
_bridge_sprite_table_9_0,
|
||||
_bridge_sprite_table_9_0,
|
||||
_bridge_sprite_table_4_6,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_girder[] = {
|
||||
_bridge_sprite_table_girder_middle,
|
||||
_bridge_sprite_table_girder_middle,
|
||||
_bridge_sprite_table_girder_middle,
|
||||
_bridge_sprite_table_girder_middle,
|
||||
_bridge_sprite_table_girder_middle,
|
||||
_bridge_sprite_table_girder_middle,
|
||||
_bridge_sprite_table_generic_oxide_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_10[] = {
|
||||
_bridge_sprite_table_10_0,
|
||||
_bridge_sprite_table_10_1,
|
||||
_bridge_sprite_table_10_2,
|
||||
_bridge_sprite_table_10_2,
|
||||
_bridge_sprite_table_10_2,
|
||||
_bridge_sprite_table_10_2,
|
||||
_bridge_sprite_table_4_6,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_tubular_oxide[] = {
|
||||
_bridge_sprite_table_tubular_oxide_north,
|
||||
_bridge_sprite_table_tubular_oxide_south,
|
||||
_bridge_sprite_table_tubular_oxide_middle,
|
||||
_bridge_sprite_table_tubular_oxide_middle,
|
||||
_bridge_sprite_table_tubular_oxide_middle,
|
||||
_bridge_sprite_table_tubular_oxide_middle,
|
||||
_bridge_sprite_table_generic_oxide_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_11[] = {
|
||||
_bridge_sprite_table_11_0,
|
||||
_bridge_sprite_table_11_1,
|
||||
_bridge_sprite_table_11_2,
|
||||
_bridge_sprite_table_11_2,
|
||||
_bridge_sprite_table_11_2,
|
||||
_bridge_sprite_table_11_2,
|
||||
_bridge_sprite_table_5_6,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_tubular_yellow[] = {
|
||||
_bridge_sprite_table_tubular_yellow_north,
|
||||
_bridge_sprite_table_tubular_yellow_south,
|
||||
_bridge_sprite_table_tubular_yellow_middle,
|
||||
_bridge_sprite_table_tubular_yellow_middle,
|
||||
_bridge_sprite_table_tubular_yellow_middle,
|
||||
_bridge_sprite_table_tubular_yellow_middle,
|
||||
_bridge_sprite_table_generic_yellow_heads,
|
||||
};
|
||||
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_12[] = {
|
||||
_bridge_sprite_table_12_0,
|
||||
_bridge_sprite_table_12_1,
|
||||
_bridge_sprite_table_12_2,
|
||||
_bridge_sprite_table_12_2,
|
||||
_bridge_sprite_table_12_2,
|
||||
_bridge_sprite_table_12_2,
|
||||
_bridge_sprite_table_concrete_suspended_heads,
|
||||
static const std::span<const PalSpriteID> _bridge_sprite_table_tubular_silicon[] = {
|
||||
_bridge_sprite_table_tubular_silicon_north,
|
||||
_bridge_sprite_table_tubular_silicon_south,
|
||||
_bridge_sprite_table_tubular_silicon_middle,
|
||||
_bridge_sprite_table_tubular_silicon_middle,
|
||||
_bridge_sprite_table_tubular_silicon_middle,
|
||||
_bridge_sprite_table_tubular_silicon_middle,
|
||||
_bridge_sprite_table_generic_concrete_heads,
|
||||
};
|
||||
|
||||
static const std::span<const std::span<const PalSpriteID>> _bridge_sprite_table[MAX_BRIDGES] = {
|
||||
_bridge_sprite_table_wood,
|
||||
_bridge_sprite_table_concrete,
|
||||
_bridge_sprite_table_archgirder,
|
||||
_bridge_sprite_table_concrete_suspended,
|
||||
_bridge_sprite_table_4,
|
||||
_bridge_sprite_table_5,
|
||||
_bridge_sprite_table_6,
|
||||
_bridge_sprite_table_7,
|
||||
_bridge_sprite_table_8,
|
||||
_bridge_sprite_table_9,
|
||||
_bridge_sprite_table_10,
|
||||
_bridge_sprite_table_11,
|
||||
_bridge_sprite_table_12
|
||||
_bridge_sprite_table_suspension_concrete,
|
||||
_bridge_sprite_table_suspension_oxide,
|
||||
_bridge_sprite_table_suspension_yellow,
|
||||
_bridge_sprite_table_cantilever_oxide,
|
||||
_bridge_sprite_table_cantilever_brown,
|
||||
_bridge_sprite_table_cantilever_red,
|
||||
_bridge_sprite_table_girder,
|
||||
_bridge_sprite_table_tubular_oxide,
|
||||
_bridge_sprite_table_tubular_yellow,
|
||||
_bridge_sprite_table_tubular_silicon,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -621,7 +621,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
|||
if (!IsInsideMM(size, 1, 8 + 1)) return;
|
||||
_terraform_size = size;
|
||||
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ public:
|
|||
static void PopupMainToolbarMenu(Window *w, WidgetID widget, DropDownList &&list, int def)
|
||||
{
|
||||
ShowDropDownList(w, std::move(list), def, widget, 0, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -204,7 +204,7 @@ static CallBackFunction ToolbarPauseClick(Window *)
|
|||
if (_networking && !_network_server) return CBF_NONE; // only server can pause the game
|
||||
|
||||
if (Command<CMD_PAUSE>::Post(PauseMode::Normal, _pause_mode.None())) {
|
||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
||||
SndConfirmBeep();
|
||||
}
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ static CallBackFunction ToolbarFastForwardClick(Window *)
|
|||
|
||||
ChangeGameSpeed(_game_speed == 100);
|
||||
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -291,7 +291,7 @@ static CallBackFunction ToolbarOptionsClick(Window *w)
|
|||
list.push_back(MakeDropDownListCheckedItem(IsTransparencySet(TO_SIGNS), STR_SETTINGS_MENU_TRANSPARENT_SIGNS, OME_SHOW_STATIONSIGNS));
|
||||
|
||||
ShowDropDownList(w, std::move(list), 0, WID_TN_SETTINGS, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -684,7 +684,7 @@ static CallBackFunction ToolbarGraphsClick(Window *w)
|
|||
if (_toolbar_mode != TB_NORMAL) AddDropDownLeagueTableOptions(list);
|
||||
|
||||
ShowDropDownList(w, std::move(list), GRMN_OPERATING_PROFIT_GRAPH, WID_TN_GRAPHS, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -697,7 +697,7 @@ static CallBackFunction ToolbarLeagueClick(Window *w)
|
|||
|
||||
int selected = list[0]->result;
|
||||
ShowDropDownList(w, std::move(list), selected, WID_TN_LEAGUE, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -857,7 +857,7 @@ static CallBackFunction ToolbarZoomInClick(Window *w)
|
|||
{
|
||||
if (DoZoomInOutWindow(ZOOM_IN, GetMainWindow())) {
|
||||
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_IN : (WidgetID)WID_TN_ZOOM_IN);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
}
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -868,7 +868,7 @@ static CallBackFunction ToolbarZoomOutClick(Window *w)
|
|||
{
|
||||
if (DoZoomInOutWindow(ZOOM_OUT, GetMainWindow())) {
|
||||
w->HandleButtonClick((_game_mode == GM_EDITOR) ? (WidgetID)WID_TE_ZOOM_OUT : (WidgetID)WID_TN_ZOOM_OUT);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
}
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -878,7 +878,7 @@ static CallBackFunction ToolbarZoomOutClick(Window *w)
|
|||
static CallBackFunction ToolbarBuildRailClick(Window *w)
|
||||
{
|
||||
ShowDropDownList(w, GetRailTypeDropDownList(), _last_built_railtype, WID_TN_RAILS, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -900,7 +900,7 @@ static CallBackFunction MenuClickBuildRail(int index)
|
|||
static CallBackFunction ToolbarBuildRoadClick(Window *w)
|
||||
{
|
||||
ShowDropDownList(w, GetRoadTypeDropDownList(RTTB_ROAD), _last_built_roadtype, WID_TN_ROADS, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -922,7 +922,7 @@ static CallBackFunction MenuClickBuildRoad(int index)
|
|||
static CallBackFunction ToolbarBuildTramClick(Window *w)
|
||||
{
|
||||
ShowDropDownList(w, GetRoadTypeDropDownList(RTTB_TRAM), _last_built_tramtype, WID_TN_TRAMS, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -946,7 +946,7 @@ static CallBackFunction ToolbarBuildWaterClick(Window *w)
|
|||
DropDownList list;
|
||||
list.push_back(MakeDropDownListIconItem(SPR_IMG_BUILD_CANAL, PAL_NONE, STR_WATERWAYS_MENU_WATERWAYS_CONSTRUCTION, 0));
|
||||
ShowDropDownList(w, std::move(list), 0, WID_TN_WATER, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -968,7 +968,7 @@ static CallBackFunction ToolbarBuildAirClick(Window *w)
|
|||
DropDownList list;
|
||||
list.push_back(MakeDropDownListIconItem(SPR_IMG_AIRPORT, PAL_NONE, STR_AIRCRAFT_MENU_AIRPORT_CONSTRUCTION, 0));
|
||||
ShowDropDownList(w, std::move(list), 0, WID_TN_AIR, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -992,7 +992,7 @@ static CallBackFunction ToolbarForestClick(Window *w)
|
|||
list.push_back(MakeDropDownListIconItem(SPR_IMG_PLANTTREES, PAL_NONE, STR_LANDSCAPING_MENU_PLANT_TREES, 1));
|
||||
list.push_back(MakeDropDownListIconItem(SPR_IMG_SIGN, PAL_NONE, STR_LANDSCAPING_MENU_PLACE_SIGN, 2));
|
||||
ShowDropDownList(w, std::move(list), 0, WID_TN_LANDSCAPE, 100, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -1188,7 +1188,7 @@ static CallBackFunction ToolbarSwitchClick(Window *w)
|
|||
|
||||
w->ReInit();
|
||||
w->SetWidgetLoweredState(_game_mode == GM_EDITOR ? (WidgetID)WID_TE_SWITCH_BAR : (WidgetID)WID_TN_SWITCH_BAR, _toolbar_mode == TB_LOWER);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -1232,7 +1232,7 @@ static CallBackFunction ToolbarScenDateForward(Window *w)
|
|||
static CallBackFunction ToolbarScenGenLand(Window *w)
|
||||
{
|
||||
w->HandleButtonClick(WID_TE_LAND_GENERATE);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
|
||||
ShowEditorTerraformToolbar();
|
||||
return CBF_NONE;
|
||||
|
@ -1256,7 +1256,7 @@ static CallBackFunction ToolbarScenGenTown(int index)
|
|||
static CallBackFunction ToolbarScenGenIndustry(Window *w)
|
||||
{
|
||||
w->HandleButtonClick(WID_TE_INDUSTRY);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
ShowBuildIndustryWindow();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -1264,7 +1264,7 @@ static CallBackFunction ToolbarScenGenIndustry(Window *w)
|
|||
static CallBackFunction ToolbarScenBuildRoadClick(Window *w)
|
||||
{
|
||||
ShowDropDownList(w, GetScenRoadTypeDropDownList(RTTB_ROAD), _last_built_roadtype, WID_TE_ROADS, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -1284,7 +1284,7 @@ static CallBackFunction ToolbarScenBuildRoad(int index)
|
|||
static CallBackFunction ToolbarScenBuildTramClick(Window *w)
|
||||
{
|
||||
ShowDropDownList(w, GetScenRoadTypeDropDownList(RTTB_TRAM), _last_built_tramtype, WID_TE_TRAMS, 140, true);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
||||
|
@ -1304,7 +1304,7 @@ static CallBackFunction ToolbarScenBuildTram(int index)
|
|||
static CallBackFunction ToolbarScenBuildDocks(Window *w)
|
||||
{
|
||||
w->HandleButtonClick(WID_TE_WATER);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
ShowBuildDocksScenToolbar();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -1312,7 +1312,7 @@ static CallBackFunction ToolbarScenBuildDocks(Window *w)
|
|||
static CallBackFunction ToolbarScenPlantTrees(Window *w)
|
||||
{
|
||||
w->HandleButtonClick(WID_TE_TREES);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
ShowBuildTreesToolbar();
|
||||
return CBF_NONE;
|
||||
}
|
||||
|
@ -1320,7 +1320,7 @@ static CallBackFunction ToolbarScenPlantTrees(Window *w)
|
|||
static CallBackFunction ToolbarScenPlaceSign(Window *w)
|
||||
{
|
||||
w->HandleButtonClick(WID_TE_SIGNS);
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
return SelectSignTool();
|
||||
}
|
||||
|
||||
|
@ -2407,7 +2407,7 @@ struct ScenarioEditorToolbarWindow : Window {
|
|||
{
|
||||
CallBackFunction cbf = _scen_toolbar_dropdown_procs[widget](index);
|
||||
if (cbf != CBF_NONE) _last_started_action = cbf;
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
}
|
||||
|
||||
EventState OnHotkey(int hotkey) override
|
||||
|
|
|
@ -1739,7 +1739,7 @@ struct BuildHouseWindow : public PickerWindow {
|
|||
this->SetWidgetLoweredState(WID_BH_PROTECT_OFF, !BuildHouseWindow::house_protected);
|
||||
this->SetWidgetLoweredState(WID_BH_PROTECT_ON, BuildHouseWindow::house_protected);
|
||||
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
this->SetDirty();
|
||||
break;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ public:
|
|||
} else {
|
||||
/* toggle the bit of the transparencies variable and play a sound */
|
||||
ToggleTransparency((TransparencyOption)(widget - WID_TT_BEGIN));
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
MarkWholeScreenDirty();
|
||||
}
|
||||
} else if (widget == WID_TT_BUTTONS) {
|
||||
|
@ -94,7 +94,7 @@ public:
|
|||
if (i == WID_TT_TEXT|| i == WID_TT_END) return;
|
||||
|
||||
ToggleInvisibility((TransparencyOption)(i - WID_TT_BEGIN));
|
||||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
SndClickBeep();
|
||||
|
||||
/* Redraw whole screen only if transparency is set */
|
||||
if (IsTransparencySet((TransparencyOption)(i - WID_TT_BEGIN))) {
|
||||
|
|
|
@ -102,7 +102,7 @@ class BuildTreesWindow : public Window
|
|||
|
||||
if (this->tree_to_plant >= 0) {
|
||||
/* Activate placement */
|
||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
||||
SndConfirmBeep();
|
||||
SetObjectToPlace(SPR_CURSOR_TREE, PAL_NONE, HT_RECT | HT_DIAGONAL, this->window_class, this->window_number);
|
||||
this->tree_to_plant = current_tree; // SetObjectToPlace may call ResetObjectToPlace which may reset tree_to_plant to -1
|
||||
} else {
|
||||
|
@ -180,7 +180,7 @@ public:
|
|||
break;
|
||||
|
||||
case WID_BT_MANY_RANDOM: // place trees randomly over the landscape
|
||||
if (_settings_client.sound.confirm) SndPlayFx(SND_15_BEEP);
|
||||
SndConfirmBeep();
|
||||
PlaceTreesRandomly();
|
||||
MarkWholeScreenDirty();
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue