Update to v4 of house placing patch.
This commit is contained in:
@@ -15,9 +15,25 @@
|
||||
* functions may still be available if you return an older API version
|
||||
* in GetAPIVersion() in info.nut.
|
||||
*
|
||||
* \b 1.7.0
|
||||
*
|
||||
* 1.7.0 is not yet released. The following changes are not set in stone yet.
|
||||
*
|
||||
* \b 1.6.0
|
||||
*
|
||||
* 1.6.0 is not yet released. The following changes are not set in stone yet.
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.3
|
||||
*
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.2
|
||||
*
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.1
|
||||
*
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.0
|
||||
*
|
||||
|
@@ -1141,7 +1141,6 @@ 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");
|
||||
@@ -1252,6 +1251,9 @@ 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_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_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");
|
||||
@@ -1260,6 +1262,10 @@ void SQGSWindow_Register(Squirrel *engine)
|
||||
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_PREV_VARIANT_SEL, "WID_HP_PREV_VARIANT_SEL");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_PREV_VARIANT, "WID_HP_PREV_VARIANT");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_NEXT_VARIANT_SEL, "WID_HP_NEXT_VARIANT_SEL");
|
||||
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_HP_NEXT_VARIANT, "WID_HP_NEXT_VARIANT");
|
||||
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");
|
||||
@@ -1269,9 +1275,6 @@ void SQGSWindow_Register(Squirrel *engine)
|
||||
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");
|
||||
|
@@ -15,9 +15,25 @@
|
||||
* functions may still be available if you return an older API version
|
||||
* in GetAPIVersion() in info.nut.
|
||||
*
|
||||
* \b 1.7.0
|
||||
*
|
||||
* 1.7.0 is not yet released. The following changes are not set in stone yet.
|
||||
*
|
||||
* \b 1.6.0
|
||||
*
|
||||
* 1.6.0 is not yet released. The following changes are not set in stone yet.
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.3
|
||||
*
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.2
|
||||
*
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.1
|
||||
*
|
||||
* No changes
|
||||
*
|
||||
* \b 1.5.0
|
||||
*
|
||||
|
@@ -30,7 +30,7 @@ ScriptExecMode::ScriptExecMode()
|
||||
this->SetDoCommandMode(&ScriptExecMode::ModeProc, this);
|
||||
}
|
||||
|
||||
ScriptExecMode::~ScriptExecMode()
|
||||
void ScriptExecMode::FinalRelease()
|
||||
{
|
||||
if (this->GetDoCommandModeInstance() != this) {
|
||||
/* Ignore this error if the script already died. */
|
||||
@@ -38,5 +38,9 @@ ScriptExecMode::~ScriptExecMode()
|
||||
throw Script_FatalError("ScriptExecMode object was removed while it was not the latest *Mode object created.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScriptExecMode::~ScriptExecMode()
|
||||
{
|
||||
this->SetDoCommandMode(this->last_mode, this->last_instance);
|
||||
}
|
||||
|
@@ -46,6 +46,8 @@ public:
|
||||
* in when the instance was created.
|
||||
*/
|
||||
~ScriptExecMode();
|
||||
|
||||
virtual void FinalRelease();
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_EXECMODE_HPP */
|
||||
|
@@ -371,8 +371,8 @@ static bool NormaliseTileOffset(int32 *tile)
|
||||
if (!::IsValidTile(tile) || !::IsValidTile(start) || !::IsValidTile(end)) return -1;
|
||||
if (::DistanceManhattan(tile, start) != 1 || ::DistanceManhattan(tile, end) != 1) return -1;
|
||||
|
||||
/* ROAD_NW ROAD_SW ROAD_SE ROAD_NE */
|
||||
static const TileIndex neighbours[] = {::TileDiffXY(0, -1), ::TileDiffXY(1, 0), ::TileDiffXY(0, 1), ::TileDiffXY(-1, 0)};
|
||||
/* ROAD_NW ROAD_SW ROAD_SE ROAD_NE */
|
||||
static const TileIndexDiff neighbours[] = {::TileDiffXY(0, -1), ::TileDiffXY(1, 0), ::TileDiffXY(0, 1), ::TileDiffXY(-1, 0)};
|
||||
Array *existing = (Array*)alloca(sizeof(Array) + lengthof(neighbours) * sizeof(int32));
|
||||
existing->size = 0;
|
||||
|
||||
|
@@ -30,7 +30,7 @@ ScriptTestMode::ScriptTestMode()
|
||||
this->SetDoCommandMode(&ScriptTestMode::ModeProc, this);
|
||||
}
|
||||
|
||||
ScriptTestMode::~ScriptTestMode()
|
||||
void ScriptTestMode::FinalRelease()
|
||||
{
|
||||
if (this->GetDoCommandModeInstance() != this) {
|
||||
/* Ignore this error if the script already died. */
|
||||
@@ -38,5 +38,9 @@ ScriptTestMode::~ScriptTestMode()
|
||||
throw Script_FatalError("Testmode object was removed while it was not the latest *Mode object created.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ScriptTestMode::~ScriptTestMode()
|
||||
{
|
||||
this->SetDoCommandMode(this->last_mode, this->last_instance);
|
||||
}
|
||||
|
@@ -48,6 +48,8 @@ public:
|
||||
* in when the instance was created.
|
||||
*/
|
||||
~ScriptTestMode();
|
||||
|
||||
virtual void FinalRelease();
|
||||
};
|
||||
|
||||
#endif /* SCRIPT_TESTMODE_HPP */
|
||||
|
@@ -2342,7 +2342,6 @@ 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.
|
||||
@@ -2487,6 +2486,13 @@ public:
|
||||
WID_TF_LAYOUT_RANDOM = ::WID_TF_LAYOUT_RANDOM, ///< Selection for a randomly chosen town layout.
|
||||
};
|
||||
|
||||
/** 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.
|
||||
};
|
||||
|
||||
/** Widgets of the #HousePickerWindow class. */
|
||||
enum HousePickerWidgets {
|
||||
WID_HP_CAPTION = ::WID_HP_CAPTION,
|
||||
@@ -2497,6 +2503,10 @@ public:
|
||||
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_PREV_VARIANT_SEL = ::WID_HP_PREV_VARIANT_SEL, ///< Selection widget to show/hide the prev variant buttons.
|
||||
WID_HP_PREV_VARIANT = ::WID_HP_PREV_VARIANT, ///< Prev variant button.
|
||||
WID_HP_NEXT_VARIANT_SEL = ::WID_HP_NEXT_VARIANT_SEL, ///< Selection widget to show/hide the next variant buttons.
|
||||
WID_HP_NEXT_VARIANT = ::WID_HP_NEXT_VARIANT, ///< Next variant button.
|
||||
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.
|
||||
@@ -2508,13 +2518,6 @@ public:
|
||||
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 {
|
||||
|
@@ -233,10 +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::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::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; }
|
||||
|
Reference in New Issue
Block a user