Import Picking and placing single houses in scenario editor patch

Minor whitespace fixes

http://www.tt-forums.net/viewtopic.php?f=33&t=68894&view=unread#p1099696
This commit is contained in:
patch-import
2015-08-03 21:29:03 +01:00
committed by Jonathan G Rennison
parent e6782df9ba
commit 19dcbb1cb9
20 changed files with 1495 additions and 264 deletions

View File

@@ -68,6 +68,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_COMPANY_COLOUR, "WC_COMPANY_COLOUR");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_COMPANY_MANAGER_FACE, "WC_COMPANY_MANAGER_FACE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_SELECT_STATION, "WC_SELECT_STATION");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_SELECT_TOWN, "WC_SELECT_TOWN");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_NEWS_WINDOW, "WC_NEWS_WINDOW");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_TOWN_DIRECTORY, "WC_TOWN_DIRECTORY");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_SUBSIDIES_LIST, "WC_SUBSIDIES_LIST");
@@ -90,6 +91,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_INDUSTRY_VIEW, "WC_INDUSTRY_VIEW");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_COMPANY, "WC_COMPANY");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_BUILD_OBJECT, "WC_BUILD_OBJECT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_BUILD_HOUSE, "WC_BUILD_HOUSE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_BUILD_VEHICLE, "WC_BUILD_VEHICLE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_BUILD_BRIDGE, "WC_BUILD_BRIDGE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WC_BUILD_STATION, "WC_BUILD_STATION");
@@ -1139,6 +1141,7 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ETT_PLACE_ROCKS, "WID_ETT_PLACE_ROCKS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ETT_PLACE_DESERT, "WID_ETT_PLACE_DESERT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ETT_PLACE_OBJECT, "WID_ETT_PLACE_OBJECT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ETT_PLACE_HOUSE, "WID_ETT_PLACE_HOUSE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ETT_BUTTONS_END, "WID_ETT_BUTTONS_END");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ETT_INCREASE_SIZE, "WID_ETT_INCREASE_SIZE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ETT_DECREASE_SIZE, "WID_ETT_DECREASE_SIZE");
@@ -1249,6 +1252,26 @@ void SQGSWindow_Register(Squirrel *engine)
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TF_LAYOUT_GRID2, "WID_TF_LAYOUT_GRID2");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TF_LAYOUT_GRID3, "WID_TF_LAYOUT_GRID3");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TF_LAYOUT_RANDOM, "WID_TF_LAYOUT_RANDOM");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_CAPTION, "WID_HP_CAPTION");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_MAIN_PANEL_SEL, "WID_HP_MAIN_PANEL_SEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_SETS_SEL, "WID_HP_HOUSE_SETS_SEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_SETS, "WID_HP_HOUSE_SETS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_SELECT_MATRIX, "WID_HP_HOUSE_SELECT_MATRIX");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_SELECT_SCROLL, "WID_HP_HOUSE_SELECT_SCROLL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_SELECT, "WID_HP_HOUSE_SELECT");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_PREVIEW, "WID_HP_HOUSE_PREVIEW");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_NAME, "WID_HP_HOUSE_NAME");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HISTORICAL_BUILDING, "WID_HP_HISTORICAL_BUILDING");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_POPULATION, "WID_HP_HOUSE_POPULATION");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_ZONES, "WID_HP_HOUSE_ZONES");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_LANDSCAPE, "WID_HP_HOUSE_LANDSCAPE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_LANDSCAPE_SEL, "WID_HP_HOUSE_LANDSCAPE_SEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_YEARS, "WID_HP_HOUSE_YEARS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_ACCEPTANCE, "WID_HP_HOUSE_ACCEPTANCE");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_HOUSE_SUPPLY, "WID_HP_HOUSE_SUPPLY");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ST_CAPTION, "WID_ST_CAPTION");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ST_PANEL, "WID_ST_PANEL");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_ST_SCROLLBAR, "WID_ST_SCROLLBAR");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_BEGIN, "WID_TT_BEGIN");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_SIGNS, "WID_TT_SIGNS");
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_TREES, "WID_TT_TREES");

View File

@@ -319,6 +319,12 @@ public:
*/
WC_SELECT_STATION = ::WC_SELECT_STATION,
/**
* Select town (when placing a house); %Window numbers:
* - 0 = #SelectTownWidgets
*/
WC_SELECT_TOWN = ::WC_SELECT_TOWN,
/**
* News window; %Window numbers:
* - 0 = #NewsWidgets
@@ -453,6 +459,12 @@ public:
*/
WC_BUILD_OBJECT = ::WC_BUILD_OBJECT,
/**
* Build house; %Window numbers:
* - 0 = #BuildHouseWidgets
*/
WC_BUILD_HOUSE = ::WC_BUILD_HOUSE,
/**
* Build vehicle; %Window numbers:
* - #VehicleType = #BuildVehicleWidgets
@@ -2330,6 +2342,7 @@ public:
WID_ETT_PLACE_ROCKS = ::WID_ETT_PLACE_ROCKS, ///< Place rocks button.
WID_ETT_PLACE_DESERT = ::WID_ETT_PLACE_DESERT, ///< Place desert button (in tropical climate).
WID_ETT_PLACE_OBJECT = ::WID_ETT_PLACE_OBJECT, ///< Place transmitter button.
WID_ETT_PLACE_HOUSE = ::WID_ETT_PLACE_HOUSE, ///< Place house button.
WID_ETT_BUTTONS_END = ::WID_ETT_BUTTONS_END, ///< End of pushable buttons.
WID_ETT_INCREASE_SIZE = ::WID_ETT_INCREASE_SIZE, ///< Upwards arrow button to increase terraforming size.
WID_ETT_DECREASE_SIZE = ::WID_ETT_DECREASE_SIZE, ///< Downwards arrow button to decrease terraforming size.
@@ -2474,6 +2487,34 @@ public:
WID_TF_LAYOUT_RANDOM = ::WID_TF_LAYOUT_RANDOM, ///< Selection for a randomly chosen town layout.
};
/** Widgets of the #HousePickerWindow class. */
enum HousePickerWidgets {
WID_HP_CAPTION = ::WID_HP_CAPTION,
WID_HP_MAIN_PANEL_SEL = ::WID_HP_MAIN_PANEL_SEL, ///< Selection widget to show/hide the main panel.
WID_HP_HOUSE_SETS_SEL = ::WID_HP_HOUSE_SETS_SEL, ///< Selection widget to show/hide the list of house sets.
WID_HP_HOUSE_SETS = ::WID_HP_HOUSE_SETS, ///< List of available house sets.
WID_HP_HOUSE_SELECT_MATRIX = ::WID_HP_HOUSE_SELECT_MATRIX, ///< Matrix with houses to select.
WID_HP_HOUSE_SELECT_SCROLL = ::WID_HP_HOUSE_SELECT_SCROLL, ///< Scrollbar associated with the house matrix.
WID_HP_HOUSE_SELECT = ::WID_HP_HOUSE_SELECT, ///< Panels with house images in the house matrix.
WID_HP_HOUSE_PREVIEW = ::WID_HP_HOUSE_PREVIEW, ///< House preview panel.
WID_HP_HOUSE_NAME = ::WID_HP_HOUSE_NAME, ///< House name display.
WID_HP_HISTORICAL_BUILDING = ::WID_HP_HISTORICAL_BUILDING, ///< "Historical building" label.
WID_HP_HOUSE_POPULATION = ::WID_HP_HOUSE_POPULATION, ///< House population display.
WID_HP_HOUSE_ZONES = ::WID_HP_HOUSE_ZONES, ///< House zones display.
WID_HP_HOUSE_LANDSCAPE = ::WID_HP_HOUSE_LANDSCAPE, ///< Information about house availability against the landscape.
WID_HP_HOUSE_LANDSCAPE_SEL = ::WID_HP_HOUSE_LANDSCAPE_SEL, ///< Selection widget to show/hide the landscape info.
WID_HP_HOUSE_YEARS = ::WID_HP_HOUSE_YEARS, ///< Years display.
WID_HP_HOUSE_ACCEPTANCE = ::WID_HP_HOUSE_ACCEPTANCE, ///< Cargo accepted.
WID_HP_HOUSE_SUPPLY = ::WID_HP_HOUSE_SUPPLY, ///< Cargo supplied.
};
/** Widgets of the #SelectTownWindow class. */
enum SelectTownWidgets {
WID_ST_CAPTION = ::WID_ST_CAPTION, ///< Caption of the window.
WID_ST_PANEL = ::WID_ST_PANEL, ///< Main panel.
WID_ST_SCROLLBAR = ::WID_ST_SCROLLBAR, ///< Scrollbar of the panel.
};
/* automatically generated from ../../widgets/transparency_widget.h */
/** Widgets of the #TransparenciesWindow class. */
enum TransparencyToolbarWidgets {

View File

@@ -233,6 +233,10 @@ namespace SQConvert {
template <> inline int Return<ScriptWindow::TownViewWidgets>(HSQUIRRELVM vm, ScriptWindow::TownViewWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::TownFoundingWidgets GetParam(ForceType<ScriptWindow::TownFoundingWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::TownFoundingWidgets)tmp; }
template <> inline int Return<ScriptWindow::TownFoundingWidgets>(HSQUIRRELVM vm, ScriptWindow::TownFoundingWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::HousePickerWidgets GetParam(ForceType<ScriptWindow::HousePickerWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::HousePickerWidgets)tmp; }
template <> inline int Return<ScriptWindow::HousePickerWidgets>(HSQUIRRELVM vm, ScriptWindow::HousePickerWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::SelectTownWidgets GetParam(ForceType<ScriptWindow::SelectTownWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::SelectTownWidgets)tmp; }
template <> inline int Return<ScriptWindow::SelectTownWidgets>(HSQUIRRELVM vm, ScriptWindow::SelectTownWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::TransparencyToolbarWidgets GetParam(ForceType<ScriptWindow::TransparencyToolbarWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::TransparencyToolbarWidgets)tmp; }
template <> inline int Return<ScriptWindow::TransparencyToolbarWidgets>(HSQUIRRELVM vm, ScriptWindow::TransparencyToolbarWidgets res) { sq_pushinteger(vm, (int32)res); return 1; }
template <> inline ScriptWindow::BuildTreesWidgets GetParam(ForceType<ScriptWindow::BuildTreesWidgets>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptWindow::BuildTreesWidgets)tmp; }