diff --git a/.gitignore b/.gitignore index f25adf58e6..dfb56dc359 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,7 @@ apps/wizard/ui_intropage.h apps/wizard/ui_languageselectionpage.h apps/wizard/ui_methodselectionpage.h components/ui_contentselector.h +components/version/version.cpp docs/mainpage.hpp docs/Doxyfile docs/DoxyfilePages diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ee31b6762..21c1c55275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ Bug #7553: Faction reaction loading is incorrect Feature #3537: Shader-based water ripples Feature #5492: Let rain and snow collide with statics + Feature #6149: Dehardcode Lua API_REVISION Feature #6447: Add LOD support to Object Paging Feature #6491: Add support for Qt6 Feature #6556: Lua API for sounds diff --git a/CMakeLists.txt b/CMakeLists.txt index d9865e6569..f887cb181e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ message(STATUS "Configuring OpenMW...") set(OPENMW_VERSION_MAJOR 0) set(OPENMW_VERSION_MINOR 49) set(OPENMW_VERSION_RELEASE 0) +set(OPENMW_LUA_API_REVISION 45) set(OPENMW_VERSION_COMMITHASH "") set(OPENMW_VERSION_TAGHASH "") @@ -1041,7 +1042,6 @@ elseif(NOT APPLE) # Install global configuration files INSTALL(FILES "${INSTALL_SOURCE}/defaults.bin" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw") INSTALL(FILES "${INSTALL_SOURCE}/openmw.cfg.install" DESTINATION "${SYSCONFDIR}" RENAME "openmw.cfg" COMPONENT "openmw") - INSTALL(FILES "${INSTALL_SOURCE}/resources/version" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw") INSTALL(FILES "${INSTALL_SOURCE}/gamecontrollerdb.txt" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw") IF(BUILD_OPENCS) diff --git a/apps/bulletobjecttool/main.cpp b/apps/bulletobjecttool/main.cpp index 2610061af6..d52d278f9e 100644 --- a/apps/bulletobjecttool/main.cpp +++ b/apps/bulletobjecttool/main.cpp @@ -146,8 +146,7 @@ namespace config.filterOutNonExistingPaths(dataDirs); const auto resDir = variables["resources"].as(); - const auto v = Version::getOpenmwVersion(resDir); - Log(Debug::Info) << v.describe(); + Log(Debug::Info) << Version::getOpenmwVersionDescription(); dataDirs.insert(dataDirs.begin(), resDir / "vfs"); const auto fileCollections = Files::Collections(dataDirs); const auto archives = variables["fallback-archive"].as(); diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 0caf7a576a..023d6b729a 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -174,14 +174,13 @@ Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() void Launcher::MainDialog::setVersionLabel() { // Add version information to bottom of the window - Version::Version v = Version::getOpenmwVersion(mGameSettings.value("resources").toUtf8().constData()); - - QString revision(QString::fromUtf8(v.mCommitHash.c_str())); - QString tag(QString::fromUtf8(v.mTagHash.c_str())); + QString revision(QString::fromUtf8(Version::getCommitHash().data(), Version::getCommitHash().size())); + QString tag(QString::fromUtf8(Version::getTagHash().data(), Version::getTagHash().size())); versionLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); - if (!v.mVersion.empty() && (revision.isEmpty() || revision == tag)) - versionLabel->setText(tr("OpenMW %1 release").arg(QString::fromUtf8(v.mVersion.c_str()))); + if (!Version::getVersion().empty() && (revision.isEmpty() || revision == tag)) + versionLabel->setText( + tr("OpenMW %1 release").arg(QString::fromUtf8(Version::getVersion().data(), Version::getVersion().size()))); else versionLabel->setText(tr("OpenMW development (%1)").arg(revision.left(10))); diff --git a/apps/navmeshtool/main.cpp b/apps/navmeshtool/main.cpp index e5126d9209..86ff8c3ddb 100644 --- a/apps/navmeshtool/main.cpp +++ b/apps/navmeshtool/main.cpp @@ -165,8 +165,7 @@ namespace NavMeshTool config.filterOutNonExistingPaths(dataDirs); const auto resDir = variables["resources"].as(); - Version::Version v = Version::getOpenmwVersion(resDir); - Log(Debug::Info) << v.describe(); + Log(Debug::Info) << Version::getOpenmwVersionDescription(); dataDirs.insert(dataDirs.begin(), resDir / "vfs"); const auto fileCollections = Files::Collections(dataDirs); const auto archives = variables["fallback-archive"].as(); diff --git a/apps/opencs/CMakeLists.txt b/apps/opencs/CMakeLists.txt index 20bd62d145..8586f490e8 100644 --- a/apps/opencs/CMakeLists.txt +++ b/apps/opencs/CMakeLists.txt @@ -225,10 +225,6 @@ if(APPLE AND BUILD_OPENCS) MACOSX_PACKAGE_LOCATION Resources/resources) set_source_files_properties(${OPENCS_OPENMW_CFG} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - - add_custom_command(TARGET openmw-cs - POST_BUILD - COMMAND cp "${OpenMW_BINARY_DIR}/resources/version" "${OPENCS_BUNDLE_RESOURCES_DIR}/resources") endif() target_link_libraries(openmw-cs-lib diff --git a/apps/opencs/view/doc/view.cpp b/apps/opencs/view/doc/view.cpp index 08db4efa5e..4f4e687d8f 100644 --- a/apps/opencs/view/doc/view.cpp +++ b/apps/opencs/view/doc/view.cpp @@ -774,7 +774,7 @@ void CSVDoc::View::tutorial() void CSVDoc::View::infoAbout() { // Get current OpenMW version - QString versionInfo = (Version::getOpenmwVersionDescription(mDocument->getResourceDir()) + + QString versionInfo = (Version::getOpenmwVersionDescription() + #if defined(__x86_64__) || defined(_M_X64) " (64-bit)") .c_str(); diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 3df00f1be0..ec9636fde1 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -210,10 +210,6 @@ if(APPLE) configure_file("${OpenMW_BINARY_DIR}/openmw.cfg" ${BUNDLE_RESOURCES_DIR} COPYONLY) configure_file("${OpenMW_BINARY_DIR}/gamecontrollerdb.txt" ${BUNDLE_RESOURCES_DIR} COPYONLY) - add_custom_command(TARGET openmw - POST_BUILD - COMMAND cp "${OpenMW_BINARY_DIR}/resources/version" "${BUNDLE_RESOURCES_DIR}/resources") - find_library(COCOA_FRAMEWORK Cocoa) find_library(IOKIT_FRAMEWORK IOKit) target_link_libraries(openmw ${COCOA_FRAMEWORK} ${IOKIT_FRAMEWORK}) diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp index 0c77329f48..1d3232290d 100644 --- a/apps/openmw/engine.cpp +++ b/apps/openmw/engine.cpp @@ -723,7 +723,7 @@ void OMW::Engine::prepareEngine() mWindowManager = std::make_unique(mWindow, mViewer, guiRoot, mResourceSystem.get(), mWorkQueue.get(), mCfgMgr.getLogPath(), mScriptConsoleMode, mTranslationDataStorage, mEncoding, - Version::getOpenmwVersionDescription(mResDir), shadersSupported, mCfgMgr); + Version::getOpenmwVersionDescription(), shadersSupported, mCfgMgr); mEnvironment.setWindowManager(*mWindowManager); mInputManager = std::make_unique(mWindow, mViewer, mScreenCaptureHandler, diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index e326e0aa2b..a78bd22d42 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -58,27 +58,14 @@ bool parseOptions(int argc, char** argv, OMW::Engine& engine, Files::Configurati if (variables.count("version")) { - cfgMgr.readConfiguration(variables, desc, true); - - Version::Version v - = Version::getOpenmwVersion(variables["resources"] - .as() - .u8string()); // This call to u8string is redundant, but required to build - // on MSVC 14.26 due to implementation bugs. - getRawStdout() << v.describe() << std::endl; + getRawStdout() << Version::getOpenmwVersionDescription() << std::endl; return false; } cfgMgr.readConfiguration(variables, desc); setupLogging(cfgMgr.getLogPath(), "OpenMW"); - - Version::Version v - = Version::getOpenmwVersion(variables["resources"] - .as() - .u8string()); // This call to u8string is redundant, but required to build on - // MSVC 14.26 due to implementation bugs. - Log(Debug::Info) << v.describe(); + Log(Debug::Info) << Version::getOpenmwVersionDescription(); Settings::Manager::load(cfgMgr); diff --git a/apps/openmw/mwlua/luabindings.cpp b/apps/openmw/mwlua/luabindings.cpp index 65b6977982..2bace90614 100644 --- a/apps/openmw/mwlua/luabindings.cpp +++ b/apps/openmw/mwlua/luabindings.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/statemanager.hpp" @@ -128,7 +129,7 @@ namespace MWLua { auto* lua = context.mLua; sol::table api(lua->sol(), sol::create); - api["API_REVISION"] = 44; + api["API_REVISION"] = Version::getLuaApiRevision(); // specified in CMakeLists.txt api["quit"] = [lua]() { Log(Debug::Warning) << "Quit requested by a Lua script.\n" << lua->debugTraceback(); MWBase::Environment::get().getStateManager()->requestQuit(); diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake index ff719d72a7..a4816a53b6 100644 --- a/cmake/GitVersion.cmake +++ b/cmake/GitVersion.cmake @@ -28,4 +28,4 @@ endif () include(${MACROSFILE}) -configure_resource_file(${VERSION_IN_FILE} ${VERSION_FILE_PATH_BASE} ${VERSION_FILE_PATH_RELATIVE}) +configure_file(${VERSION_IN_FILE} ${VERSION_FILE}) diff --git a/cmake/OpenMWMacros.cmake b/cmake/OpenMWMacros.cmake index 0561fcefd7..2762b8ff72 100644 --- a/cmake/OpenMWMacros.cmake +++ b/cmake/OpenMWMacros.cmake @@ -62,6 +62,13 @@ macro (add_component_dir dir) list (APPEND cppfiles "${f}") endforeach (f) + if (u MATCHES ".*[ch]pp") + list (APPEND files "${dir}/${u}") + list (APPEND COMPONENT_FILES "${dir}/${u}") + endif() + if (u MATCHES ".*cpp") + list (APPEND cppfiles "${dir}/${u}") + endif() endforeach (u) if (OPENMW_UNITY_BUILD) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 9a073b5ca1..d519c1cd92 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -6,21 +6,22 @@ if(APPLE) endif(APPLE) # Version file -set (VERSION_IN_FILE "${OpenMW_SOURCE_DIR}/files/version.in") -set (VERSION_FILE_PATH_BASE "${OpenMW_BINARY_DIR}") -set (VERSION_FILE_PATH_RELATIVE resources/version) +set (VERSION_IN_FILE "${OpenMW_SOURCE_DIR}/components/version/version.cpp.in") +set (VERSION_FILE "${OpenMW_SOURCE_DIR}/components/version/version.cpp") if (GIT_CHECKOUT) get_generator_is_multi_config(multi_config) - add_custom_target (git-version + add_custom_command ( + OUTPUT ${VERSION_FILE} + DEPENDS ${VERSION_IN_FILE} COMMAND ${CMAKE_COMMAND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DVERSION_IN_FILE=${VERSION_IN_FILE} - -DVERSION_FILE_PATH_BASE=${VERSION_FILE_PATH_BASE} - -DVERSION_FILE_PATH_RELATIVE=${VERSION_FILE_PATH_RELATIVE} + -DVERSION_FILE=${VERSION_FILE} -DOPENMW_VERSION_MAJOR=${OPENMW_VERSION_MAJOR} -DOPENMW_VERSION_MINOR=${OPENMW_VERSION_MINOR} -DOPENMW_VERSION_RELEASE=${OPENMW_VERSION_RELEASE} + -DOPENMW_LUA_API_REVISION=${OPENMW_LUA_API_REVISION} -DOPENMW_VERSION=${OPENMW_VERSION} -DMACROSFILE=${CMAKE_SOURCE_DIR}/cmake/OpenMWMacros.cmake "-DCMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES}" @@ -28,7 +29,7 @@ if (GIT_CHECKOUT) -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GitVersion.cmake VERBATIM) else (GIT_CHECKOUT) - configure_resource_file(${VERSION_IN_FILE} ${VERSION_FILE_PATH_BASE} ${VERSION_FILE_PATH_RELATIVE}) + configure_file(${VERSION_IN_FILE} ${VERSION_FILE}) endif (GIT_CHECKOUT) # source files @@ -311,6 +312,7 @@ add_component_dir (sdlutil add_component_dir (version version + version.cpp ) add_component_dir (fallback @@ -551,10 +553,6 @@ if (USE_QT) endif() endif() -if (GIT_CHECKOUT) - add_dependencies (components git-version) -endif (GIT_CHECKOUT) - if (OSG_STATIC AND CMAKE_SYSTEM_NAME MATCHES "Linux") find_package(X11 REQUIRED COMPONENTS Xinerama Xrandr) target_link_libraries(components ${CMAKE_DL_LIBS} X11::X11 X11::Xinerama X11::Xrandr) diff --git a/components/version/version.cpp b/components/version/version.cpp deleted file mode 100644 index 85eea712b3..0000000000 --- a/components/version/version.cpp +++ /dev/null @@ -1,38 +0,0 @@ -#include "version.hpp" - -#include -#include - -namespace Version -{ - - Version getOpenmwVersion(const std::filesystem::path& resourcePath) - { - std::ifstream stream(resourcePath / "version"); - - Version v; - std::getline(stream, v.mVersion); - std::getline(stream, v.mCommitHash); - std::getline(stream, v.mTagHash); - return v; - } - - std::string Version::describe() const - { - std::string str = "OpenMW version " + mVersion; - std::string rev = mCommitHash; - if (!rev.empty()) - { - rev = rev.substr(0, 10); - str += "\nRevision: " + rev; - } - return str; - } - - std::string getOpenmwVersionDescription(const std::filesystem::path& resourcePath) - { - Version v = getOpenmwVersion(resourcePath); - return v.describe(); - } - -} diff --git a/components/version/version.cpp.in b/components/version/version.cpp.in new file mode 100644 index 0000000000..f2748b9186 --- /dev/null +++ b/components/version/version.cpp.in @@ -0,0 +1,36 @@ +#include "version.hpp" + +namespace Version +{ + std::string_view getVersion() + { + return "@OPENMW_VERSION@"; + } + + std::string_view getCommitHash() + { + return "@OPENMW_VERSION_COMMITHASH@"; + } + + std::string_view getTagHash() + { + return "@OPENMW_VERSION_TAGHASH@"; + } + + int getLuaApiRevision() + { + return @OPENMW_LUA_API_REVISION@; + } + + std::string getOpenmwVersionDescription() + { + std::string str = "OpenMW version "; + str += getVersion(); + if (!getCommitHash().empty()) + { + str += "\nRevision: "; + str += getCommitHash().substr(0, 10); + } + return str; + } +} diff --git a/components/version/version.hpp b/components/version/version.hpp index f6427a4823..c4a62c9e1e 100644 --- a/components/version/version.hpp +++ b/components/version/version.hpp @@ -1,27 +1,18 @@ #ifndef VERSION_HPP #define VERSION_HPP -#include #include +#include namespace Version { + std::string_view getVersion(); + std::string_view getCommitHash(); + std::string_view getTagHash(); + int getLuaApiRevision(); - struct Version - { - std::string mVersion; - std::string mCommitHash; - std::string mTagHash; - - std::string describe() const; - }; - - /// Read OpenMW version from the version file located in resourcePath. - Version getOpenmwVersion(const std::filesystem::path& resourcePath); - - /// Helper function to getOpenmwVersion and describe() it - std::string getOpenmwVersionDescription(const std::filesystem::path& resourcePath); - + // Prepares string that contains version and commit hash. + std::string getOpenmwVersionDescription(); } #endif // VERSION_HPP diff --git a/docs/source/conf.py b/docs/source/conf.py index 207c3f7c13..096dec6ae0 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -66,6 +66,7 @@ copyright = u'2023, OpenMW Team' # The full version, including alpha/beta/rc tags. release = version = "UNRELEASED" +luaApiRevision = "UNKNOWN" try: cmake_raw = open(project_root+'/CMakeLists.txt', 'r').read() @@ -76,11 +77,18 @@ try: release = version = '.'.join((majorVersionMatch.group(1), minorVersionMatch.group(1), releaseVersionMatch.group(1))) + luaApiRevisionMatch = re.search('set\(OPENMW_LUA_API_REVISION (\d+)\)', cmake_raw) + if luaApiRevisionMatch: + luaApiRevision = luaApiRevisionMatch.group(1) except Exception as ex: print("WARNING: Version will be set to '{0}' because: '{1}'.".format(release, str(ex))) import traceback; traceback.print_exc() +rst_prolog = f""" +.. |luaApiRevision| replace:: {luaApiRevision} +""" + # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = cpp diff --git a/docs/source/reference/lua-scripting/aipackages.rst b/docs/source/reference/lua-scripting/aipackages.rst index 39f973c65d..4ef3149582 100644 --- a/docs/source/reference/lua-scripting/aipackages.rst +++ b/docs/source/reference/lua-scripting/aipackages.rst @@ -1,6 +1,8 @@ Built-in AI packages ==================== +.. include:: version.rst + Starting an AI package ---------------------- diff --git a/docs/source/reference/lua-scripting/api.rst b/docs/source/reference/lua-scripting/api.rst index 76092fec3f..77d4c9b14b 100644 --- a/docs/source/reference/lua-scripting/api.rst +++ b/docs/source/reference/lua-scripting/api.rst @@ -2,6 +2,8 @@ Lua API reference ################# +.. include:: version.rst + .. toctree:: :hidden: diff --git a/docs/source/reference/lua-scripting/engine_handlers.rst b/docs/source/reference/lua-scripting/engine_handlers.rst index 8d5db51f84..1ffa1820f3 100644 --- a/docs/source/reference/lua-scripting/engine_handlers.rst +++ b/docs/source/reference/lua-scripting/engine_handlers.rst @@ -1,6 +1,8 @@ Engine handlers reference ========================= +.. include:: version.rst + Engine handler is a function defined by a script, that can be called by the engine. diff --git a/docs/source/reference/lua-scripting/events.rst b/docs/source/reference/lua-scripting/events.rst index da4b2e3812..513fd8c871 100644 --- a/docs/source/reference/lua-scripting/events.rst +++ b/docs/source/reference/lua-scripting/events.rst @@ -1,6 +1,8 @@ Built-in events =============== +.. include:: version.rst + Actor events ------------ diff --git a/docs/source/reference/lua-scripting/index.rst b/docs/source/reference/lua-scripting/index.rst index c6adfc7723..f3764c4401 100644 --- a/docs/source/reference/lua-scripting/index.rst +++ b/docs/source/reference/lua-scripting/index.rst @@ -2,8 +2,10 @@ OpenMW Lua scripting #################### -.. warning:: - OpenMW Lua scripting is in early stage of development. Also note that OpenMW Lua is not compatible with MWSE. +.. note:: + OpenMW Lua is not compatible with MWSE. + +.. include:: version.rst .. toctree:: :caption: Table of Contents diff --git a/docs/source/reference/lua-scripting/interface_activation.rst b/docs/source/reference/lua-scripting/interface_activation.rst index ccc51ca457..ad31cca3f6 100644 --- a/docs/source/reference/lua-scripting/interface_activation.rst +++ b/docs/source/reference/lua-scripting/interface_activation.rst @@ -1,6 +1,8 @@ Interface Activation ==================== +.. include:: version.rst + .. raw:: html :file: generated_html/scripts_omw_activationhandlers.html diff --git a/docs/source/reference/lua-scripting/interface_ai.rst b/docs/source/reference/lua-scripting/interface_ai.rst index ec79b50d5d..43197721e2 100644 --- a/docs/source/reference/lua-scripting/interface_ai.rst +++ b/docs/source/reference/lua-scripting/interface_ai.rst @@ -1,6 +1,8 @@ Interface AI ============ +.. include:: version.rst + .. raw:: html :file: generated_html/scripts_omw_ai.html diff --git a/docs/source/reference/lua-scripting/interface_camera.rst b/docs/source/reference/lua-scripting/interface_camera.rst index 6a0f19d47b..0a71680ee3 100644 --- a/docs/source/reference/lua-scripting/interface_camera.rst +++ b/docs/source/reference/lua-scripting/interface_camera.rst @@ -1,6 +1,8 @@ Interface Camera ================ +.. include:: version.rst + .. raw:: html :file: generated_html/scripts_omw_camera_camera.html diff --git a/docs/source/reference/lua-scripting/interface_controls.rst b/docs/source/reference/lua-scripting/interface_controls.rst index e458aca133..c4b1709f59 100644 --- a/docs/source/reference/lua-scripting/interface_controls.rst +++ b/docs/source/reference/lua-scripting/interface_controls.rst @@ -1,6 +1,8 @@ Interface Controls ================== +.. include:: version.rst + .. raw:: html :file: generated_html/scripts_omw_playercontrols.html diff --git a/docs/source/reference/lua-scripting/interface_mwui.rst b/docs/source/reference/lua-scripting/interface_mwui.rst index cd9b00cb87..51a86843b4 100644 --- a/docs/source/reference/lua-scripting/interface_mwui.rst +++ b/docs/source/reference/lua-scripting/interface_mwui.rst @@ -1,6 +1,8 @@ Interface MWUI ============== +.. include:: version.rst + .. raw:: html :file: generated_html/scripts_omw_mwui_init.html diff --git a/docs/source/reference/lua-scripting/interface_settings.rst b/docs/source/reference/lua-scripting/interface_settings.rst index cd1994ccfa..1f57f00d2a 100644 --- a/docs/source/reference/lua-scripting/interface_settings.rst +++ b/docs/source/reference/lua-scripting/interface_settings.rst @@ -1,6 +1,8 @@ Interface Settings ================== +.. include:: version.rst + .. raw:: html :file: generated_html/scripts_omw_settings_player.html diff --git a/docs/source/reference/lua-scripting/interface_ui.rst b/docs/source/reference/lua-scripting/interface_ui.rst index 8c3ac679e5..f406924cd5 100644 --- a/docs/source/reference/lua-scripting/interface_ui.rst +++ b/docs/source/reference/lua-scripting/interface_ui.rst @@ -1,6 +1,8 @@ Interface UI ============ +.. include:: version.rst + .. raw:: html :file: generated_html/scripts_omw_ui.html diff --git a/docs/source/reference/lua-scripting/iterables.rst b/docs/source/reference/lua-scripting/iterables.rst index 208b7f1c92..420ff593ef 100644 --- a/docs/source/reference/lua-scripting/iterables.rst +++ b/docs/source/reference/lua-scripting/iterables.rst @@ -1,6 +1,8 @@ Iterable types ============== +.. include:: version.rst + List Iterable ------------- diff --git a/docs/source/reference/lua-scripting/openmw_ambient.rst b/docs/source/reference/lua-scripting/openmw_ambient.rst index a68f5f4469..4a44636bd3 100644 --- a/docs/source/reference/lua-scripting/openmw_ambient.rst +++ b/docs/source/reference/lua-scripting/openmw_ambient.rst @@ -1,5 +1,7 @@ Package openmw.ambient ====================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_ambient.html diff --git a/docs/source/reference/lua-scripting/openmw_async.rst b/docs/source/reference/lua-scripting/openmw_async.rst index 9f24f63a4f..55e44526be 100644 --- a/docs/source/reference/lua-scripting/openmw_async.rst +++ b/docs/source/reference/lua-scripting/openmw_async.rst @@ -1,5 +1,7 @@ Package openmw.async ==================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_async.html diff --git a/docs/source/reference/lua-scripting/openmw_aux_calendar.rst b/docs/source/reference/lua-scripting/openmw_aux_calendar.rst index ea60b62852..728d3e89da 100644 --- a/docs/source/reference/lua-scripting/openmw_aux_calendar.rst +++ b/docs/source/reference/lua-scripting/openmw_aux_calendar.rst @@ -1,5 +1,7 @@ Package openmw_aux.calendar =========================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_aux_calendar.html diff --git a/docs/source/reference/lua-scripting/openmw_aux_time.rst b/docs/source/reference/lua-scripting/openmw_aux_time.rst index 120d888a01..919690c19f 100644 --- a/docs/source/reference/lua-scripting/openmw_aux_time.rst +++ b/docs/source/reference/lua-scripting/openmw_aux_time.rst @@ -1,5 +1,7 @@ Package openmw_aux.time ======================= +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_aux_time.html diff --git a/docs/source/reference/lua-scripting/openmw_aux_ui.rst b/docs/source/reference/lua-scripting/openmw_aux_ui.rst index 18c0926c03..2a45bb529e 100644 --- a/docs/source/reference/lua-scripting/openmw_aux_ui.rst +++ b/docs/source/reference/lua-scripting/openmw_aux_ui.rst @@ -1,5 +1,7 @@ Package openmw_aux.ui ======================= +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_aux_ui.html diff --git a/docs/source/reference/lua-scripting/openmw_aux_util.rst b/docs/source/reference/lua-scripting/openmw_aux_util.rst index 01b200bfc2..662498f693 100644 --- a/docs/source/reference/lua-scripting/openmw_aux_util.rst +++ b/docs/source/reference/lua-scripting/openmw_aux_util.rst @@ -1,5 +1,7 @@ Package openmw_aux.util ======================= +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_aux_util.html diff --git a/docs/source/reference/lua-scripting/openmw_camera.rst b/docs/source/reference/lua-scripting/openmw_camera.rst index 4090843920..3c9a74c037 100644 --- a/docs/source/reference/lua-scripting/openmw_camera.rst +++ b/docs/source/reference/lua-scripting/openmw_camera.rst @@ -1,5 +1,7 @@ Package openmw.camera ===================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_camera.html diff --git a/docs/source/reference/lua-scripting/openmw_core.rst b/docs/source/reference/lua-scripting/openmw_core.rst index bde93fb9c9..2dc3f762b3 100644 --- a/docs/source/reference/lua-scripting/openmw_core.rst +++ b/docs/source/reference/lua-scripting/openmw_core.rst @@ -1,5 +1,7 @@ Package openmw.core =================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_core.html diff --git a/docs/source/reference/lua-scripting/openmw_debug.rst b/docs/source/reference/lua-scripting/openmw_debug.rst index 5be48f6558..c139131853 100644 --- a/docs/source/reference/lua-scripting/openmw_debug.rst +++ b/docs/source/reference/lua-scripting/openmw_debug.rst @@ -1,5 +1,7 @@ Package openmw.debug ==================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_debug.html diff --git a/docs/source/reference/lua-scripting/openmw_input.rst b/docs/source/reference/lua-scripting/openmw_input.rst index 39136dc4c2..9e327d00e1 100644 --- a/docs/source/reference/lua-scripting/openmw_input.rst +++ b/docs/source/reference/lua-scripting/openmw_input.rst @@ -1,6 +1,8 @@ Package openmw.input ==================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_input.html diff --git a/docs/source/reference/lua-scripting/openmw_nearby.rst b/docs/source/reference/lua-scripting/openmw_nearby.rst index ca0a7d5d00..6812fad44e 100644 --- a/docs/source/reference/lua-scripting/openmw_nearby.rst +++ b/docs/source/reference/lua-scripting/openmw_nearby.rst @@ -1,5 +1,7 @@ Package openmw.nearby ===================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_nearby.html diff --git a/docs/source/reference/lua-scripting/openmw_postprocessing.rst b/docs/source/reference/lua-scripting/openmw_postprocessing.rst index ec2f025049..0acf32c38b 100644 --- a/docs/source/reference/lua-scripting/openmw_postprocessing.rst +++ b/docs/source/reference/lua-scripting/openmw_postprocessing.rst @@ -1,5 +1,7 @@ Package openmw.postprocessing ============================= +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_postprocessing.html diff --git a/docs/source/reference/lua-scripting/openmw_self.rst b/docs/source/reference/lua-scripting/openmw_self.rst index 71a2cb04ae..4c0b8dbec3 100644 --- a/docs/source/reference/lua-scripting/openmw_self.rst +++ b/docs/source/reference/lua-scripting/openmw_self.rst @@ -1,5 +1,7 @@ Package openmw.self =================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_self.html diff --git a/docs/source/reference/lua-scripting/openmw_storage.rst b/docs/source/reference/lua-scripting/openmw_storage.rst index 5abf664e1a..785d1b661c 100644 --- a/docs/source/reference/lua-scripting/openmw_storage.rst +++ b/docs/source/reference/lua-scripting/openmw_storage.rst @@ -1,5 +1,7 @@ Package openmw.storage ====================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_storage.html diff --git a/docs/source/reference/lua-scripting/openmw_types.rst b/docs/source/reference/lua-scripting/openmw_types.rst index 1819b1a6ce..3f408909db 100644 --- a/docs/source/reference/lua-scripting/openmw_types.rst +++ b/docs/source/reference/lua-scripting/openmw_types.rst @@ -1,5 +1,7 @@ Package openmw.types ==================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_types.html diff --git a/docs/source/reference/lua-scripting/openmw_ui.rst b/docs/source/reference/lua-scripting/openmw_ui.rst index 1b7b57c359..d523fe57fd 100644 --- a/docs/source/reference/lua-scripting/openmw_ui.rst +++ b/docs/source/reference/lua-scripting/openmw_ui.rst @@ -1,5 +1,7 @@ Package openmw.ui ================= +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_ui.html diff --git a/docs/source/reference/lua-scripting/openmw_util.rst b/docs/source/reference/lua-scripting/openmw_util.rst index f054d7b44d..d7d692a1f7 100644 --- a/docs/source/reference/lua-scripting/openmw_util.rst +++ b/docs/source/reference/lua-scripting/openmw_util.rst @@ -1,5 +1,7 @@ Package openmw.util =================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_util.html diff --git a/docs/source/reference/lua-scripting/openmw_world.rst b/docs/source/reference/lua-scripting/openmw_world.rst index b8818d4027..3ee7f8ac51 100644 --- a/docs/source/reference/lua-scripting/openmw_world.rst +++ b/docs/source/reference/lua-scripting/openmw_world.rst @@ -1,5 +1,7 @@ Package openmw.world ==================== +.. include:: version.rst + .. raw:: html :file: generated_html/openmw_world.html diff --git a/docs/source/reference/lua-scripting/overview.rst b/docs/source/reference/lua-scripting/overview.rst index d0eb0a4cb2..157a9e686d 100644 --- a/docs/source/reference/lua-scripting/overview.rst +++ b/docs/source/reference/lua-scripting/overview.rst @@ -1,6 +1,8 @@ Overview of Lua scripting ######################### +.. include:: version.rst + Language and sandboxing ======================= diff --git a/docs/source/reference/lua-scripting/setting_renderers.rst b/docs/source/reference/lua-scripting/setting_renderers.rst index a0ce9e99f9..966246d503 100644 --- a/docs/source/reference/lua-scripting/setting_renderers.rst +++ b/docs/source/reference/lua-scripting/setting_renderers.rst @@ -1,6 +1,8 @@ Built-in Setting Renderers ========================== +.. include:: version.rst + textLine -------- diff --git a/docs/source/reference/lua-scripting/user_interface.rst b/docs/source/reference/lua-scripting/user_interface.rst index d1d3162a4b..9251538657 100644 --- a/docs/source/reference/lua-scripting/user_interface.rst +++ b/docs/source/reference/lua-scripting/user_interface.rst @@ -1,6 +1,8 @@ User interface reference ======================== +.. include:: version.rst + Layouts ------- diff --git a/docs/source/reference/lua-scripting/version.rst b/docs/source/reference/lua-scripting/version.rst new file mode 100644 index 0000000000..ad96ee456b --- /dev/null +++ b/docs/source/reference/lua-scripting/version.rst @@ -0,0 +1,2 @@ +| `OpenMW version:` |version| +| `core.API_REVISION:` |luaApiRevision| `* `_ diff --git a/files/lua_api/openmw/core.lua b/files/lua_api/openmw/core.lua index f018e4dd21..abe151eb73 100644 --- a/files/lua_api/openmw/core.lua +++ b/files/lua_api/openmw/core.lua @@ -7,7 +7,7 @@ --- --- The revision of OpenMW Lua API. It is an integer that is incremented every time the API is changed. +-- The revision of OpenMW Lua API. It is an integer that is incremented every time the API is changed. See the actual value at the top of the page. -- @field [parent=#core] #number API_REVISION --- diff --git a/files/version.in b/files/version.in deleted file mode 100644 index f894d3b4a5..0000000000 --- a/files/version.in +++ /dev/null @@ -1,3 +0,0 @@ -@OPENMW_VERSION@ -@OPENMW_VERSION_COMMITHASH@ -@OPENMW_VERSION_TAGHASH@