From 059eee93fc45b30d46698b094f87909eb54ff8c6 Mon Sep 17 00:00:00 2001 From: zuu Date: Sat, 8 Jun 2013 12:37:36 +0000 Subject: (svn r25331) -Fix (r25263): Update ScriptWindow with link graph widgets --- src/game/game_instance.cpp | 2 ++ src/script/api/game/game_window.hpp.sq | 17 ++++++++++++++++ src/script/api/script_window.hpp | 28 ++++++++++++++++++++++++++ src/script/api/template/template_window.hpp.sq | 2 ++ src/widgets/link_graph_legend_widget.h | 2 ++ 5 files changed, 51 insertions(+) diff --git a/src/game/game_instance.cpp b/src/game/game_instance.cpp index df52ca91a..bd588e039 100644 --- a/src/game/game_instance.cpp +++ b/src/game/game_instance.cpp @@ -66,6 +66,7 @@ #include "../script/api/game/game_signlist.hpp.sq" #include "../script/api/game/game_station.hpp.sq" #include "../script/api/game/game_stationlist.hpp.sq" +#include "../script/api/game/game_story_page.hpp.sq" #include "../script/api/game/game_subsidy.hpp.sq" #include "../script/api/game/game_subsidylist.hpp.sq" #include "../script/api/game/game_testmode.hpp.sq" @@ -169,6 +170,7 @@ void GameInstance::RegisterAPI() SQGSStation_Register(this->engine); SQGSStationList_Register(this->engine); SQGSStationList_Vehicle_Register(this->engine); + SQGSStoryPage_Register(this->engine); SQGSSubsidy_Register(this->engine); SQGSSubsidyList_Register(this->engine); SQGSTestMode_Register(this->engine); diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq index 62681f246..01811a212 100644 --- a/src/script/api/game/game_window.hpp.sq +++ b/src/script/api/game/game_window.hpp.sq @@ -135,6 +135,7 @@ void SQGSWindow_Register(Squirrel *engine) SQGSWindow.DefSQConst(engine, ScriptWindow::WC_AI_DEBUG, "WC_AI_DEBUG"); SQGSWindow.DefSQConst(engine, ScriptWindow::WC_NEWGRF_INSPECT, "WC_NEWGRF_INSPECT"); SQGSWindow.DefSQConst(engine, ScriptWindow::WC_SPRITE_ALIGNER, "WC_SPRITE_ALIGNER"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WC_LINKGRAPH_LEGEND, "WC_LINKGRAPH_LEGEND"); SQGSWindow.DefSQConst(engine, ScriptWindow::WC_INVALID, "WC_INVALID"); SQGSWindow.DefSQConst(engine, ScriptWindow::TC_BLUE, "TC_BLUE"); SQGSWindow.DefSQConst(engine, ScriptWindow::TC_SILVER, "TC_SILVER"); @@ -584,6 +585,20 @@ void SQGSWindow_Register(Squirrel *engine) SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SGI_CONTENT_DOWNLOAD, "WID_SGI_CONTENT_DOWNLOAD"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SGI_AI_SETTINGS, "WID_SGI_AI_SETTINGS"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SGI_EXIT, "WID_SGI_EXIT"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_CAPTION, "WID_LGL_CAPTION"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_SATURATION, "WID_LGL_SATURATION"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_SATURATION_FIRST, "WID_LGL_SATURATION_FIRST"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_SATURATION_LAST, "WID_LGL_SATURATION_LAST"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_COMPANIES, "WID_LGL_COMPANIES"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_COMPANY_FIRST, "WID_LGL_COMPANY_FIRST"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_COMPANY_LAST, "WID_LGL_COMPANY_LAST"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_COMPANIES_ALL, "WID_LGL_COMPANIES_ALL"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_COMPANIES_NONE, "WID_LGL_COMPANIES_NONE"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_CARGOES, "WID_LGL_CARGOES"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_CARGO_FIRST, "WID_LGL_CARGO_FIRST"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_CARGO_LAST, "WID_LGL_CARGO_LAST"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_CARGOES_ALL, "WID_LGL_CARGOES_ALL"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LGL_CARGOES_NONE, "WID_LGL_CARGOES_NONE"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_M_VIEWPORT, "WID_M_VIEWPORT"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_LI_BACKGROUND, "WID_LI_BACKGROUND"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_BACKGROUND, "WID_TT_BACKGROUND"); @@ -1021,11 +1036,13 @@ void SQGSWindow_Register(Squirrel *engine) SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_MAP_BORDER, "WID_SM_MAP_BORDER"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_MAP, "WID_SM_MAP"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_LEGEND, "WID_SM_LEGEND"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_BLANK, "WID_SM_BLANK"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_ZOOM_IN, "WID_SM_ZOOM_IN"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_ZOOM_OUT, "WID_SM_ZOOM_OUT"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_CONTOUR, "WID_SM_CONTOUR"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_VEHICLES, "WID_SM_VEHICLES"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_INDUSTRIES, "WID_SM_INDUSTRIES"); + SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_LINKSTATS, "WID_SM_LINKSTATS"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_ROUTES, "WID_SM_ROUTES"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_VEGETATION, "WID_SM_VEGETATION"); SQGSWindow.DefSQConst(engine, ScriptWindow::WID_SM_OWNERS, "WID_SM_OWNERS"); diff --git a/src/script/api/script_window.hpp b/src/script/api/script_window.hpp index 954d9300f..1fae2bfae 100644 --- a/src/script/api/script_window.hpp +++ b/src/script/api/script_window.hpp @@ -68,6 +68,7 @@ #include "../../widgets/vehicle_widget.h" #include "../../widgets/viewport_widget.h" #include "../../widgets/waypoint_widget.h" +#include "../../widgets/link_graph_legend_widget.h" /** * Class that handles window interaction. A Window in OpenTTD has two imporant @@ -745,6 +746,12 @@ public: */ WC_SPRITE_ALIGNER = ::WC_SPRITE_ALIGNER, + /** + * Linkgraph legend; Window numbers: + * - 0 = #LinkGraphWidgets + */ + WC_LINKGRAPH_LEGEND = ::WC_LINKGRAPH_LEGEND, + WC_INVALID = ::WC_INVALID, ///< Invalid window. }; @@ -1483,6 +1490,25 @@ public: WID_SGI_EXIT = ::WID_SGI_EXIT, ///< Exit button. }; + /* automatically generated from ../../widgets/link_graph_legend_widget.h */ + /** Widgets of the WC_LINKGRAPH_LEGEND. */ + enum LinkGraphLegendWidgets { + WID_LGL_CAPTION = ::WID_LGL_CAPTION, ///< Caption widget. + WID_LGL_SATURATION = ::WID_LGL_SATURATION, ///< Saturation legend. + WID_LGL_SATURATION_FIRST = ::WID_LGL_SATURATION_FIRST, + WID_LGL_SATURATION_LAST = ::WID_LGL_SATURATION_LAST, + WID_LGL_COMPANIES = ::WID_LGL_COMPANIES, ///< Company selection widget. + WID_LGL_COMPANY_FIRST = ::WID_LGL_COMPANY_FIRST, + WID_LGL_COMPANY_LAST = ::WID_LGL_COMPANY_LAST, + WID_LGL_COMPANIES_ALL = ::WID_LGL_COMPANIES_ALL, + WID_LGL_COMPANIES_NONE = ::WID_LGL_COMPANIES_NONE, + WID_LGL_CARGOES = ::WID_LGL_CARGOES, ///< Cargo selection widget. + WID_LGL_CARGO_FIRST = ::WID_LGL_CARGO_FIRST, + WID_LGL_CARGO_LAST = ::WID_LGL_CARGO_LAST, + WID_LGL_CARGOES_ALL = ::WID_LGL_CARGOES_ALL, + WID_LGL_CARGOES_NONE = ::WID_LGL_CARGOES_NONE, + }; + /* automatically generated from ../../widgets/main_widget.h */ /** Widgets of the #MainWindow class. */ enum MainWidgets { @@ -2141,11 +2167,13 @@ public: WID_SM_MAP_BORDER = ::WID_SM_MAP_BORDER, ///< Border around the smallmap. WID_SM_MAP = ::WID_SM_MAP, ///< Panel containing the smallmap. WID_SM_LEGEND = ::WID_SM_LEGEND, ///< Bottom panel to display smallmap legends. + WID_SM_BLANK = ::WID_SM_BLANK, ///< Empty button as placeholder. WID_SM_ZOOM_IN = ::WID_SM_ZOOM_IN, ///< Button to zoom in one step. WID_SM_ZOOM_OUT = ::WID_SM_ZOOM_OUT, ///< Button to zoom out one step. WID_SM_CONTOUR = ::WID_SM_CONTOUR, ///< Button to select the contour view (height map). WID_SM_VEHICLES = ::WID_SM_VEHICLES, ///< Button to select the vehicles view. WID_SM_INDUSTRIES = ::WID_SM_INDUSTRIES, ///< Button to select the industries view. + WID_SM_LINKSTATS = ::WID_SM_LINKSTATS, ///< Button to select the link stats view. WID_SM_ROUTES = ::WID_SM_ROUTES, ///< Button to select the routes view. WID_SM_VEGETATION = ::WID_SM_VEGETATION, ///< Button to select the vegetation view. WID_SM_OWNERS = ::WID_SM_OWNERS, ///< Button to select the owners view. diff --git a/src/script/api/template/template_window.hpp.sq b/src/script/api/template/template_window.hpp.sq index 846bcf806..238c403c2 100644 --- a/src/script/api/template/template_window.hpp.sq +++ b/src/script/api/template/template_window.hpp.sq @@ -113,6 +113,8 @@ namespace SQConvert { template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::IndustryCargoesWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptWindow::SelectGameIntroWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::SelectGameIntroWidgets)tmp; } template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::SelectGameIntroWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } + template <> inline ScriptWindow::LinkGraphLegendWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::LinkGraphLegendWidgets)tmp; } + template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::LinkGraphLegendWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptWindow::MainWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::MainWidgets)tmp; } template <> inline int Return(HSQUIRRELVM vm, ScriptWindow::MainWidgets res) { sq_pushinteger(vm, (int32)res); return 1; } template <> inline ScriptWindow::LandInfoWidgets GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::LandInfoWidgets)tmp; } diff --git a/src/widgets/link_graph_legend_widget.h b/src/widgets/link_graph_legend_widget.h index f24ce343b..9537b896d 100644 --- a/src/widgets/link_graph_legend_widget.h +++ b/src/widgets/link_graph_legend_widget.h @@ -12,6 +12,8 @@ #ifndef WIDGETS_LINKGRAPH_LEGEND_WIDGET_H #define WIDGETS_LINKGRAPH_LEGEND_WIDGET_H +#include "../cargo_type.h" + /** Widgets of the WC_LINKGRAPH_LEGEND. */ enum LinkGraphLegendWidgets { -- cgit v1.2.3-54-g00ecf