1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-17 03:46:34 +00:00

Merge branch openmw:master into master

This commit is contained in:
Igilq 2025-07-30 16:59:34 +00:00
commit 516280e0b4
50 changed files with 175 additions and 221 deletions

View file

@ -27,14 +27,14 @@ variables:
.Ubuntu_Image: .Ubuntu_Image:
tags: tags:
- saas-linux-medium-amd64 - saas-linux-medium-amd64
image: ubuntu:22.04 image: ubuntu:24.04
rules: rules:
- if: $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event"
Ubuntu_GCC_preprocess: Ubuntu_GCC_preprocess:
extends: .Ubuntu_Image extends: .Ubuntu_Image
cache: cache:
key: Ubuntu_GCC_preprocess.ubuntu_22.04.v1 key: Ubuntu_GCC_preprocess.ubuntu_24.04.v1
paths: paths:
- apt-cache/ - apt-cache/
- .cache/pip/ - .cache/pip/
@ -43,7 +43,7 @@ Ubuntu_GCC_preprocess:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip" PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
before_script: before_script:
- CI/install_debian_deps.sh openmw-deps openmw-deps-dynamic gcc_preprocess - CI/install_debian_deps.sh openmw-deps openmw-deps-dynamic gcc_preprocess
- pip3 install --user click termtables - pip3 install --user --break-system-packages click termtables
script: script:
- CI/ubuntu_gcc_preprocess.sh - CI/ubuntu_gcc_preprocess.sh
rules: rules:
@ -82,7 +82,7 @@ Ubuntu_GCC_preprocess:
- if [[ "${BUILD_TESTS_ONLY}" && ! "${BUILD_WITH_CODE_COVERAGE}" ]]; then ./openmw_settings_access_benchmark; fi - if [[ "${BUILD_TESTS_ONLY}" && ! "${BUILD_WITH_CODE_COVERAGE}" ]]; then ./openmw_settings_access_benchmark; fi
- ccache -svv - ccache -svv
- df -h - df -h
- if [[ "${BUILD_WITH_CODE_COVERAGE}" ]]; then gcovr --xml-pretty --exclude-unreachable-branches --print-summary --root "${CI_PROJECT_DIR}" -j $(nproc) -o ../coverage.xml; fi - if [[ "${BUILD_WITH_CODE_COVERAGE}" ]]; then ~/.local/bin/gcovr --xml-pretty --exclude-unreachable-branches --gcov-ignore-parse-errors=negative_hits.warn_once_per_file --print-summary --root "${CI_PROJECT_DIR}" -j $(nproc) -o ../coverage.xml; fi
- ls | grep -v -e '^extern$' -e '^install$' -e '^components-tests.xml$' -e '^openmw-tests.xml$' -e '^openmw-cs-tests.xml$' | xargs -I '{}' rm -rf './{}' - ls | grep -v -e '^extern$' -e '^install$' -e '^components-tests.xml$' -e '^openmw-tests.xml$' -e '^openmw-cs-tests.xml$' | xargs -I '{}' rm -rf './{}'
- cd .. - cd ..
- df -h - df -h
@ -97,12 +97,12 @@ Ubuntu_GCC_preprocess:
Coverity: Coverity:
tags: tags:
- saas-linux-medium-amd64 - saas-linux-medium-amd64
image: ubuntu:22.04 image: ubuntu:24.04
stage: build stage: build
rules: rules:
- if: $CI_PIPELINE_SOURCE == "schedule" - if: $CI_PIPELINE_SOURCE == "schedule"
cache: cache:
key: Coverity.ubuntu_22.04.v1 key: Coverity.ubuntu_24.04.v1
paths: paths:
- apt-cache/ - apt-cache/
- ccache/ - ccache/
@ -141,7 +141,7 @@ Coverity:
Ubuntu_GCC: Ubuntu_GCC:
extends: .Ubuntu extends: .Ubuntu
cache: cache:
key: Ubuntu_GCC.ubuntu_22.04.v1 key: Ubuntu_GCC.ubuntu_24.04.v1
before_script: before_script:
- CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic - CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic
variables: variables:
@ -154,7 +154,7 @@ Ubuntu_GCC:
Ubuntu_GCC_asan: Ubuntu_GCC_asan:
extends: Ubuntu_GCC extends: Ubuntu_GCC
cache: cache:
key: Ubuntu_GCC_asan.ubuntu_22.04.v1 key: Ubuntu_GCC_asan.ubuntu_24.04.v1
variables: variables:
CMAKE_BUILD_TYPE: Debug CMAKE_BUILD_TYPE: Debug
CMAKE_CXX_FLAGS_DEBUG: -g -O1 -fno-omit-frame-pointer -fsanitize=address -fsanitize=pointer-subtract -fsanitize=leak CMAKE_CXX_FLAGS_DEBUG: -g -O1 -fno-omit-frame-pointer -fsanitize=address -fsanitize=pointer-subtract -fsanitize=leak
@ -167,7 +167,7 @@ Clang_Format:
extends: .Ubuntu_Image extends: .Ubuntu_Image
stage: checks stage: checks
cache: cache:
key: Ubuntu_Clang_Format.ubuntu_22.04.v1 key: Ubuntu_Clang_Format.ubuntu_24.04.v1
paths: paths:
- apt-cache/ - apt-cache/
variables: variables:
@ -183,11 +183,11 @@ Lupdate:
extends: .Ubuntu_Image extends: .Ubuntu_Image
stage: checks stage: checks
cache: cache:
key: Ubuntu_lupdate.ubuntu_22.04.v1 key: Ubuntu_lupdate.ubuntu_24.04.v1
paths: paths:
- apt-cache/ - apt-cache/
variables: variables:
LUPDATE: lupdate LUPDATE: /usr/lib/qt6/bin/lupdate
before_script: before_script:
- CI/install_debian_deps.sh openmw-qt-translations - CI/install_debian_deps.sh openmw-qt-translations
script: script:
@ -209,7 +209,7 @@ Teal:
Ubuntu_GCC_Debug: Ubuntu_GCC_Debug:
extends: .Ubuntu extends: .Ubuntu
cache: cache:
key: Ubuntu_GCC_Debug.ubuntu_22.04.v2 key: Ubuntu_GCC_Debug.ubuntu_24.04.v2
before_script: before_script:
- CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic - CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic
variables: variables:
@ -225,7 +225,7 @@ Ubuntu_GCC_Debug:
Ubuntu_GCC_tests: Ubuntu_GCC_tests:
extends: Ubuntu_GCC extends: Ubuntu_GCC
cache: cache:
key: Ubuntu_GCC_tests.ubuntu_22.04.v1 key: Ubuntu_GCC_tests.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -239,7 +239,7 @@ Ubuntu_GCC_tests:
.Ubuntu_GCC_tests_Debug: .Ubuntu_GCC_tests_Debug:
extends: Ubuntu_GCC extends: Ubuntu_GCC
cache: cache:
key: Ubuntu_GCC_tests_Debug.ubuntu_22.04.v1 key: Ubuntu_GCC_tests_Debug.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -255,7 +255,7 @@ Ubuntu_GCC_tests:
Ubuntu_GCC_tests_asan: Ubuntu_GCC_tests_asan:
extends: Ubuntu_GCC extends: Ubuntu_GCC
cache: cache:
key: Ubuntu_GCC_tests_asan.ubuntu_22.04.v1 key: Ubuntu_GCC_tests_asan.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -278,7 +278,7 @@ Ubuntu_GCC_tests_asan:
Ubuntu_GCC_tests_ubsan: Ubuntu_GCC_tests_ubsan:
extends: Ubuntu_GCC extends: Ubuntu_GCC
cache: cache:
key: Ubuntu_GCC_tests_ubsan.ubuntu_22.04.v1 key: Ubuntu_GCC_tests_ubsan.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -298,7 +298,7 @@ Ubuntu_GCC_tests_ubsan:
.Ubuntu_GCC_tests_tsan: .Ubuntu_GCC_tests_tsan:
extends: Ubuntu_GCC extends: Ubuntu_GCC
cache: cache:
key: Ubuntu_GCC_tests_tsan.ubuntu_22.04.v1 key: Ubuntu_GCC_tests_tsan.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -316,11 +316,15 @@ Ubuntu_GCC_tests_ubsan:
Ubuntu_GCC_tests_coverage: Ubuntu_GCC_tests_coverage:
extends: .Ubuntu_GCC_tests_Debug extends: .Ubuntu_GCC_tests_Debug
cache: cache:
key: Ubuntu_GCC_tests_coverage.ubuntu_22.04.v1 key: Ubuntu_GCC_tests_coverage.ubuntu_24.04.v1
paths:
- .cache/pip
variables: variables:
BUILD_WITH_CODE_COVERAGE: 1 BUILD_WITH_CODE_COVERAGE: 1
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
before_script: before_script:
- CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic openmw-coverage - CI/install_debian_deps.sh gcc openmw-deps openmw-deps-dynamic openmw-coverage
- pipx install gcovr
coverage: /^\s*lines:\s*\d+.\d+\%/ coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts: artifacts:
paths: [] paths: []
@ -345,7 +349,7 @@ Ubuntu_GCC_tests_coverage:
- "CI/**/*" - "CI/**/*"
- ".gitlab-ci.yml" - ".gitlab-ci.yml"
cache: cache:
key: Ubuntu_Static_Deps.ubuntu_22.04.v1 key: Ubuntu_Static_Deps.ubuntu_24.04.v1
paths: paths:
- apt-cache/ - apt-cache/
- ccache/ - ccache/
@ -362,7 +366,7 @@ Ubuntu_GCC_tests_coverage:
.Ubuntu_Static_Deps_tests: .Ubuntu_Static_Deps_tests:
extends: .Ubuntu_Static_Deps extends: .Ubuntu_Static_Deps
cache: cache:
key: Ubuntu_Static_Deps_tests.ubuntu_22.04.v1 key: Ubuntu_Static_Deps_tests.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -381,7 +385,7 @@ Ubuntu_Clang:
before_script: before_script:
- CI/install_debian_deps.sh clang openmw-deps openmw-deps-dynamic - CI/install_debian_deps.sh clang openmw-deps openmw-deps-dynamic
cache: cache:
key: Ubuntu_Clang.ubuntu_22.04.v2 key: Ubuntu_Clang.ubuntu_24.04.v2
variables: variables:
CC: clang CC: clang
CXX: clang++ CXX: clang++
@ -394,7 +398,7 @@ Ubuntu_Clang:
before_script: before_script:
- CI/install_debian_deps.sh clang clang-tidy openmw-deps openmw-deps-dynamic - CI/install_debian_deps.sh clang clang-tidy openmw-deps openmw-deps-dynamic
cache: cache:
key: Ubuntu_Clang_Tidy.ubuntu_22.04.v1 key: Ubuntu_Clang_Tidy.ubuntu_24.04.v1
variables: variables:
CMAKE_BUILD_TYPE: Debug CMAKE_BUILD_TYPE: Debug
CMAKE_CXX_FLAGS_DEBUG: -O0 CMAKE_CXX_FLAGS_DEBUG: -O0
@ -451,7 +455,7 @@ Ubuntu_Clang_Tidy_other:
.Ubuntu_Clang_tests: .Ubuntu_Clang_tests:
extends: Ubuntu_Clang extends: Ubuntu_Clang
cache: cache:
key: Ubuntu_Clang_tests.ubuntu_22.04.v1 key: Ubuntu_Clang_tests.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -465,7 +469,7 @@ Ubuntu_Clang_Tidy_other:
Ubuntu_Clang_tests_Debug: Ubuntu_Clang_tests_Debug:
extends: Ubuntu_Clang extends: Ubuntu_Clang
cache: cache:
key: Ubuntu_Clang_tests_Debug.ubuntu_22.04.v1 key: Ubuntu_Clang_tests_Debug.ubuntu_24.04.v1
variables: variables:
CCACHE_SIZE: 1G CCACHE_SIZE: 1G
BUILD_TESTS_ONLY: 1 BUILD_TESTS_ONLY: 1
@ -489,7 +493,7 @@ Ubuntu_Clang_tests_Debug:
- apt-cache/ - apt-cache/
before_script: before_script:
- CI/install_debian_deps.sh $OPENMW_DEPS - CI/install_debian_deps.sh $OPENMW_DEPS
- pip3 install --user numpy matplotlib termtables click - pip3 install --user --break-system-packages numpy matplotlib termtables click
script: script:
- CI/run_integration_tests.sh - CI/run_integration_tests.sh
after_script: after_script:
@ -500,7 +504,7 @@ Ubuntu_Clang_integration_tests:
needs: needs:
- Ubuntu_Clang - Ubuntu_Clang
cache: cache:
key: Ubuntu_Clang_integration_tests.ubuntu_22.04.v2 key: Ubuntu_Clang_integration_tests.ubuntu_24.04.v2
variables: variables:
OPENMW_DEPS: openmw-integration-tests OPENMW_DEPS: openmw-integration-tests
@ -509,9 +513,9 @@ Ubuntu_GCC_integration_tests_asan:
needs: needs:
- Ubuntu_GCC_asan - Ubuntu_GCC_asan
cache: cache:
key: Ubuntu_GCC_integration_tests_asan.ubuntu_22.04.v1 key: Ubuntu_GCC_integration_tests_asan.ubuntu_24.04.v1
variables: variables:
OPENMW_DEPS: openmw-integration-tests libasan6 OPENMW_DEPS: openmw-integration-tests libasan
ASAN_OPTIONS: halt_on_error=1:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=0 ASAN_OPTIONS: halt_on_error=1:strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:detect_leaks=0
.MacOS: .MacOS:
@ -990,7 +994,7 @@ Windows_MSBuild_CacheInit:
paths: paths:
- .cache/pip - .cache/pip
before_script: before_script:
- pip3 install --user requests click discord_webhook - pip3 install --user --break-system-packages requests click discord_webhook
script: script:
- scripts/find_missing_merge_requests.py --project_id=$CI_PROJECT_ID --ignored_mrs_path=$CI_PROJECT_DIR/.resubmitted_merge_requests.txt - scripts/find_missing_merge_requests.py --project_id=$CI_PROJECT_ID --ignored_mrs_path=$CI_PROJECT_DIR/.resubmitted_merge_requests.txt

View file

@ -2,6 +2,8 @@
------ ------
Bug #2967: Inventory windows don't update when changing items by script Bug #2967: Inventory windows don't update when changing items by script
Bug #4437: Transformations for NiSkinInstance are ignored
Bug #4885: Disable in dialogue result script causes a crash
Bug #5331: Pathfinding works incorrectly when actor is moved from one interior cell to another Bug #5331: Pathfinding works incorrectly when actor is moved from one interior cell to another
Bug #6039: Next Spell keybind fails while selected enchanted item has multiple copies Bug #6039: Next Spell keybind fails while selected enchanted item has multiple copies
Bug #6573: Editor: Selection behaves incorrectly on high-DPI displays Bug #6573: Editor: Selection behaves incorrectly on high-DPI displays
@ -9,9 +11,11 @@
Bug #7371: Equipping item from inventory does not play a Down sound when equipping fails Bug #7371: Equipping item from inventory does not play a Down sound when equipping fails
Bug #7622: Player's marksman weapons don't work on close actors underwater Bug #7622: Player's marksman weapons don't work on close actors underwater
Bug #7649: The sound and vfx of resisted enchanted items' magic still play Bug #7649: The sound and vfx of resisted enchanted items' magic still play
Bug #7693: I.ItemUsage should return an item to the selected stack if equipping/consumption is denied
Bug #7740: Magic items in the HUD aren't composited correctly Bug #7740: Magic items in the HUD aren't composited correctly
Bug #7799: Picking up ingredients while object paging active grid is on may cause a hiccup Bug #7799: Picking up ingredients while object paging active grid is on may cause a hiccup
Bug #7871: Kwama Queen doesn't start combat with player Bug #7871: Kwama Queen doesn't start combat with player
Bug #7979: Paralyzed NPCs battlecry
Bug #8245: The console command ShowVars does not list global mwscripts Bug #8245: The console command ShowVars does not list global mwscripts
Bug #8265: Topics are linked incorrectly Bug #8265: Topics are linked incorrectly
Bug #8303: On target spells cast by non-actors should fire underwater Bug #8303: On target spells cast by non-actors should fire underwater
@ -25,30 +29,40 @@
Bug #8375: Moon phase cycle doesn't match Morrowind Bug #8375: Moon phase cycle doesn't match Morrowind
Bug #8383: Casting bound helm or boots on beast races doesn't cleanup properly Bug #8383: Casting bound helm or boots on beast races doesn't cleanup properly
Bug #8385: Russian encoding broken with locale parameters and calendar Bug #8385: Russian encoding broken with locale parameters and calendar
Bug #8404: Prevent merchant equipping breaks on lights
Bug #8408: OpenMW doesn't report all the potential resting hindrances Bug #8408: OpenMW doesn't report all the potential resting hindrances
Bug #8414: Waterwalking works when collision is disabled Bug #8414: Waterwalking works when collision is disabled
Bug #8431: Behaviour of removed items from a container is buggy Bug #8431: Behaviour of removed items from a container is buggy
Bug #8432: Changing to and from an interior cell doesn't update collision Bug #8432: Changing to and from an interior cell doesn't update collision
Bug #8433: Wandering NPCs are not capable of avoiding easy obstacles
Bug #8436: Spell selection in a pinned spellbook window doesn't update Bug #8436: Spell selection in a pinned spellbook window doesn't update
Bug #8437: Pinned inventory window's pin button doesn't look pressed Bug #8437: Pinned inventory window's pin button doesn't look pressed
Bug #8446: Travel prices are strangely inconsistent Bug #8446: Travel prices are strangely inconsistent
Bug #8447: Werewolf swimming animation breaks in third person perspective
Bug #8459: Changing magic effect base cost doesn't change spell price Bug #8459: Changing magic effect base cost doesn't change spell price
Bug #8466: Showmap "" reveals nameless cells Bug #8466: Showmap "" reveals nameless cells
Bug #8485: Witchwither disease and probably other common diseases don't work correctly Bug #8485: Witchwither disease and probably other common diseases don't work correctly
Bug #8490: Normals on Water disappear when Water Shader is Enabled but Refraction is Disabled Bug #8490: Normals on Water disappear when Water Shader is Enabled but Refraction is Disabled
Bug #8500: OpenMW Alarm behaviour doesn't match morrowind.exe Bug #8500: OpenMW Alarm behaviour doesn't match morrowind.exe
Bug #8519: Multiple bounty is sometimes assigned to player when detected during a pickpocketing action Bug #8519: Multiple bounty is sometimes assigned to player when detected during a pickpocketing action
Bug #8540: Magic resistance is applied to effects without a magnitude
Bug #8557: Charm's disposition changes capped on 100, uncapped below 0
Bug #8582: addScript-attached local scripts start out inactive
Bug #8585: Dialogue topic list doesn't have enough padding Bug #8585: Dialogue topic list doesn't have enough padding
Bug #8587: Minor INI importer problems Bug #8587: Minor INI importer problems
Bug #8593: Render targets do not generate mipmaps Bug #8593: Render targets do not generate mipmaps
Bug #8598: Post processing shaders don't interact with the vfs correctly Bug #8598: Post processing shaders don't interact with the vfs correctly
Bug #8599: Non-ASCII paths in BSA files don't work Bug #8599: Non-ASCII paths in BSA files don't work
Bug #8606: Floating point imprecision can mess with container capacity
Bug #8609: The crosshair is too large Bug #8609: The crosshair is too large
Bug #8610: Terrain normal maps using NormalGL format instead of NormalDX Bug #8610: Terrain normal maps using NormalGL format instead of NormalDX
Bug #8612: Using aiactivate on an ingredient when graphical herbalism is enabled triggers non-stop pickup sounds Bug #8612: Using aiactivate on an ingredient when graphical herbalism is enabled triggers non-stop pickup sounds
Bug #8614: Lua garbage collection fails to remove unused data
Bug #8615: Rest/wait time progress speed is different from vanilla Bug #8615: Rest/wait time progress speed is different from vanilla
Feature #2522: Support quick item transfer Feature #2522: Support quick item transfer
Feature #3769: Allow GetSpellEffects on enchantments Feature #3769: Allow GetSpellEffects on enchantments
Feature #6976: [Lua] Weather API
Feature #8077: Save settings changes when clicking "ok"/closing the window
Feature #8112: Expose landscape record data to Lua Feature #8112: Expose landscape record data to Lua
Feature #8113: Support extended selection in autodetected subdirectory dialog Feature #8113: Support extended selection in autodetected subdirectory dialog
Feature #8139: Editor: Redesign the selection markers Feature #8139: Editor: Redesign the selection markers
@ -57,8 +71,10 @@
Feature #8320: Add access mwscript source text to lua api Feature #8320: Add access mwscript source text to lua api
Feature #8334: Lua: AddTopic equivalent Feature #8334: Lua: AddTopic equivalent
Feature #8355: Lua: Window visibility checking in interfaces.UI Feature #8355: Lua: Window visibility checking in interfaces.UI
Feature #8509: FillJournal script instruction
Feature #8580: Sort characters in the save loading menu Feature #8580: Sort characters in the save loading menu
Feature #8597: Lua: Add more built-in event handlers Feature #8597: Lua: Add more built-in event handlers
Feature #8629: Expose path grid data to Lua
0.49.0 0.49.0
------ ------

View file

@ -708,17 +708,12 @@ printf "Qt ${QT_VER}... "
DLLSUFFIX="" DLLSUFFIX=""
fi fi
if [ "${QT_MAJOR_VER}" -eq 6 ]; then add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_MAJOR_VER}"{Core,Gui,Network,OpenGL,OpenGLWidgets,Widgets,Svg}${DLLSUFFIX}.dll
add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_MAJOR_VER}"{Core,Gui,Network,OpenGL,OpenGLWidgets,Widgets,Svg}${DLLSUFFIX}.dll
# Since Qt 6.7.0 plugin is called "qmodernwindowsstyle" # Since Qt 6.7.0 plugin is called "qmodernwindowsstyle"
if [ "${QT_MINOR_VER}" -ge 7 ]; then if [ "${QT_MINOR_VER}" -ge 7 ]; then
add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qmodernwindowsstyle${DLLSUFFIX}.dll" add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qmodernwindowsstyle${DLLSUFFIX}.dll"
else
add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qwindowsvistastyle${DLLSUFFIX}.dll"
fi
else else
add_runtime_dlls $CONFIGURATION "$(pwd)/bin/Qt${QT_MAJOR_VER}"{Core,Gui,Network,OpenGL,Widgets,Svg}${DLLSUFFIX}.dll
add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qwindowsvistastyle${DLLSUFFIX}.dll" add_qt_style_dlls $CONFIGURATION "$(pwd)/plugins/styles/qwindowsvistastyle${DLLSUFFIX}.dll"
fi fi

View file

@ -33,10 +33,10 @@ declare -rA GROUPED_DEPS=(
libboost-system-dev libboost-iostreams-dev libboost-system-dev libboost-iostreams-dev
libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev
libsdl2-dev libqt5opengl5-dev qttools5-dev qttools5-dev-tools libopenal-dev libsdl2-dev libqt6opengl6-dev qt6-tools-dev qt6-tools-dev-tools libopenal-dev
libunshield-dev libtinyxml-dev libbullet-dev liblz4-dev libpng-dev libjpeg-dev libunshield-dev libtinyxml-dev libbullet-dev liblz4-dev libpng-dev libjpeg-dev
libluajit-5.1-dev librecast-dev libsqlite3-dev ca-certificates libicu-dev libluajit-5.1-dev librecast-dev libsqlite3-dev ca-certificates libicu-dev
libyaml-cpp-dev libqt5svg5 libqt5svg5-dev libyaml-cpp-dev libqt6svg6 libqt6svg6-dev
" "
# These dependencies can alternatively be built and linked statically. # These dependencies can alternatively be built and linked statically.
@ -57,22 +57,22 @@ declare -rA GROUPED_DEPS=(
libsdl2-dev libboost-system-dev libboost-filesystem-dev libgl-dev libsdl2-dev libboost-system-dev libboost-filesystem-dev libgl-dev
" "
[openmw-coverage]="gcovr" [openmw-coverage]="pipx"
[openmw-integration-tests]=" [openmw-integration-tests]="
ca-certificates ca-certificates
gdb gdb
git git
git-lfs git-lfs
libavcodec58 libavcodec60
libavformat58 libavformat60
libavutil56 libavutil58
libboost-iostreams1.74.0 libboost-iostreams1.83.0
libboost-program-options1.74.0 libboost-program-options1.83.0
libboost-system1.74.0 libboost-system1.83.0
libbullet3.24 libbullet3.24
libcollada-dom2.5-dp0 libcollada-dom2.5-dp0
libicu70 libicu74
libjpeg8 libjpeg8
libluajit-5.1-2 libluajit-5.1-2
liblz4-1 liblz4-1
@ -80,19 +80,19 @@ declare -rA GROUPED_DEPS=(
libopenal1 libopenal1
libopenscenegraph161 libopenscenegraph161
libpng16-16 libpng16-16
libqt5opengl5 libqt6opengl6
librecast1 librecast1
libsdl2-2.0-0 libsdl2-2.0-0
libsqlite3-0 libsqlite3-0
libswresample3 libswresample4
libswscale5 libswscale7
libtinyxml2.6.2v5 libtinyxml2.6.2v5
libyaml-cpp0.8 libyaml-cpp0.8
python3-pip python3-pip
xvfb xvfb
" "
[libasan6]="libasan6" [libasan]="libasan8"
[android]="binutils build-essential cmake ccache curl unzip git pkg-config" [android]="binutils build-essential cmake ccache curl unzip git pkg-config"
@ -102,8 +102,8 @@ declare -rA GROUPED_DEPS=(
" "
[openmw-qt-translations]=" [openmw-qt-translations]="
qttools5-dev qt6-tools-dev
qttools5-dev-tools qt6-tools-dev-tools
git-core git-core
" "
) )

View file

@ -82,7 +82,7 @@ message(STATUS "Configuring OpenMW...")
set(OPENMW_VERSION_MAJOR 0) set(OPENMW_VERSION_MAJOR 0)
set(OPENMW_VERSION_MINOR 50) set(OPENMW_VERSION_MINOR 50)
set(OPENMW_VERSION_RELEASE 0) set(OPENMW_VERSION_RELEASE 0)
set(OPENMW_LUA_API_REVISION 83) set(OPENMW_LUA_API_REVISION 84)
set(OPENMW_POSTPROCESSING_API_REVISION 3) set(OPENMW_POSTPROCESSING_API_REVISION 3)
set(OPENMW_VERSION_COMMITHASH "") set(OPENMW_VERSION_COMMITHASH "")
@ -249,12 +249,8 @@ endif()
find_package(LZ4 REQUIRED) find_package(LZ4 REQUIRED)
if (USE_QT) if (USE_QT)
find_package(QT REQUIRED COMPONENTS Core NAMES Qt6 Qt5) find_package(QT REQUIRED COMPONENTS Core NAMES Qt6)
if (QT_VERSION_MAJOR VERSION_EQUAL 5) find_package(Qt6 COMPONENTS Core Widgets Network OpenGL OpenGLWidgets LinguistTools Svg REQUIRED)
find_package(Qt5 5.15 COMPONENTS Core Widgets Network OpenGL LinguistTools Svg REQUIRED)
else()
find_package(Qt6 COMPONENTS Core Widgets Network OpenGL OpenGLWidgets LinguistTools Svg REQUIRED)
endif()
message(STATUS "Using Qt${QT_VERSION}") message(STATUS "Using Qt${QT_VERSION}")
endif() endif()

View file

@ -985,7 +985,7 @@ namespace
0, 0, 0, 0, 0, // row 0 0, 0, 0, 0, 0, // row 0
0, 0, 0, 0, 0, // row 1 0, 0, 0, 0, 0, // row 1
0, 0, 1000, 0, 0, // row 2 0, 0, 1000, 0, 0, // row 2
0, 0, 0, 0, 0, // row 3 0, 0, 1000, 0, 0, // row 3
0, 0, 0, 0, 0, // row 4 0, 0, 0, 0, 0, // row 4
} }; } };
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData); const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
@ -1017,7 +1017,7 @@ namespace
0, 0, 0, 0, 0, // row 0 0, 0, 0, 0, 0, // row 0
0, 0, 0, 0, 0, // row 1 0, 0, 0, 0, 0, // row 1
0, 0, -1000, 0, 0, // row 2 0, 0, -1000, 0, 0, // row 2
0, 0, 0, 0, 0, // row 3 0, 0, -1000, 0, 0, // row 3
0, 0, 0, 0, 0, // row 4 0, 0, 0, 0, 0, // row 4
} }; } };
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData); const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
@ -1049,7 +1049,7 @@ namespace
0, 0, 0, 0, 0, // row 0 0, 0, 0, 0, 0, // row 0
0, 0, 0, 0, 0, // row 1 0, 0, 0, 0, 0, // row 1
0, 0, 1000, 0, 0, // row 2 0, 0, 1000, 0, 0, // row 2
0, 0, 0, 0, 0, // row 3 0, 0, 1000, 0, 0, // row 3
0, 0, 0, 0, 0, // row 4 0, 0, 0, 0, 0, // row 4
} }; } };
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData); const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);
@ -1086,7 +1086,7 @@ namespace
0, 0, 0, 0, 0, // row 0 0, 0, 0, 0, 0, // row 0
0, 0, 0, 0, 0, // row 1 0, 0, 0, 0, 0, // row 1
0, 0, 1000, 0, 0, // row 2 0, 0, 1000, 0, 0, // row 2
0, 0, 0, 0, 0, // row 3 0, 0, 1000, 0, 0, // row 3
0, 0, 0, 0, 0, // row 4 0, 0, 0, 0, 0, // row 4
} }; } };
const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData); const HeightfieldSurface surface = makeSquareHeightfieldSurface(heightfieldData);

View file

@ -88,11 +88,7 @@ void Launcher::ImportPage::on_importerButton_clicked()
// Create the file if it doesn't already exist, else the importer will fail // Create the file if it doesn't already exist, else the importer will fail
auto path = mCfgMgr.getUserConfigPath(); auto path = mCfgMgr.getUserConfigPath();
path /= "openmw.cfg"; path /= "openmw.cfg";
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QFile file(path); QFile file(path);
#else
QFile file(Files::pathToQString(path));
#endif
if (!file.exists()) if (!file.exists())
{ {

View file

@ -497,11 +497,7 @@ bool Launcher::MainDialog::writeSettings()
} }
// Game settings // Game settings
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QFile file(userPath / Files::openmwCfgFile); QFile file(userPath / Files::openmwCfgFile);
#else
QFile file(Files::getUserConfigPathQString(mCfgMgr));
#endif
if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) if (!file.open(QIODevice::ReadWrite | QIODevice::Text))
{ {

View file

@ -240,11 +240,7 @@ target_link_libraries(openmw-cs-lib
components_qt components_qt
) )
if (QT_VERSION_MAJOR VERSION_EQUAL 6) target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::Svg)
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::Svg)
else()
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::Svg)
endif()
if (WIN32) if (WIN32)
target_sources(openmw-cs PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/openmw-cs.exe.manifest) target_sources(openmw-cs PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/openmw-cs.exe.manifest)

View file

@ -34,11 +34,11 @@ bool CSMFilter::TextNode::test(const CSMWorld::IdTableBase& table, int row, cons
QString string; QString string;
if (data.type() == QVariant::String) if (data.typeId() == QMetaType::QString)
{ {
string = data.toString(); string = data.toString();
} }
else if ((data.type() == QVariant::Int || data.type() == QVariant::UInt) else if ((data.typeId() == QMetaType::Int || data.typeId() == QMetaType::UInt)
&& CSMWorld::Columns::hasEnums(static_cast<CSMWorld::Columns::ColumnId>(mColumnId))) && CSMWorld::Columns::hasEnums(static_cast<CSMWorld::Columns::ColumnId>(mColumnId)))
{ {
int value = data.toInt(); int value = data.toInt();
@ -49,7 +49,7 @@ bool CSMFilter::TextNode::test(const CSMWorld::IdTableBase& table, int row, cons
if (value >= 0 && value < static_cast<int>(enums.size())) if (value >= 0 && value < static_cast<int>(enums.size()))
string = QString::fromUtf8(enums[value].second.c_str()); string = QString::fromUtf8(enums[value].second.c_str());
} }
else if (data.type() == QVariant::Bool) else if (data.typeId() == QMetaType::Bool)
{ {
string = data.toBool() ? "true" : "false"; string = data.toBool() ? "true" : "false";
} }

View file

@ -29,8 +29,8 @@ bool CSMFilter::ValueNode::test(const CSMWorld::IdTableBase& table, int row, con
QVariant data = table.data(index); QVariant data = table.data(index);
if (data.type() != QVariant::Double && data.type() != QVariant::Bool && data.type() != QVariant::Int if (data.typeId() != QMetaType::Double && data.typeId() != QMetaType::Bool && data.typeId() != QMetaType::Int
&& data.type() != QVariant::UInt && data.type() != static_cast<QVariant::Type>(QMetaType::Float)) && data.typeId() != QMetaType::UInt && data.typeId() != QMetaType::Float)
return false; return false;
double value = data.toDouble(); double value = data.toDouble();

View file

@ -62,39 +62,31 @@ namespace CSMPrefs
{ {
QWidget* widget = static_cast<QWidget*>(watched); QWidget* widget = static_cast<QWidget*>(watched);
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
unsigned int mod = (unsigned int)keyEvent->modifiers();
unsigned int key = (unsigned int)keyEvent->key();
if (!keyEvent->isAutoRepeat()) if (!keyEvent->isAutoRepeat())
return activate(widget, mod, key); return activate(widget, keyEvent->keyCombination());
} }
else if (event->type() == QEvent::KeyRelease) else if (event->type() == QEvent::KeyRelease)
{ {
QWidget* widget = static_cast<QWidget*>(watched); QWidget* widget = static_cast<QWidget*>(watched);
QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent* keyEvent = static_cast<QKeyEvent*>(event);
unsigned int mod = (unsigned int)keyEvent->modifiers();
unsigned int key = (unsigned int)keyEvent->key();
if (!keyEvent->isAutoRepeat()) if (!keyEvent->isAutoRepeat())
return deactivate(widget, mod, key); return deactivate(widget, keyEvent->keyCombination());
} }
else if (event->type() == QEvent::MouseButtonPress) else if (event->type() == QEvent::MouseButtonPress)
{ {
QWidget* widget = static_cast<QWidget*>(watched); QWidget* widget = static_cast<QWidget*>(watched);
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event); QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
unsigned int mod = (unsigned int)mouseEvent->modifiers();
unsigned int button = (unsigned int)mouseEvent->button();
return activate(widget, mod, button); return activate(widget, QKeyCombination(mouseEvent->modifiers(), Qt::Key(mouseEvent->button())));
} }
else if (event->type() == QEvent::MouseButtonRelease) else if (event->type() == QEvent::MouseButtonRelease)
{ {
QWidget* widget = static_cast<QWidget*>(watched); QWidget* widget = static_cast<QWidget*>(watched);
QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event); QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(event);
unsigned int mod = (unsigned int)mouseEvent->modifiers();
unsigned int button = (unsigned int)mouseEvent->button();
return deactivate(widget, mod, button); return deactivate(widget, QKeyCombination(mouseEvent->modifiers(), Qt::Key(mouseEvent->button())));
} }
else if (event->type() == QEvent::FocusOut) else if (event->type() == QEvent::FocusOut)
{ {
@ -149,7 +141,7 @@ namespace CSMPrefs
} }
} }
bool ShortcutEventHandler::activate(QWidget* widget, unsigned int mod, unsigned int button) bool ShortcutEventHandler::activate(QWidget* widget, QKeyCombination keyCombination)
{ {
std::vector<std::pair<MatchResult, Shortcut*>> potentials; std::vector<std::pair<MatchResult, Shortcut*>> potentials;
bool used = false; bool used = false;
@ -167,7 +159,7 @@ namespace CSMPrefs
if (!shortcut->isEnabled()) if (!shortcut->isEnabled())
continue; continue;
if (checkModifier(mod, button, shortcut, true)) if (checkModifier(keyCombination, shortcut, true))
used = true; used = true;
if (shortcut->getActivationStatus() != Shortcut::AS_Inactive) if (shortcut->getActivationStatus() != Shortcut::AS_Inactive)
@ -175,7 +167,8 @@ namespace CSMPrefs
int pos = shortcut->getPosition(); int pos = shortcut->getPosition();
int lastPos = shortcut->getLastPosition(); int lastPos = shortcut->getLastPosition();
MatchResult result = match(mod, button, shortcut->getSequence()[pos]); MatchResult result = match(keyCombination.keyboardModifiers(), keyCombination.key(),
shortcut->getSequence()[pos].toCombined());
if (result == Matches_WithMod || result == Matches_NoMod) if (result == Matches_WithMod || result == Matches_NoMod)
{ {
@ -220,10 +213,8 @@ namespace CSMPrefs
return used; return used;
} }
bool ShortcutEventHandler::deactivate(QWidget* widget, unsigned int mod, unsigned int button) bool ShortcutEventHandler::deactivate(QWidget* widget, QKeyCombination keyCombination)
{ {
const int KeyMask = 0x01FFFFFF;
bool used = false; bool used = false;
while (widget) while (widget)
@ -235,11 +226,11 @@ namespace CSMPrefs
{ {
Shortcut* shortcut = *it; Shortcut* shortcut = *it;
if (checkModifier(mod, button, shortcut, false)) if (checkModifier(keyCombination, shortcut, false))
used = true; used = true;
int pos = shortcut->getPosition(); int pos = shortcut->getPosition();
MatchResult result = match(0, button, shortcut->getSequence()[pos] & KeyMask); MatchResult result = match(0, keyCombination.key(), shortcut->getSequence()[pos].key());
if (result != Matches_Not) if (result != Matches_Not)
{ {
@ -268,13 +259,13 @@ namespace CSMPrefs
return used; return used;
} }
bool ShortcutEventHandler::checkModifier(unsigned int mod, unsigned int button, Shortcut* shortcut, bool activate) bool ShortcutEventHandler::checkModifier(QKeyCombination keyCombination, Shortcut* shortcut, bool activate)
{ {
if (!shortcut->isEnabled() || !shortcut->getModifier() || shortcut->getSecondaryMode() == Shortcut::SM_Ignore if (!shortcut->isEnabled() || !shortcut->getModifier() || shortcut->getSecondaryMode() == Shortcut::SM_Ignore
|| shortcut->getModifierStatus() == activate) || shortcut->getModifierStatus() == activate)
return false; return false;
MatchResult result = match(mod, button, shortcut->getModifier()); MatchResult result = match(keyCombination.keyboardModifiers(), keyCombination.key(), shortcut->getModifier());
bool used = false; bool used = false;
if (result != Matches_Not) if (result != Matches_Not)

View file

@ -42,11 +42,11 @@ namespace CSMPrefs
void updateParent(QWidget* widget); void updateParent(QWidget* widget);
bool activate(QWidget* widget, unsigned int mod, unsigned int button); bool activate(QWidget* widget, QKeyCombination keyCombination);
bool deactivate(QWidget* widget, unsigned int mod, unsigned int button); bool deactivate(QWidget* widget, QKeyCombination keyCombination);
bool checkModifier(unsigned int mod, unsigned int button, Shortcut* shortcut, bool activate); bool checkModifier(QKeyCombination keyCombination, Shortcut* shortcut, bool activate);
MatchResult match(unsigned int mod, unsigned int button, unsigned int value); MatchResult match(unsigned int mod, unsigned int button, unsigned int value);

View file

@ -115,15 +115,12 @@ namespace CSMPrefs
std::string ShortcutManager::convertToString(const QKeySequence& sequence) const std::string ShortcutManager::convertToString(const QKeySequence& sequence) const
{ {
const int MouseKeyMask = 0x01FFFFFF;
const int ModMask = 0x7E000000;
std::string result; std::string result;
for (int i = 0; i < (int)sequence.count(); ++i) for (int i = 0; i < sequence.count(); ++i)
{ {
int mods = sequence[i] & ModMask; int mods = sequence[i].keyboardModifiers();
int key = sequence[i] & MouseKeyMask; int key = sequence[i].key();
if (key) if (key)
{ {

View file

@ -59,13 +59,6 @@ void CSMPrefs::State::declare()
.setTooltip("Minimum width of subviews.") .setTooltip("Minimum width of subviews.")
.setRange(50, 10000); .setRange(50, 10000);
declareEnum(mValues->mWindows.mMainwindowScrollbar, "Main Window Horizontal Scrollbar Mode"); declareEnum(mValues->mWindows.mMainwindowScrollbar, "Main Window Horizontal Scrollbar Mode");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
declareBool(mValues->mWindows.mGrowLimit, "Grow Limit Screen")
.setTooltip(
"When \"Grow then Scroll\" option is selected, the window size grows to"
" the width of the virtual desktop. \nIf this option is selected the the window growth"
"is limited to the current screen.");
#endif
declareCategory("Records"); declareCategory("Records");
declareEnum(mValues->mRecords.mStatusFormat, "Modification Status Display Format"); declareEnum(mValues->mRecords.mStatusFormat, "Modification Status Display Format");

View file

@ -659,11 +659,7 @@ void CSVDoc::View::addSubView(const CSMWorld::UniversalId& id, const std::string
// //
mScrollbarOnly = windows["mainwindow-scrollbar"].toString() == "Scrollbar Only"; mScrollbarOnly = windows["mainwindow-scrollbar"].toString() == "Scrollbar Only";
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
updateWidth(windows["grow-limit"].isTrue(), minWidth);
#else
updateWidth(true, minWidth); updateWidth(true, minWidth);
#endif
mSubViewWindow.addDockWidget(Qt::TopDockWidgetArea, view); mSubViewWindow.addDockWidget(Qt::TopDockWidgetArea, view);

View file

@ -50,7 +50,7 @@ namespace CSVFilter
std::pair<std::string, FilterType> operator()(const QVariant& variantData) std::pair<std::string, FilterType> operator()(const QVariant& variantData)
{ {
FilterType filterType = FilterType::String; FilterType filterType = FilterType::String;
QMetaType::Type dataType = static_cast<QMetaType::Type>(variantData.type()); QMetaType::Type dataType = static_cast<QMetaType::Type>(variantData.typeId());
if (dataType == QMetaType::QString || dataType == QMetaType::Bool || dataType == QMetaType::Int) if (dataType == QMetaType::QString || dataType == QMetaType::Bool || dataType == QMetaType::Int)
filterType = FilterType::String; filterType = FilterType::String;
if (dataType == QMetaType::Int || dataType == QMetaType::Float) if (dataType == QMetaType::Int || dataType == QMetaType::Float)

View file

@ -1132,7 +1132,7 @@ void CSVRender::InstanceMode::dropEvent(QDropEvent* event)
return; return;
WorldspaceHitResult hit WorldspaceHitResult hit
= getWorldspaceWidget().mousePick(event->pos(), getWorldspaceWidget().getInteractionMask()); = getWorldspaceWidget().mousePick(event->position().toPoint(), getWorldspaceWidget().getInteractionMask());
std::string cellId = getWorldspaceWidget().getCellId(hit.worldPos); std::string cellId = getWorldspaceWidget().getCellId(hit.worldPos);

View file

@ -161,8 +161,6 @@ namespace CSVRender
, mLighting(nullptr) , mLighting(nullptr)
, mHasDefaultAmbient(false) , mHasDefaultAmbient(false)
, mIsExterior(true) , mIsExterior(true)
, mPrevMouseX(0)
, mPrevMouseY(0)
, mCamPositionSet(false) , mCamPositionSet(false)
{ {
mFreeCamControl = new FreeCameraController(this); mFreeCamControl = new FreeCameraController(this);
@ -423,10 +421,10 @@ namespace CSVRender
void SceneWidget::mouseMoveEvent(QMouseEvent* event) void SceneWidget::mouseMoveEvent(QMouseEvent* event)
{ {
mCurrentCamControl->handleMouseMoveEvent(event->x() - mPrevMouseX, event->y() - mPrevMouseY); QPointF pos = event->position();
mCurrentCamControl->handleMouseMoveEvent(pos.x() - mPrevMouse.x(), pos.y() - mPrevMouse.y());
mPrevMouseX = event->x(); mPrevMouse = pos;
mPrevMouseY = event->y();
} }
void SceneWidget::wheelEvent(QWheelEvent* event) void SceneWidget::wheelEvent(QWheelEvent* event)

View file

@ -137,7 +137,7 @@ namespace CSVRender
LightingNight mLightingNight; LightingNight mLightingNight;
LightingBright mLightingBright; LightingBright mLightingBright;
int mPrevMouseX, mPrevMouseY; QPointF mPrevMouse;
/// Tells update that camera isn't set /// Tells update that camera isn't set
bool mCamPositionSet; bool mCamPositionSet;

View file

@ -1661,7 +1661,7 @@ void CSVRender::TerrainShapeMode::dragMoveEvent(QDragMoveEvent* event) {}
void CSVRender::TerrainShapeMode::mouseMoveEvent(QMouseEvent* event) void CSVRender::TerrainShapeMode::mouseMoveEvent(QMouseEvent* event)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->pos(), getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->position().toPoint(), getInteractionMask());
if (hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing)) if (hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing))
mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape); mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape);
if (!hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing)) if (!hit.hit && mBrushDraw && !(mShapeEditTool == ShapeEditTool_Drag && mIsEditing))

View file

@ -724,7 +724,7 @@ void CSVRender::TerrainTextureMode::dragMoveEvent(QDragMoveEvent* event) {}
void CSVRender::TerrainTextureMode::mouseMoveEvent(QMouseEvent* event) void CSVRender::TerrainTextureMode::mouseMoveEvent(QMouseEvent* event)
{ {
WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->pos(), getInteractionMask()); WorldspaceHitResult hit = getWorldspaceWidget().mousePick(event->position().toPoint(), getInteractionMask());
if (hit.hit && mBrushDraw) if (hit.hit && mBrushDraw)
mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape); mBrushDraw->update(hit.worldPos, mBrushSize, mBrushShape);
if (!hit.hit && mBrushDraw) if (!hit.hit && mBrushDraw)

View file

@ -687,11 +687,12 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent(QMouseEvent* event)
if (mDragging) if (mDragging)
{ {
int diffX = event->x() - mDragX; QPoint pos = event->position().toPoint();
int diffY = (height() - event->y()) - mDragY; int diffX = pos.x() - mDragX;
int diffY = (height() - pos.y()) - mDragY;
mDragX = event->x(); mDragX = pos.x();
mDragY = height() - event->y(); mDragY = height() - pos.y();
double factor = mDragFactor; double factor = mDragFactor;
@ -700,32 +701,32 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent(QMouseEvent* event)
EditMode& editMode = dynamic_cast<CSVRender::EditMode&>(*mEditMode->getCurrent()); EditMode& editMode = dynamic_cast<CSVRender::EditMode&>(*mEditMode->getCurrent());
editMode.drag(event->pos(), diffX, diffY, factor); editMode.drag(event->position().toPoint(), diffX, diffY, factor);
} }
else if (mDragMode != InteractionType_None) else if (mDragMode != InteractionType_None)
{ {
EditMode& editMode = dynamic_cast<CSVRender::EditMode&>(*mEditMode->getCurrent()); EditMode& editMode = dynamic_cast<CSVRender::EditMode&>(*mEditMode->getCurrent());
if (mDragMode == InteractionType_PrimaryEdit) if (mDragMode == InteractionType_PrimaryEdit)
mDragging = editMode.primaryEditStartDrag(event->pos()); mDragging = editMode.primaryEditStartDrag(event->position().toPoint());
else if (mDragMode == InteractionType_SecondaryEdit) else if (mDragMode == InteractionType_SecondaryEdit)
mDragging = editMode.secondaryEditStartDrag(event->pos()); mDragging = editMode.secondaryEditStartDrag(event->position().toPoint());
else if (mDragMode == InteractionType_PrimarySelect) else if (mDragMode == InteractionType_PrimarySelect)
mDragging = editMode.primarySelectStartDrag(event->pos()); mDragging = editMode.primarySelectStartDrag(event->position().toPoint());
else if (mDragMode == InteractionType_SecondarySelect) else if (mDragMode == InteractionType_SecondarySelect)
mDragging = editMode.secondarySelectStartDrag(event->pos()); mDragging = editMode.secondarySelectStartDrag(event->position().toPoint());
if (mDragging) if (mDragging)
{ {
mDragX = event->localPos().x(); mDragX = event->position().x();
mDragY = height() - event->localPos().y(); mDragY = height() - event->position().y();
} }
} }
else else
{ {
if (event->globalPos() != mToolTipPos) if (event->globalPosition().toPoint() != mToolTipPos)
{ {
mToolTipPos = event->globalPos(); mToolTipPos = event->globalPosition().toPoint();
if (mShowToolTips) if (mShowToolTips)
{ {
@ -734,7 +735,7 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent(QMouseEvent* event)
} }
} }
const QPointF& pos = event->localPos(); QPoint pos = event->position().toPoint();
handleMarkerHighlight(pos.x(), pos.y()); handleMarkerHighlight(pos.x(), pos.y());
SceneWidget::mouseMoveEvent(event); SceneWidget::mouseMoveEvent(event);
} }

View file

@ -260,8 +260,6 @@ namespace CSVRender
void settingChanged(const CSMPrefs::Setting* setting) override; void settingChanged(const CSMPrefs::Setting* setting) override;
bool getSpeedMode();
void cycleNavigationMode(); void cycleNavigationMode();
private: private:

View file

@ -93,7 +93,7 @@ void CSVTools::ReportTable::contextMenuEvent(QContextMenuEvent* event)
void CSVTools::ReportTable::mouseMoveEvent(QMouseEvent* event) void CSVTools::ReportTable::mouseMoveEvent(QMouseEvent* event)
{ {
if (event->buttons() & Qt::LeftButton) if (event->buttons() & Qt::LeftButton)
startDragFromTable(*this, indexAt(event->pos())); startDragFromTable(*this, indexAt(event->position().toPoint()));
} }
void CSVTools::ReportTable::mouseDoubleClickEvent(QMouseEvent* event) void CSVTools::ReportTable::mouseDoubleClickEvent(QMouseEvent* event)

View file

@ -52,7 +52,7 @@ void CSVWidget::ColorPickerPopup::mousePressEvent(QMouseEvent* event)
// If the mouse is pressed above the pop-up parent, // If the mouse is pressed above the pop-up parent,
// the pop-up will be hidden and the pressed signal won't be repeated for the parent // the pop-up will be hidden and the pressed signal won't be repeated for the parent
if (buttonRect.contains(event->globalPos()) || buttonRect.contains(event->pos())) if (buttonRect.contains(event->globalPosition().toPoint()) || buttonRect.contains(event->position().toPoint()))
{ {
setAttribute(Qt::WA_NoMouseReplay); setAttribute(Qt::WA_NoMouseReplay);
} }

View file

@ -22,12 +22,8 @@ int CSVWidget::CompleterPopup::sizeHintForRow(int row) const
ensurePolished(); ensurePolished();
QModelIndex index = model()->index(row, modelColumn()); QModelIndex index = model()->index(row, modelColumn());
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QStyleOptionViewItem option; QStyleOptionViewItem option;
initViewItemOption(&option); initViewItemOption(&option);
#else QAbstractItemDelegate* delegate = itemDelegateForIndex(index);
QStyleOptionViewItem option = viewOptions();
#endif
QAbstractItemDelegate* delegate = itemDelegate(index);
return delegate->sizeHint(option, index).height(); return delegate->sizeHint(option, index).height();
} }

View file

@ -85,7 +85,7 @@ void CSVWorld::NotEditableSubDelegate::setEditorData(QWidget* editor, const QMod
CSMWorld::Columns::ColumnId columnId CSMWorld::Columns::ColumnId columnId
= static_cast<CSMWorld::Columns::ColumnId>(mTable->getColumnId(index.column())); = static_cast<CSMWorld::Columns::ColumnId>(mTable->getColumnId(index.column()));
if (QVariant::String == v.type()) if (QMetaType::QString == v.typeId())
{ {
label->setText(v.toString()); label->setText(v.toString());
} }

View file

@ -55,7 +55,7 @@ void CSVWorld::DragRecordTable::dragEnterEvent(QDragEnterEvent* event)
void CSVWorld::DragRecordTable::dragMoveEvent(QDragMoveEvent* event) void CSVWorld::DragRecordTable::dragMoveEvent(QDragMoveEvent* event)
{ {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
if (CSVWorld::DragDropUtils::canAcceptData(*event, getIndexDisplayType(index)) if (CSVWorld::DragDropUtils::canAcceptData(*event, getIndexDisplayType(index))
|| CSVWorld::DragDropUtils::isInfo(*event, getIndexDisplayType(index)) || CSVWorld::DragDropUtils::isInfo(*event, getIndexDisplayType(index))
|| CSVWorld::DragDropUtils::isTopicOrJournal(*event, getIndexDisplayType(index))) || CSVWorld::DragDropUtils::isTopicOrJournal(*event, getIndexDisplayType(index)))
@ -71,7 +71,7 @@ void CSVWorld::DragRecordTable::dragMoveEvent(QDragMoveEvent* event)
void CSVWorld::DragRecordTable::dropEvent(QDropEvent* event) void CSVWorld::DragRecordTable::dropEvent(QDropEvent* event)
{ {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
CSMWorld::ColumnBase::Display display = getIndexDisplayType(index); CSMWorld::ColumnBase::Display display = getIndexDisplayType(index);
if (CSVWorld::DragDropUtils::canAcceptData(*event, display)) if (CSVWorld::DragDropUtils::canAcceptData(*event, display))
{ {

View file

@ -341,7 +341,7 @@ void CSVWorld::RegionMap::viewInTable()
void CSVWorld::RegionMap::mouseMoveEvent(QMouseEvent* event) void CSVWorld::RegionMap::mouseMoveEvent(QMouseEvent* event)
{ {
startDragFromTable(*this, indexAt(event->pos())); startDragFromTable(*this, indexAt(event->position().toPoint()));
} }
std::vector<CSMWorld::UniversalId> CSVWorld::RegionMap::getDraggedRecords() const std::vector<CSMWorld::UniversalId> CSVWorld::RegionMap::getDraggedRecords() const
@ -376,7 +376,7 @@ void CSVWorld::RegionMap::dragMoveEvent(QDragMoveEvent* event)
void CSVWorld::RegionMap::dropEvent(QDropEvent* event) void CSVWorld::RegionMap::dropEvent(QDropEvent* event)
{ {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
bool exists = QTableView::model()->data(index, Qt::BackgroundRole) != QBrush(Qt::DiagCrossPattern); bool exists = QTableView::model()->data(index, Qt::BackgroundRole) != QBrush(Qt::DiagCrossPattern);
if (!index.isValid() || !exists) if (!index.isValid() || !exists)

View file

@ -136,7 +136,7 @@ void CSVWorld::ScriptEdit::dragEnterEvent(QDragEnterEvent* event)
QPlainTextEdit::dragEnterEvent(event); QPlainTextEdit::dragEnterEvent(event);
else else
{ {
setTextCursor(cursorForPosition(event->pos())); setTextCursor(cursorForPosition(event->position().toPoint()));
event->acceptProposedAction(); event->acceptProposedAction();
} }
} }
@ -148,7 +148,7 @@ void CSVWorld::ScriptEdit::dragMoveEvent(QDragMoveEvent* event)
QPlainTextEdit::dragMoveEvent(event); QPlainTextEdit::dragMoveEvent(event);
else else
{ {
setTextCursor(cursorForPosition(event->pos())); setTextCursor(cursorForPosition(event->position().toPoint()));
event->accept(); event->accept();
} }
} }
@ -162,7 +162,7 @@ void CSVWorld::ScriptEdit::dropEvent(QDropEvent* event)
return; return;
} }
setTextCursor(cursorForPosition(event->pos())); setTextCursor(cursorForPosition(event->position().toPoint()));
if (mime->fromDocument(mDocument)) if (mime->fromDocument(mDocument))
{ {

View file

@ -592,7 +592,7 @@ void CSVWorld::Table::moveRecords(QDropEvent* event)
if (mEditLock || (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant)) if (mEditLock || (mModel->getFeatures() & CSMWorld::IdTableBase::Feature_Constant))
return; return;
QModelIndex targedIndex = indexAt(event->pos()); QModelIndex targedIndex = indexAt(event->position().toPoint());
QModelIndexList selectedRows = selectionModel()->selectedRows(); QModelIndexList selectedRows = selectionModel()->selectedRows();
int targetRowRaw = targedIndex.row(); int targetRowRaw = targedIndex.row();
@ -872,7 +872,7 @@ void CSVWorld::Table::mouseMoveEvent(QMouseEvent* event)
{ {
if (event->buttons() & Qt::LeftButton) if (event->buttons() & Qt::LeftButton)
{ {
startDragFromTable(*this, indexAt(event->pos())); startDragFromTable(*this, indexAt(event->position().toPoint()));
} }
} }

View file

@ -31,7 +31,7 @@ namespace CSVWorld
auto& clickEvent = static_cast<QMouseEvent&>(*event); auto& clickEvent = static_cast<QMouseEvent&>(*event);
if ((clickEvent.button() == Qt::MiddleButton)) if ((clickEvent.button() == Qt::MiddleButton))
{ {
const auto& index = table.indexAt(clickEvent.pos()); const auto& index = table.indexAt(clickEvent.position().toPoint());
table.setColumnHidden(index.column(), true); table.setColumnHidden(index.column(), true);
clickEvent.accept(); clickEvent.accept();
return true; return true;

View file

@ -171,7 +171,7 @@ QWidget* CSVWorld::CommandDelegate::createEditor(
// TODO: Find a better solution? // TODO: Find a better solution?
if (display == CSMWorld::ColumnBase::Display_Boolean) if (display == CSMWorld::ColumnBase::Display_Boolean)
{ {
return QItemEditorFactory::defaultFactory()->createEditor(QVariant::Bool, parent); return QItemEditorFactory::defaultFactory()->createEditor(QMetaType::Bool, parent);
} }
// For tables the pop-up of the color editor should appear immediately after the editor creation // For tables the pop-up of the color editor should appear immediately after the editor creation
// (the third parameter of ColorEditor's constructor) // (the third parameter of ColorEditor's constructor)
@ -362,11 +362,7 @@ void CSVWorld::CommandDelegate::setEditorData(QWidget* editor, const QModelIndex
if (!n.isEmpty()) if (!n.isEmpty())
{ {
if (!variant.isValid()) if (!variant.isValid())
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
variant = QVariant(editor->property(n).metaType(), (const void*)nullptr); variant = QVariant(editor->property(n).metaType(), (const void*)nullptr);
#else
variant = QVariant(editor->property(n).userType(), (const void*)nullptr);
#endif
editor->setProperty(n, variant); editor->setProperty(n, variant);
} }
} }

View file

@ -8,9 +8,6 @@
#include <string_view> #include <string_view>
#include <vector> #include <vector>
#include "../mwmechanics/greetingstate.hpp"
#include "../mwrender/animationpriority.hpp"
#include "../mwworld/ptr.hpp" #include "../mwworld/ptr.hpp"
namespace osg namespace osg
@ -27,6 +24,11 @@ namespace ESM
class ESMWriter; class ESMWriter;
} }
namespace MWMechanics
{
enum class GreetingState;
}
namespace MWWorld namespace MWWorld
{ {
class Ptr; class Ptr;

View file

@ -976,9 +976,6 @@ namespace MWLua
bool hasDuration = !(mgef->mData.mFlags & ESM::MagicEffect::NoDuration); bool hasDuration = !(mgef->mData.mFlags & ESM::MagicEffect::NoDuration);
effect.mDuration = hasDuration ? static_cast<float>(enam.mData.mDuration) : 1.f; effect.mDuration = hasDuration ? static_cast<float>(enam.mData.mDuration) : 1.f;
bool appliedOnce = mgef->mData.mFlags & ESM::MagicEffect::AppliedOnce;
if (!appliedOnce)
effect.mDuration = std::max(1.f, effect.mDuration);
effect.mTimeLeft = effect.mDuration; effect.mTimeLeft = effect.mDuration;
params.getEffects().emplace_back(effect); params.getEffects().emplace_back(effect);

View file

@ -73,7 +73,7 @@ namespace MWMechanics
CharacterController mCharacterController; CharacterController mCharacterController;
int mGreetingTimer{ 0 }; int mGreetingTimer{ 0 };
float mTargetAngleRadians{ 0.f }; float mTargetAngleRadians{ 0.f };
GreetingState mGreetingState{ Greet_None }; GreetingState mGreetingState{ GreetingState::None };
Misc::DeviatingPeriodicTimer mEngageCombat{ 1.0f, 0.25f, Misc::DeviatingPeriodicTimer mEngageCombat{ 1.0f, 0.25f,
Misc::Rng::deviate(0, 0.25f, MWBase::Environment::get().getWorld()->getPrng()) }; Misc::Rng::deviate(0, 0.25f, MWBase::Environment::get().getWorld()->getPrng()) };
bool mIsTurningToPlayer{ false }; bool mIsTurningToPlayer{ false };

View file

@ -50,6 +50,7 @@
#include "attacktype.hpp" #include "attacktype.hpp"
#include "character.hpp" #include "character.hpp"
#include "creaturestats.hpp" #include "creaturestats.hpp"
#include "greetingstate.hpp"
#include "movement.hpp" #include "movement.hpp"
#include "npcstats.hpp" #include "npcstats.hpp"
#include "steering.hpp" #include "steering.hpp"
@ -487,7 +488,7 @@ namespace MWMechanics
{ {
actorState.setTurningToPlayer(false); actorState.setTurningToPlayer(false);
actorState.setGreetingTimer(0); actorState.setGreetingTimer(0);
actorState.setGreetingState(Greet_None); actorState.setGreetingState(GreetingState::None);
return; return;
} }
@ -525,7 +526,7 @@ namespace MWMechanics
int greetingTimer = actorState.getGreetingTimer(); int greetingTimer = actorState.getGreetingTimer();
GreetingState greetingState = actorState.getGreetingState(); GreetingState greetingState = actorState.getGreetingState();
if (greetingState == Greet_None) if (greetingState == GreetingState::None)
{ {
if ((playerPos - actorPos).length2() <= helloDistance * helloDistance && !playerStats.isDead() if ((playerPos - actorPos).length2() <= helloDistance * helloDistance && !playerStats.isDead()
&& !actorStats.isParalyzed() && !isTargetMagicallyHidden(player) && !actorStats.isParalyzed() && !isTargetMagicallyHidden(player)
@ -535,14 +536,14 @@ namespace MWMechanics
if (greetingTimer >= GREETING_SHOULD_START) if (greetingTimer >= GREETING_SHOULD_START)
{ {
greetingState = Greet_InProgress; greetingState = GreetingState::InProgress;
if (!MWBase::Environment::get().getDialogueManager()->say(actor, ESM::RefId::stringRefId("hello"))) if (!MWBase::Environment::get().getDialogueManager()->say(actor, ESM::RefId::stringRefId("hello")))
greetingState = Greet_Done; greetingState = GreetingState::Done;
greetingTimer = 0; greetingTimer = 0;
} }
} }
if (greetingState == Greet_InProgress) if (greetingState == GreetingState::InProgress)
{ {
greetingTimer++; greetingTimer++;
@ -554,16 +555,16 @@ namespace MWMechanics
if (greetingTimer >= GREETING_COOLDOWN) if (greetingTimer >= GREETING_COOLDOWN)
{ {
greetingState = Greet_Done; greetingState = GreetingState::Done;
greetingTimer = 0; greetingTimer = 0;
} }
} }
if (greetingState == Greet_Done) if (greetingState == GreetingState::Done)
{ {
float resetDist = 2 * helloDistance; float resetDist = 2 * helloDistance;
if ((playerPos - actorPos).length2() >= resetDist * resetDist) if ((playerPos - actorPos).length2() >= resetDist * resetDist)
greetingState = Greet_None; greetingState = GreetingState::None;
} }
actorState.setGreetingTimer(greetingTimer); actorState.setGreetingTimer(greetingTimer);
@ -2381,7 +2382,7 @@ namespace MWMechanics
{ {
const auto it = mIndex.find(ptr.mRef); const auto it = mIndex.find(ptr.mRef);
if (it == mIndex.end()) if (it == mIndex.end())
return Greet_None; return GreetingState::None;
return it->second->getGreetingState(); return it->second->getGreetingState();
} }

View file

@ -12,6 +12,7 @@
#include "character.hpp" #include "character.hpp"
#include "creaturestats.hpp" #include "creaturestats.hpp"
#include "greetingstate.hpp"
#include "movement.hpp" #include "movement.hpp"
namespace namespace
@ -77,7 +78,7 @@ namespace MWMechanics
if (!stats.getMovementFlag(CreatureStats::Flag_ForceJump) if (!stats.getMovementFlag(CreatureStats::Flag_ForceJump)
&& !stats.getMovementFlag(CreatureStats::Flag_ForceSneak) && !stats.getMovementFlag(CreatureStats::Flag_ForceSneak)
&& (mechMgr->isTurningToPlayer(actor) || mechMgr->getGreetingState(actor) == Greet_InProgress)) && (mechMgr->isTurningToPlayer(actor) || mechMgr->getGreetingState(actor) == GreetingState::InProgress))
return false; return false;
const osg::Vec3f actorPos(actor.getRefData().getPosition().asVec3()); const osg::Vec3f actorPos(actor.getRefData().getPosition().asVec3());

View file

@ -25,6 +25,7 @@
#include "actorutil.hpp" #include "actorutil.hpp"
#include "character.hpp" #include "character.hpp"
#include "creaturestats.hpp" #include "creaturestats.hpp"
#include "greetingstate.hpp"
#include "movement.hpp" #include "movement.hpp"
#include "pathgrid.hpp" #include "pathgrid.hpp"
@ -257,7 +258,7 @@ namespace MWMechanics
&& !cStats.getMovementFlag(CreatureStats::Flag_ForceSneak)) && !cStats.getMovementFlag(CreatureStats::Flag_ForceSneak))
{ {
GreetingState greetingState = MWBase::Environment::get().getMechanicsManager()->getGreetingState(actor); GreetingState greetingState = MWBase::Environment::get().getMechanicsManager()->getGreetingState(actor);
if (greetingState == Greet_InProgress) if (greetingState == GreetingState::InProgress)
{ {
if (storage.mState == AiWanderStorage::Wander_Walking) if (storage.mState == AiWanderStorage::Wander_Walking)
{ {
@ -526,7 +527,7 @@ namespace MWMechanics
// Check if idle animation finished // Check if idle animation finished
GreetingState greetingState = MWBase::Environment::get().getMechanicsManager()->getGreetingState(actor); GreetingState greetingState = MWBase::Environment::get().getMechanicsManager()->getGreetingState(actor);
if (!checkIdle(actor, storage.mIdleAnimation) && (greetingState == Greet_Done || greetingState == Greet_None)) if (!checkIdle(actor, storage.mIdleAnimation) && greetingState != GreetingState::InProgress)
{ {
if (mPathFinder.isPathConstructed()) if (mPathFinder.isPathConstructed())
storage.setState(AiWanderStorage::Wander_Walking, !mUsePathgrid); storage.setState(AiWanderStorage::Wander_Walking, !mUsePathgrid);

View file

@ -3,11 +3,11 @@
namespace MWMechanics namespace MWMechanics
{ {
enum GreetingState enum class GreetingState
{ {
Greet_None, None,
Greet_InProgress, InProgress,
Greet_Done Done
}; };
} }

View file

@ -1453,6 +1453,7 @@ namespace MWMechanics
} }
startCombat(actor, player, &playerFollowers); startCombat(actor, player, &playerFollowers);
observerStats.setHitAttemptActorId(player.getClass().getCreatureStats(player).getActorId());
// Apply aggression value to the base Fight rating, so that the actor can continue fighting // Apply aggression value to the base Fight rating, so that the actor can continue fighting
// after a Calm spell wears off // after a Calm spell wears off

View file

@ -22,6 +22,7 @@
#include "../mwmechanics/aitravel.hpp" #include "../mwmechanics/aitravel.hpp"
#include "../mwmechanics/aiwander.hpp" #include "../mwmechanics/aiwander.hpp"
#include "../mwmechanics/creaturestats.hpp" #include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/greetingstate.hpp"
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/mechanicsmanager.hpp" #include "../mwbase/mechanicsmanager.hpp"
@ -487,7 +488,7 @@ namespace MWScript
else if (testedTargetId == "Player") // Currently the player ID is hardcoded else if (testedTargetId == "Player") // Currently the player ID is hardcoded
{ {
MWBase::MechanicsManager* mechMgr = MWBase::Environment::get().getMechanicsManager(); MWBase::MechanicsManager* mechMgr = MWBase::Environment::get().getMechanicsManager();
bool greeting = mechMgr->getGreetingState(actor) == MWMechanics::Greet_InProgress; bool greeting = mechMgr->getGreetingState(actor) == MWMechanics::GreetingState::InProgress;
bool sayActive = MWBase::Environment::get().getSoundManager()->sayActive(actor); bool sayActive = MWBase::Environment::get().getSoundManager()->sayActive(actor);
targetsAreEqual = (greeting && sayActive) || mechMgr->isTurningToPlayer(actor); targetsAreEqual = (greeting && sayActive) || mechMgr->isTurningToPlayer(actor);
} }

View file

@ -6,7 +6,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <osg/Quat>
#include <osg/Vec4f> #include <osg/Vec4f>
#include "doorstate.hpp" #include "doorstate.hpp"
@ -16,9 +15,13 @@
#include "../mwmechanics/damagesourcetype.hpp" #include "../mwmechanics/damagesourcetype.hpp"
#include <components/esm/refid.hpp> #include <components/esm/refid.hpp>
#include <components/esm3/loadskil.hpp>
#include <components/vfs/pathutil.hpp> #include <components/vfs/pathutil.hpp>
namespace osg
{
class Quat;
}
namespace ESM namespace ESM
{ {
struct ObjectState; struct ObjectState;

View file

@ -25,11 +25,6 @@ namespace
Config::GameSettings::GameSettings(const Files::ConfigurationManager& cfg) Config::GameSettings::GameSettings(const Files::ConfigurationManager& cfg)
: mCfgMgr(cfg) : mCfgMgr(cfg)
{ {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// this needs calling once so Qt can see its stream operators, which it needs when dragging and dropping
// it's automatic with Qt 6
qRegisterMetaTypeStreamOperators<SettingValue>("Config::SettingValue");
#endif
} }
void Config::GameSettings::validatePaths() void Config::GameSettings::validatePaths()

View file

@ -14,11 +14,7 @@ namespace L10n
// Try to load OpenMW translations from resources folder first. // Try to load OpenMW translations from resources folder first.
// If we loaded them, try to load Qt translations from both // If we loaded them, try to load Qt translations from both
// resources folder and default translations folder as well. // resources folder and default translations folder as well.
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
auto qtPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath); auto qtPath = QLibraryInfo::path(QLibraryInfo::TranslationsPath);
#else
auto qtPath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
#endif
auto localPath = resourcesPath + "/translations"; auto localPath = resourcesPath + "/translations";
if (AppTranslator.load(QLocale::system(), appName, "_", localPath) if (AppTranslator.load(QLocale::system(), appName, "_", localPath)

View file

@ -3,20 +3,13 @@
#include <QtGlobal> #include <QtGlobal>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QTextCodec>
#endif
#include <QTextStream> #include <QTextStream>
namespace Misc namespace Misc
{ {
inline void ensureUtf8Encoding(QTextStream& stream) inline void ensureUtf8Encoding(QTextStream& stream)
{ {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
stream.setCodec(QTextCodec::codecForName("UTF-8"));
#else
stream.setEncoding(QStringConverter::Utf8); stream.setEncoding(QStringConverter::Utf8);
#endif
} }
} }
#endif #endif

View file

@ -209,6 +209,7 @@ if (BUILD_BENCHMARKS AND NOT OPENMW_USE_SYSTEM_BENCHMARK)
set(BENCHMARK_ENABLE_TESTING OFF) set(BENCHMARK_ENABLE_TESTING OFF)
set(BENCHMARK_ENABLE_INSTALL OFF) set(BENCHMARK_ENABLE_INSTALL OFF)
set(BENCHMARK_ENABLE_GTEST_TESTS OFF) set(BENCHMARK_ENABLE_GTEST_TESTS OFF)
set(BENCHMARK_ENABLE_WERROR OFF)
include(FetchContent) include(FetchContent)
FetchContent_Declare(benchmark FetchContent_Declare(benchmark

View file

@ -17,11 +17,7 @@ set(OSGQT_SOURCE_FILES
add_library(${OSGQT_LIBRARY} STATIC ${OSGQT_SOURCE_FILES}) add_library(${OSGQT_LIBRARY} STATIC ${OSGQT_SOURCE_FILES})
if (QT_VERSION_MAJOR VERSION_EQUAL 6) target_link_libraries(${OSGQT_LIBRARY} Qt::Core Qt::OpenGL Qt::OpenGLWidgets)
target_link_libraries(${OSGQT_LIBRARY} Qt::Core Qt::OpenGL Qt::OpenGLWidgets)
else()
target_link_libraries(${OSGQT_LIBRARY} Qt::Core Qt::OpenGL)
endif()
link_directories(${CMAKE_CURRENT_BINARY_DIR}) link_directories(${CMAKE_CURRENT_BINARY_DIR})

View file

@ -331,6 +331,7 @@
--- ---
-- Adds a new spell to the list of active spells (only in global scripts or on self). -- Adds a new spell to the list of active spells (only in global scripts or on self).
-- Note that this does not play any related VFX or sounds. -- Note that this does not play any related VFX or sounds.
-- Note that this should not be used to add spells without durations (i.e. abilities, curses, and diseases) as they will expire instantly. Use @{#ActorSpells.add} instead.
-- @function [parent=#ActorActiveSpells] add -- @function [parent=#ActorActiveSpells] add
-- @param self -- @param self
-- @param #table options A table of parameters. Must contain the following required parameters: -- @param #table options A table of parameters. Must contain the following required parameters: