mirror of https://github.com/OpenRCT2/OpenRCT2.git
Rename __ENABLE_SCRIPTING__ to ENABLE_SCRIPTING
This commit is contained in:
parent
4ebd8da630
commit
c67962577a
|
@ -123,7 +123,7 @@ if (ENABLE_LIGHTFX)
|
|||
add_definitions(-D__ENABLE_LIGHTFX__)
|
||||
endif ()
|
||||
if (ENABLE_SCRIPTING)
|
||||
add_definitions(-D__ENABLE_SCRIPTING__)
|
||||
add_definitions(-DENABLE_SCRIPTING)
|
||||
endif ()
|
||||
|
||||
if (NOT DISABLE_DISCORD_RPC)
|
||||
|
|
|
@ -4619,7 +4619,7 @@
|
|||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
__ENABLE_LIGHTFX__,
|
||||
__ENABLE_SCRIPTING__,
|
||||
ENABLE_SCRIPTING,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
|
@ -4665,7 +4665,7 @@
|
|||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"$(inherited)",
|
||||
__ENABLE_LIGHTFX__,
|
||||
__ENABLE_SCRIPTING__,
|
||||
ENABLE_SCRIPTING,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
|
@ -4712,7 +4712,7 @@
|
|||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
__ENABLE_LIGHTFX__,
|
||||
__ENABLE_SCRIPTING__,
|
||||
ENABLE_SCRIPTING,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
|
@ -4755,7 +4755,7 @@
|
|||
OPENGL_NO_LINK,
|
||||
"OPENRCT2_BUILD_INFO_HEADER=\"\\\"$(DERIVED_FILE_DIR)/gitversion.h\\\"\"",
|
||||
__ENABLE_LIGHTFX__,
|
||||
__ENABLE_SCRIPTING__,
|
||||
ENABLE_SCRIPTING,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
|
@ -4796,7 +4796,7 @@
|
|||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
__ENABLE_LIGHTFX__,
|
||||
__ENABLE_SCRIPTING__,
|
||||
ENABLE_SCRIPTING,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
|
@ -4831,7 +4831,7 @@
|
|||
OPENGL_NO_LINK,
|
||||
"OPENRCT2_BUILD_INFO_HEADER=\"\\\"$(DERIVED_FILE_DIR)/gitversion.h\\\"\"",
|
||||
__ENABLE_LIGHTFX__,
|
||||
__ENABLE_SCRIPTING__,
|
||||
ENABLE_SCRIPTING,
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
C4555: expression has no effect; expected expression with side-effect
|
||||
-->
|
||||
<PreprocessorDefinitions>__AVX2__;__SSE4_1__;OPENGL_NO_LINK;_CRT_SECURE_NO_WARNINGS;_USE_MATH_DEFINES;SDL_MAIN_HANDLED;_WINSOCK_DEPRECATED_NO_WARNINGS;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>__ENABLE_SCRIPTING__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>ENABLE_SCRIPTING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary Condition="'$(UseSharedLibs)'!='true'">MultiThreaded</RuntimeLibrary>
|
||||
<RuntimeLibrary Condition="'$(UseSharedLibs)'=='true'">MultiThreadedDLL</RuntimeLibrary>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
void Initialise() override
|
||||
{
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
UiScriptExtensions::Extend(scriptEngine);
|
||||
#endif
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "CustomMenu.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include <memory>
|
||||
# include <openrct2/Context.h>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../interface/Dropdown.h"
|
||||
# include "ScUi.hpp"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../interface/Window.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "CustomMenu.h"
|
||||
# include "ScViewport.hpp"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../interface/Window.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../interface/Widget.h"
|
||||
# include "../interface/Window.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "ScWidget.hpp"
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "UiExtensions.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
namespace OpenRCT2::Scripting
|
||||
{
|
||||
|
|
|
@ -3288,7 +3288,7 @@ static void top_toolbar_init_map_menu(rct_window* w, rct_widget* widget)
|
|||
gDropdownItemsFormat[i++] = STR_MAPGEN_WINDOW_TITLE;
|
||||
}
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems;
|
||||
if (!customMenuItems.empty())
|
||||
{
|
||||
|
@ -3334,7 +3334,7 @@ static void top_toolbar_map_menu_dropdown(int16_t dropdownIndex)
|
|||
}
|
||||
else
|
||||
{
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems;
|
||||
auto customIndex = static_cast<size_t>(dropdownIndex - customStartIndex);
|
||||
if (customMenuItems.size() > customIndex)
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace OpenRCT2
|
|||
std::unique_ptr<DiscordService> _discordService;
|
||||
#endif
|
||||
StdInOutConsole _stdInOutConsole;
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
ScriptEngine _scriptEngine;
|
||||
#endif
|
||||
|
||||
|
@ -140,7 +140,7 @@ namespace OpenRCT2
|
|||
, _audioContext(audioContext)
|
||||
, _uiContext(uiContext)
|
||||
, _localisationService(std::make_unique<LocalisationService>(env))
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
, _scriptEngine(_stdInOutConsole, *env)
|
||||
#endif
|
||||
, _painter(std::make_unique<Painter>(uiContext))
|
||||
|
@ -185,7 +185,7 @@ namespace OpenRCT2
|
|||
return _uiContext;
|
||||
}
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
Scripting::ScriptEngine& GetScriptEngine() override
|
||||
{
|
||||
return _scriptEngine;
|
||||
|
@ -1032,7 +1032,7 @@ namespace OpenRCT2
|
|||
|
||||
Twitch::Update();
|
||||
chat_update();
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
_scriptEngine.Update();
|
||||
#endif
|
||||
_stdInOutConsole.ProcessEvalQueue();
|
||||
|
|
|
@ -114,7 +114,7 @@ namespace OpenRCT2
|
|||
virtual Localisation::LocalisationService& GetLocalisationService() abstract;
|
||||
virtual IObjectManager& GetObjectManager() abstract;
|
||||
virtual IObjectRepository& GetObjectRepository() abstract;
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
virtual Scripting::ScriptEngine& GetScriptEngine() abstract;
|
||||
#endif
|
||||
virtual ITrackDesignRepository* GetTrackDesignRepository() abstract;
|
||||
|
|
|
@ -592,14 +592,14 @@ void game_load_init()
|
|||
|
||||
void game_load_scripts()
|
||||
{
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
GetContext()->GetScriptEngine().LoadPlugins();
|
||||
#endif
|
||||
}
|
||||
|
||||
void game_unload_scripts()
|
||||
{
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
GetContext()->GetScriptEngine().UnloadPlugins();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ void GameState::UpdateLogic()
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
auto& hookEngine = GetContext()->GetScriptEngine().GetHookEngine();
|
||||
hookEngine.Call(HOOK_TYPE::INTERVAL_TICK, true);
|
||||
|
||||
|
@ -279,7 +279,7 @@ void GameState::UpdateLogic()
|
|||
date_update();
|
||||
_date = Date(gDateMonthsElapsed, gDateMonthTicks);
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
if (day != _date.GetDay())
|
||||
{
|
||||
hookEngine.Call(HOOK_TYPE::INTERVAL_DAY, true);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../Context.h"
|
||||
# include "../scripting/ScriptEngine.h"
|
||||
|
|
|
@ -400,7 +400,7 @@ namespace GameActions
|
|||
}
|
||||
|
||||
GameActionResult::Ptr result = QueryInternal(action, topLevel);
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
if (result->Error == GA_ERROR::OK
|
||||
&& ((network_get_mode() == NETWORK_MODE_NONE) || (flags & GAME_COMMAND_FLAG_NETWORKED)))
|
||||
{
|
||||
|
@ -444,7 +444,7 @@ namespace GameActions
|
|||
|
||||
// Execute the action, changing the game state
|
||||
result = action->Execute();
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
if (result->Error == GA_ERROR::OK)
|
||||
{
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
|
|
|
@ -172,7 +172,7 @@ namespace GameActions
|
|||
Register<GuestSetFlagsAction>();
|
||||
Register<ParkSetDateAction>();
|
||||
Register<SetCheatAction>();
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
Register<CustomAction>();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ void StdInOutConsole::Start()
|
|||
|
||||
std::future<void> StdInOutConsole::Eval(const std::string& s)
|
||||
{
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
return scriptEngine.Eval(s);
|
||||
#else
|
||||
|
@ -71,7 +71,7 @@ std::future<void> StdInOutConsole::Eval(const std::string& s)
|
|||
|
||||
void StdInOutConsole::ProcessEvalQueue()
|
||||
{
|
||||
#ifndef __ENABLE_SCRIPTING__
|
||||
#ifndef ENABLE_SCRIPTING
|
||||
while (_evalQueue.size() > 0)
|
||||
{
|
||||
auto item = std::move(_evalQueue.front());
|
||||
|
|
|
@ -1474,7 +1474,7 @@ void Network::Server_Send_SCRIPTS(NetworkConnection& connection) const
|
|||
{
|
||||
std::unique_ptr<NetworkPacket> packet(NetworkPacket::Allocate());
|
||||
*packet << static_cast<uint32_t>(NETWORK_COMMAND_SCRIPTS);
|
||||
# ifdef __ENABLE_SCRIPTING__
|
||||
# ifdef ENABLE_SCRIPTING
|
||||
using namespace OpenRCT2::Scripting;
|
||||
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
|
@ -2445,7 +2445,7 @@ void Network::Client_Handle_SCRIPTS(NetworkConnection& connection, NetworkPacket
|
|||
uint32_t numScripts{};
|
||||
packet >> numScripts;
|
||||
|
||||
# ifdef __ENABLE_SCRIPTING__
|
||||
# ifdef ENABLE_SCRIPTING
|
||||
auto& scriptEngine = GetContext()->GetScriptEngine();
|
||||
for (uint32_t i = 0; i < numScripts; i++)
|
||||
{
|
||||
|
@ -2888,7 +2888,7 @@ void Network::Client_Handle_CHAT([[maybe_unused]] NetworkConnection& connection,
|
|||
|
||||
static bool ProcessChatMessagePluginHooks(const NetworkPlayer& player, std::string& text)
|
||||
{
|
||||
# ifdef __ENABLE_SCRIPTING__
|
||||
# ifdef ENABLE_SCRIPTING
|
||||
auto& hookEngine = GetContext()->GetScriptEngine().GetHookEngine();
|
||||
if (hookEngine.HasSubscriptions(OpenRCT2::Scripting::HOOK_TYPE::NETWORK_CHAT))
|
||||
{
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include <cstdio>
|
||||
# include <dukglue/dukglue.h>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "HookEngine.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../common.h"
|
||||
# include "Duktape.hpp"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "Plugin.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "Duktape.hpp"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../Context.h"
|
||||
# include "../config/Config.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../interface/InteractiveConsole.h"
|
||||
# include "Duktape.hpp"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../actions/CustomAction.hpp"
|
||||
# include "../actions/ParkSetNameAction.hpp"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../Context.h"
|
||||
# include "../Date.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "Duktape.hpp"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../common.h"
|
||||
# include "../world/Sprite.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../common.h"
|
||||
# include "../ride/Ride.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../actions/NetworkModifyGroupAction.hpp"
|
||||
# include "../actions/PlayerKickAction.hpp"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../Context.h"
|
||||
# include "../common.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../Context.h"
|
||||
# include "../common.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../common.h"
|
||||
# include "../ride/Ride.h"
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../Context.h"
|
||||
# include "../common.h"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "ScriptEngine.h"
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#ifdef __ENABLE_SCRIPTING__
|
||||
#ifdef ENABLE_SCRIPTING
|
||||
|
||||
# include "../common.h"
|
||||
# include "../core/FileWatcher.h"
|
||||
|
|
Loading…
Reference in New Issue