From 189eff7a49b89ec388f5adfd6e6f8350a21c2603 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 6 Oct 2025 19:19:43 +0200 Subject: [PATCH] Use cmake to create vfs-mw/builtin.omwscripts --- files/data-mw/CMakeLists.txt | 12 +++++-- files/data-mw/builtin-extra.omwscripts | 8 +++++ files/data-mw/builtin.omwscripts | 50 -------------------------- files/data/builtin.omwscripts | 2 -- 4 files changed, 18 insertions(+), 54 deletions(-) create mode 100644 files/data-mw/builtin-extra.omwscripts delete mode 100644 files/data-mw/builtin.omwscripts diff --git a/files/data-mw/CMakeLists.txt b/files/data-mw/CMakeLists.txt index 75ffe703d3..2c0a589bd6 100644 --- a/files/data-mw/CMakeLists.txt +++ b/files/data-mw/CMakeLists.txt @@ -21,8 +21,6 @@ set(BUILTIN_DATA_MW_FILES # Game-specific settings for calendar.lua openmw_aux/calendarconfig.lua - builtin.omwscripts - scripts/omw/cellhandlers.lua scripts/omw/combat/common.lua scripts/omw/combat/global.lua @@ -37,3 +35,13 @@ set(BUILTIN_DATA_MW_FILES foreach (f ${BUILTIN_DATA_MW_FILES}) copy_resource_file("${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${OPENMW_RESOURCES_ROOT}" "resources/vfs-mw/${f}") endforeach (f) + +# Concat data/builtin.omwscripts and data-mw/builtin-extra.omwscripts to create vfs-mw/builtin.omwscripts +set(builtinBase "${CMAKE_CURRENT_SOURCE_DIR}/../data/builtin.omwscripts") +set(builtinExtra "${CMAKE_CURRENT_SOURCE_DIR}/builtin-extra.omwscripts") +set(builtinTemp "${CMAKE_BINARY_DIR}/tmp") +set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${builtinBase}" "${builtinExtra}") +file(COPY "${builtinBase}" DESTINATION "${builtinTemp}") +file(READ "${builtinExtra}" builtinContents) +file(APPEND "${builtinTemp}/builtin.omwscripts" "${builtinContents}") +copy_resource_file("${builtinTemp}/builtin.omwscripts" "${OPENMW_RESOURCES_ROOT}" "resources/vfs-mw/builtin.omwscripts") diff --git a/files/data-mw/builtin-extra.omwscripts b/files/data-mw/builtin-extra.omwscripts new file mode 100644 index 0000000000..0d63fd1dde --- /dev/null +++ b/files/data-mw/builtin-extra.omwscripts @@ -0,0 +1,8 @@ +# Game specific scripts to append to builtin.omwscripts +GLOBAL: scripts/omw/cellhandlers.lua +GLOBAL: scripts/omw/combat/global.lua +MENU: scripts/omw/combat/menu.lua +NPC,CREATURE,PLAYER: scripts/omw/combat/local.lua +PLAYER: scripts/omw/music/music.lua +MENU: scripts/omw/music/settings.lua +PLAYER: scripts/omw/playerskillhandlers.lua diff --git a/files/data-mw/builtin.omwscripts b/files/data-mw/builtin.omwscripts deleted file mode 100644 index 217bac5509..0000000000 --- a/files/data-mw/builtin.omwscripts +++ /dev/null @@ -1,50 +0,0 @@ -# NB: This file is a superset of the one in data! - -# UI framework -MENU,PLAYER: scripts/omw/mwui/init.lua - -# Settings framework -MENU: scripts/omw/settings/menu.lua -PLAYER: scripts/omw/settings/player.lua -GLOBAL: scripts/omw/settings/global.lua - -# Mechanics -GLOBAL: scripts/omw/activationhandlers.lua -GLOBAL: scripts/omw/usehandlers.lua -GLOBAL: scripts/omw/worldeventhandlers.lua -GLOBAL: scripts/omw/crimes.lua -CREATURE, NPC, PLAYER: scripts/omw/mechanics/animationcontroller.lua -PLAYER: scripts/omw/skillhandlers.lua -PLAYER: scripts/omw/mechanics/playercontroller.lua -MENU: scripts/omw/camera/settings.lua -MENU: scripts/omw/input/settings.lua -PLAYER: scripts/omw/input/playercontrols.lua -PLAYER: scripts/omw/camera/camera.lua -PLAYER: scripts/omw/input/actionbindings.lua -PLAYER: scripts/omw/input/smoothmovement.lua -PLAYER: scripts/omw/input/gamepadcontrols.lua -NPC,CREATURE: scripts/omw/ai.lua -GLOBAL: scripts/omw/mechanics/globalcontroller.lua -CREATURE, NPC, PLAYER: scripts/omw/mechanics/actorcontroller.lua -NPC,CREATURE,PLAYER: scripts/omw/combat/interface.lua - -# User interface -PLAYER: scripts/omw/ui.lua - -# Lua console -MENU: scripts/omw/console/menu.lua -PLAYER: scripts/omw/console/player.lua -GLOBAL: scripts/omw/console/global.lua -CUSTOM: scripts/omw/console/local.lua - -# Music system -NPC,CREATURE: scripts/omw/music/actor.lua - -# Game specific -GLOBAL: scripts/omw/cellhandlers.lua -GLOBAL: scripts/omw/combat/global.lua -MENU: scripts/omw/combat/menu.lua -NPC,CREATURE,PLAYER: scripts/omw/combat/local.lua -PLAYER: scripts/omw/music/music.lua -MENU: scripts/omw/music/settings.lua -PLAYER: scripts/omw/playerskillhandlers.lua diff --git a/files/data/builtin.omwscripts b/files/data/builtin.omwscripts index f61182c033..6a3899accd 100644 --- a/files/data/builtin.omwscripts +++ b/files/data/builtin.omwscripts @@ -1,5 +1,3 @@ -# NB: data-mw overrides this file! - # UI framework MENU,PLAYER: scripts/omw/mwui/init.lua