mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-11-10 12:24:22 +08:00
chore(Core/modules): necessary core changes for mod-eluna rename (#22962)
Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
This commit is contained in:
parent
2a78a1788f
commit
bb2f2daacb
@ -35,8 +35,8 @@ CU_GET_GLOBAL("AC_ADD_SCRIPTS_INCLUDE")
|
|||||||
set("AC_SCRIPTS_INCLUDES" "")
|
set("AC_SCRIPTS_INCLUDES" "")
|
||||||
set("AC_MODULE_LIST" "")
|
set("AC_MODULE_LIST" "")
|
||||||
set("AC_SCRIPTS_LIST" "")
|
set("AC_SCRIPTS_LIST" "")
|
||||||
set(MOD_ELUNA_FOUND 0)
|
set(MOD_ALE_FOUND 0)
|
||||||
set(MOD_ELUNA_PATH "")
|
set(MOD_ALE_PATH "")
|
||||||
|
|
||||||
foreach(include ${AC_ADD_SCRIPTS_INCLUDE})
|
foreach(include ${AC_ADD_SCRIPTS_INCLUDE})
|
||||||
set("AC_SCRIPTS_INCLUDES" "#include \"${include}\"\n${AC_SCRIPTS_INCLUDES}")
|
set("AC_SCRIPTS_INCLUDES" "#include \"${include}\"\n${AC_SCRIPTS_INCLUDES}")
|
||||||
@ -50,12 +50,12 @@ foreach(scriptName ${AC_ADD_SCRIPTS_LIST})
|
|||||||
set("AC_SCRIPTS_LIST" " ${scriptName};\n${AC_SCRIPTS_LIST}")
|
set("AC_SCRIPTS_LIST" " ${scriptName};\n${AC_SCRIPTS_LIST}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
function(ConfigureElunaModule moduleName)
|
function(ConfigureALEModule moduleName)
|
||||||
set(MOD_ELUNA_FOUND 1 PARENT_SCOPE)
|
set(MOD_ALE_FOUND 1 PARENT_SCOPE)
|
||||||
GetPathToModuleSource(${SOURCE_MODULE} MODULE_SOURCE_PATH)
|
GetPathToModuleSource(${SOURCE_MODULE} MODULE_SOURCE_PATH)
|
||||||
set(MOD_ELUNA_PATH ${MODULE_SOURCE_PATH} PARENT_SCOPE)
|
set(MOD_ALE_PATH ${MODULE_SOURCE_PATH} PARENT_SCOPE)
|
||||||
|
|
||||||
# Define eluna compile options
|
# Define ALE compile options
|
||||||
target_compile_options(game-interface
|
target_compile_options(game-interface
|
||||||
INTERFACE
|
INTERFACE
|
||||||
-DAZEROTHCORE
|
-DAZEROTHCORE
|
||||||
@ -76,9 +76,9 @@ foreach(SOURCE_MODULE ${MODULES_MODULE_LIST})
|
|||||||
set(${MODULE_MODULE_VARIABLE} "static")
|
set(${MODULE_MODULE_VARIABLE} "static")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Use only static for mod-eluna
|
# Use only static for mod-ALE
|
||||||
if (SOURCE_MODULE MATCHES "mod-eluna")
|
if (SOURCE_MODULE MATCHES "mod-ale")
|
||||||
ConfigureElunaModule(${SOURCE_MODULE})
|
ConfigureALEModule(${SOURCE_MODULE})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Build the Graph values
|
# Build the Graph values
|
||||||
@ -267,9 +267,9 @@ ConfigureScriptLoader("static" SCRIPT_MODULE_PRIVATE_SCRIPTLOADER OFF ${STATIC_S
|
|||||||
|
|
||||||
list(REMOVE_DUPLICATES SCRIPT_MODULE_PRIVATE_SCRIPTLOADER)
|
list(REMOVE_DUPLICATES SCRIPT_MODULE_PRIVATE_SCRIPTLOADER)
|
||||||
|
|
||||||
if (MOD_ELUNA_FOUND)
|
if (MOD_ALE_FOUND)
|
||||||
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ELUNA_PATH}/lualib/lua.c)
|
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ALE_PATH}/lualib/lua.c)
|
||||||
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ELUNA_PATH}/lualib/luac.c)
|
list(REMOVE_ITEM PRIVATE_SOURCES_MODULES ${MOD_ALE_PATH}/lualib/luac.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(modules STATIC
|
add_library(modules STATIC
|
||||||
@ -277,7 +277,7 @@ add_library(modules STATIC
|
|||||||
${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER}
|
${SCRIPT_MODULE_PRIVATE_SCRIPTLOADER}
|
||||||
${PRIVATE_SOURCES_MODULES})
|
${PRIVATE_SOURCES_MODULES})
|
||||||
|
|
||||||
if (MOD_ELUNA_FOUND)
|
if (MOD_ALE_FOUND)
|
||||||
target_link_libraries(modules PUBLIC lualib)
|
target_link_libraries(modules PUBLIC lualib)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -358,7 +358,7 @@ target_compile_options(modules
|
|||||||
INTERFACE
|
INTERFACE
|
||||||
-DCONFIG_FILE_LIST=$<1:"${CONFIG_LIST}">)
|
-DCONFIG_FILE_LIST=$<1:"${CONFIG_LIST}">)
|
||||||
|
|
||||||
if (MOD_ELUNA_FOUND)
|
if (MOD_ALE_FOUND)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
target_compile_definitions(modules
|
target_compile_definitions(modules
|
||||||
PUBLIC
|
PUBLIC
|
||||||
@ -377,10 +377,10 @@ if (MOD_ELUNA_FOUND)
|
|||||||
add_custom_command(TARGET modules
|
add_custom_command(TARGET modules
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/"
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/"
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${MOD_ELUNA_PATH}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/")
|
COMMAND ${CMAKE_COMMAND} -E copy_directory "${MOD_ALE_PATH}/LuaEngine/extensions" "${CMAKE_BINARY_DIR}/bin/${MSVC_CONFIGURATION_NAME}lua_scripts/extensions/")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(DIRECTORY "${MOD_ELUNA_PATH}/LuaEngine/extensions" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/lua_scripts/")
|
install(DIRECTORY "${MOD_ALE_PATH}/LuaEngine/extensions" DESTINATION "${CMAKE_INSTALL_PREFIX}/bin/lua_scripts/")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message("")
|
message("")
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
#include "UpdateFields.h"
|
#include "UpdateFields.h"
|
||||||
|
|
||||||
class ElunaEventProcessor;
|
class ALEEventProcessor;
|
||||||
|
|
||||||
enum TempSummonType
|
enum TempSummonType
|
||||||
{
|
{
|
||||||
@ -727,7 +727,7 @@ public:
|
|||||||
ObjectVisibilityContainer const& GetObjectVisibilityContainer() const { return _objectVisibilityContainer; }
|
ObjectVisibilityContainer const& GetObjectVisibilityContainer() const { return _objectVisibilityContainer; }
|
||||||
|
|
||||||
// Event handler
|
// Event handler
|
||||||
ElunaEventProcessor* elunaEvents;
|
ALEEventProcessor* ALEEvents;
|
||||||
EventProcessor m_Events;
|
EventProcessor m_Events;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
@ -2118,7 +2118,7 @@ void InstanceMap::CreateInstanceScript(bool load, std::string data, uint32 compl
|
|||||||
if (instance_data)
|
if (instance_data)
|
||||||
isOtherAI = true;
|
isOtherAI = true;
|
||||||
|
|
||||||
// if Eluna AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID
|
// if ALE AI was fetched succesfully we should not call CreateInstanceData nor set the unused scriptID
|
||||||
if (!isOtherAI)
|
if (!isOtherAI)
|
||||||
{
|
{
|
||||||
InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId());
|
InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId());
|
||||||
@ -2132,7 +2132,7 @@ void InstanceMap::CreateInstanceScript(bool load, std::string data, uint32 compl
|
|||||||
if (!instance_data)
|
if (!instance_data)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// use mangos behavior if we are dealing with Eluna AI
|
// use mangos behavior if we are dealing with ALE AI
|
||||||
// initialize should then be called only if load is false
|
// initialize should then be called only if load is false
|
||||||
if (!isOtherAI || !load)
|
if (!isOtherAI || !load)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,12 +15,12 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ElunaScript.h"
|
#include "ALEScript.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
|
|
||||||
ElunaScript::ElunaScript(const char* name) : ScriptObject(name)
|
ALEScript::ALEScript(const char* name) : ScriptObject(name)
|
||||||
{
|
{
|
||||||
ScriptRegistry<ElunaScript>::AddScript(this);
|
ScriptRegistry<ALEScript>::AddScript(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
template class AC_GAME_API ScriptRegistry<ElunaScript>;
|
template class AC_GAME_API ScriptRegistry<ALEScript>;
|
||||||
@ -15,15 +15,15 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef SCRIPT_OBJECT_ELUNA_SCRIPT_H_
|
#ifndef SCRIPT_OBJECT_ALE_SCRIPT_H_
|
||||||
#define SCRIPT_OBJECT_ELUNA_SCRIPT_H_
|
#define SCRIPT_OBJECT_ALE_SCRIPT_H_
|
||||||
|
|
||||||
#include "ScriptObject.h"
|
#include "ScriptObject.h"
|
||||||
|
|
||||||
class ElunaScript : public ScriptObject
|
class ALEScript : public ScriptObject
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
ElunaScript(const char* name);
|
ALEScript(const char* name);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@ -39,7 +39,7 @@
|
|||||||
#include "CreatureScript.h"
|
#include "CreatureScript.h"
|
||||||
#include "DatabaseScript.h"
|
#include "DatabaseScript.h"
|
||||||
#include "DynamicObjectScript.h"
|
#include "DynamicObjectScript.h"
|
||||||
#include "ElunaScript.h"
|
#include "ALEScript.h"
|
||||||
#include "FormulaScript.h"
|
#include "FormulaScript.h"
|
||||||
#include "GameEventScript.h"
|
#include "GameEventScript.h"
|
||||||
#include "GameObjectScript.h"
|
#include "GameObjectScript.h"
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AreaTriggerScript.h"
|
#include "AreaTriggerScript.h"
|
||||||
#include "ElunaScript.h"
|
#include "ALEScript.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "ScriptMgrMacros.h"
|
#include "ScriptMgrMacros.h"
|
||||||
@ -26,7 +26,7 @@ bool ScriptMgr::OnAreaTrigger(Player* player, AreaTrigger const* trigger)
|
|||||||
ASSERT(player);
|
ASSERT(player);
|
||||||
ASSERT(trigger);
|
ASSERT(trigger);
|
||||||
|
|
||||||
auto ret = IsValidBoolScript<ElunaScript>([&](ElunaScript* script)
|
auto ret = IsValidBoolScript<ALEScript>([&](ALEScript* script)
|
||||||
{
|
{
|
||||||
return script->CanAreaTrigger(player, trigger);
|
return script->CanAreaTrigger(player, trigger);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "WeatherScript.h"
|
#include "WeatherScript.h"
|
||||||
#include "ElunaScript.h"
|
#include "ALEScript.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "ScriptMgrMacros.h"
|
#include "ScriptMgrMacros.h"
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ void ScriptMgr::OnWeatherChange(Weather* weather, WeatherState state, float grad
|
|||||||
{
|
{
|
||||||
ASSERT(weather);
|
ASSERT(weather);
|
||||||
|
|
||||||
ExecuteScript<ElunaScript>([&](ElunaScript* script)
|
ExecuteScript<ALEScript>([&](ALEScript* script)
|
||||||
{
|
{
|
||||||
script->OnWeatherChange(weather, state, grade);
|
script->OnWeatherChange(weather, state, grade);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -127,7 +127,7 @@ void ScriptMgr::Unload()
|
|||||||
SCR_CLEAR<CreatureScript>();
|
SCR_CLEAR<CreatureScript>();
|
||||||
SCR_CLEAR<DatabaseScript>();
|
SCR_CLEAR<DatabaseScript>();
|
||||||
SCR_CLEAR<DynamicObjectScript>();
|
SCR_CLEAR<DynamicObjectScript>();
|
||||||
SCR_CLEAR<ElunaScript>();
|
SCR_CLEAR<ALEScript>();
|
||||||
SCR_CLEAR<FormulaScript>();
|
SCR_CLEAR<FormulaScript>();
|
||||||
SCR_CLEAR<GameEventScript>();
|
SCR_CLEAR<GameEventScript>();
|
||||||
SCR_CLEAR<GameObjectScript>();
|
SCR_CLEAR<GameObjectScript>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user