From f1abc5d7cb6e2100e5d7fc4863c8a999fd861f78 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 4 Mar 2017 18:30:31 +0100 Subject: [PATCH 01/17] [macOS, CI] Use Release configuration --- CI/before_script.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_script.osx.sh b/CI/before_script.osx.sh index f3d0f716b..bec26caf1 100755 --- a/CI/before_script.osx.sh +++ b/CI/before_script.osx.sh @@ -13,7 +13,7 @@ cmake \ -D CMAKE_PREFIX_PATH="$DEPENDENCIES_ROOT;$QT_PATH" \ -D CMAKE_OSX_DEPLOYMENT_TARGET="10.8" \ -D CMAKE_OSX_SYSROOT="macosx10.12" \ --D CMAKE_BUILD_TYPE=Debug \ +-D CMAKE_BUILD_TYPE=Release \ -D OPENMW_OSX_DEPLOYMENT=TRUE \ -D DESIRED_QT_VERSION=5 \ -D BUILD_ESMTOOL=FALSE \ From 57c5ecfba835d1470a7475874a21eedb01f14417 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sun, 5 Mar 2017 18:03:58 +0100 Subject: [PATCH 02/17] [macOS, CI] Use most recent prebuilt dependencies --- CI/before_install.osx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/before_install.osx.sh b/CI/before_install.osx.sh index 49af86a3e..2d20eb9a0 100755 --- a/CI/before_install.osx.sh +++ b/CI/before_install.osx.sh @@ -7,5 +7,5 @@ brew rm pkgconfig || true brew rm qt5 || true brew install cmake pkgconfig $macos_qt_formula -curl https://downloads.openmw.org/osx/dependencies/openmw-deps-0ecece4.zip -o ~/openmw-deps.zip +curl https://downloads.openmw.org/osx/dependencies/openmw-deps-c79172d.zip -o ~/openmw-deps.zip unzip ~/openmw-deps.zip -d /private/tmp/openmw-deps > /dev/null From af1fe64408ac85d635acc11d157ab8f9548c9d6a Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Tue, 7 Mar 2017 19:00:09 +0100 Subject: [PATCH 03/17] GetSoundPlaying called on an equipped item now also looks for sounds played by the equipping actor (Fixes #3781) --- apps/openmw/mwscript/soundextensions.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwscript/soundextensions.cpp b/apps/openmw/mwscript/soundextensions.cpp index a9896d203..516c58b26 100644 --- a/apps/openmw/mwscript/soundextensions.cpp +++ b/apps/openmw/mwscript/soundextensions.cpp @@ -12,6 +12,9 @@ #include "../mwbase/soundmanager.hpp" #include "../mwbase/windowmanager.hpp" +#include "../mwworld/inventorystore.hpp" +#include "../mwworld/class.hpp" + #include "interpretercontext.hpp" #include "ref.hpp" @@ -183,8 +186,22 @@ namespace MWScript int index = runtime[0].mInteger; runtime.pop(); - runtime.push (MWBase::Environment::get().getSoundManager()->getSoundPlaying ( - ptr, runtime.getStringLiteral (index))); + bool ret = MWBase::Environment::get().getSoundManager()->getSoundPlaying ( + ptr, runtime.getStringLiteral (index)); + + // GetSoundPlaying called on an equipped item should also look for sounds played by the equipping actor. + if (!ret && ptr.getContainerStore()) + { + MWWorld::Ptr cont = MWBase::Environment::get().getWorld()->findContainer(ptr); + + if (!cont.isEmpty() && cont.getClass().hasInventoryStore(cont) && cont.getClass().getInventoryStore(cont).isEquipped(ptr)) + { + ret = MWBase::Environment::get().getSoundManager()->getSoundPlaying ( + cont, runtime.getStringLiteral (index)); + } + } + + runtime.push(ret); } }; From e24cb0fe5dc29c50a29c84c2dad4913868dc9db1 Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sat, 4 Mar 2017 21:29:02 +0100 Subject: [PATCH 04/17] [macOS, CI] Configure deployment of nightly builds to FTP --- .travis.yml | 13 +++++++++++++ CI/deploy.osx.sh | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100755 CI/deploy.osx.sh diff --git a/.travis.yml b/.travis.yml index a669700c0..c3f1cdfb6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,10 @@ env: # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created # via the "travis encrypt" command using the project repo's public key - secure: "jybGzAdUbqt9vWR/GEnRd96BgAi/7Zd1+2HK68j/i/8+/1YH2XxLOy4Jv/DUBhBlJIkxs/Xv8dRcUlFOclZDHX1d/9Qnsqd3oUVkD7k1y7cTOWy9TBQaE/v/kZo3LpzA3xPwwthrb0BvqIbOfIELi5fS5s8ba85WFRg3AX70wWE=" + # macOS builds FTP upload login + - secure: "MegynKyJpyL7XDwdWVEbypQh7CLjqOqOi9lGF97G7Fq0HosVZTmnwjHhmIPZspTP7ES4UbxM3rs/f3ce7sp9JN2ShRJpduD6UEFc8egQXBte9J3obUBIdUxPTRdhnht7VJ+u+pksK1S/Bm1Cs6l0eEluP3vmcaXWMykVQcZsPhY=" + # macOS builds FTP upload password + - secure: "jQcAaWAdDy0+vlNu4POMX8322HanCOQEUTdpviWTAUjWQTjMa0UTM4+zVVgrtEaHMpBaVYYbTT3Rg5BQ9oG+2SiVLJBQQ2XoMcos/YrjPVT6inB02Gs0vFjP29LdPAQVrB8CkAcfQr6u+Z2C+RqAtwhE09LsBUMXjRDzPAtr1CM=" - macos_qt_formula=qt@5.5 addons: apt: @@ -62,6 +66,15 @@ script: - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "osx" ]; then make package; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./openmw_test_suite; fi - if [ "$COVERITY_SCAN_BRANCH" != 1 ] && [ "${TRAVIS_OS_NAME}" = "linux" ]; then cd .. && ./CI/check_tabs.sh; fi + - cd "${TRAVIS_BUILD_DIR}" +deploy: + provider: script + script: ./CI/deploy.osx.sh + skip_cleanup: true + on: + branch: master + condition: "$TRAVIS_EVENT_TYPE = cron && $TRAVIS_OS_NAME = osx" + repo: OpenMW/openmw notifications: email: recipients: diff --git a/CI/deploy.osx.sh b/CI/deploy.osx.sh new file mode 100755 index 000000000..1ff6f89c3 --- /dev/null +++ b/CI/deploy.osx.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +cd build + +DATE=`date +'%d%m%Y'` +SHORT_COMMIT=`git rev-parse --short ${TRAVIS_COMMIT}` +TARGET_FILENAME="OpenMW-${DATE}-${SHORT_COMMIT}.dmg" + +curl --ssl --ftp-create-dirs -T *.dmg -u $OSX_FTP_USER:$OSX_FTP_PASSWORD "ftp://s3.mydevil.net:21/nightly/${TARGET_FILENAME}" From 7f429f26e17c37882d3705be8d5ed819a66a139f Mon Sep 17 00:00:00 2001 From: Nikolay Kasyanov Date: Sun, 5 Mar 2017 19:28:29 +0100 Subject: [PATCH 05/17] Allow getting available version information even when clone is shallow --- CMakeLists.txt | 20 ++++++++------------ cmake/GitVersion.cmake | 15 ++++++++++----- components/version/version.cpp | 3 +-- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be734a8ca..8b4e9ad4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,18 +35,14 @@ set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VER set(GIT_CHECKOUT FALSE) if(EXISTS ${PROJECT_SOURCE_DIR}/.git) - if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow) - find_package(Git) - - if(GIT_FOUND) - set(GIT_CHECKOUT TRUE) - else(GIT_FOUND) - message(WARNING "Git executable not found") - endif(GIT_FOUND) - else(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow) - message(STATUS "Shallow Git clone detected, not attempting to retrieve version info") - endif(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git/shallow) -endif(EXISTS ${PROJECT_SOURCE_DIR}/.git) + find_package(Git) + + if(GIT_FOUND) + set(GIT_CHECKOUT TRUE) + else(GIT_FOUND) + message(WARNING "Git executable not found") + endif(GIT_FOUND) +endif(EXISTS ${PROJECT_SOURCE_DIR}/.git) # Macros include(OpenMWMacros) diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake index 0679e406c..32abbbfbf 100644 --- a/cmake/GitVersion.cmake +++ b/cmake/GitVersion.cmake @@ -3,7 +3,8 @@ execute_process ( WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE EXITCODE1 OUTPUT_VARIABLE TAGHASH - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET) execute_process ( COMMAND ${GIT_EXECUTABLE} rev-parse HEAD @@ -12,13 +13,17 @@ execute_process ( OUTPUT_VARIABLE COMMITHASH OUTPUT_STRIP_TRAILING_WHITESPACE) -string (COMPARE EQUAL "${EXITCODE1}:${EXITCODE2}" "0:0" SUCCESS) -if (SUCCESS) +string (COMPARE EQUAL "${EXITCODE1}:${EXITCODE2}" "0:0" FULL_SUCCESS) +string (COMPARE EQUAL "${EXITCODE2}" "0" COMMIT_SUCCESS) +if (FULL_SUCCESS) set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}") set(OPENMW_VERSION_TAGHASH "${TAGHASH}") message(STATUS "OpenMW version ${OPENMW_VERSION}") -else (SUCCESS) +elseif (COMMIT_SUCCESS) + set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}") + message(STATUS "OpenMW version ${OPENMW_VERSION}") +else () message(WARNING "Failed to get valid version information from Git") -endif (SUCCESS) +endif () configure_file(${VERSION_IN_FILE} ${VERSION_FILE}) diff --git a/components/version/version.cpp b/components/version/version.cpp index c87943f9e..fecbdcb3f 100644 --- a/components/version/version.cpp +++ b/components/version/version.cpp @@ -23,8 +23,7 @@ std::string Version::describe() { std::string str = "OpenMW version " + mVersion; std::string rev = mCommitHash; - std::string tag = mTagHash; - if (!rev.empty() && !tag.empty()) + if (!rev.empty()) { rev = rev.substr(0, 10); str += "\nRevision: " + rev; From fc95a45cb6bb8342bc9ef31843362a840b7970e4 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 5 Mar 2017 13:58:22 +0100 Subject: [PATCH 06/17] Don't pass repeat key events to the viewer's eventQueue --- components/sdlutil/sdlinputwrapper.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/components/sdlutil/sdlinputwrapper.cpp b/components/sdlutil/sdlinputwrapper.cpp index bc7c0d78a..a1c5e42b1 100644 --- a/components/sdlutil/sdlinputwrapper.cpp +++ b/components/sdlutil/sdlinputwrapper.cpp @@ -87,18 +87,24 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr v break; case SDL_KEYDOWN: if (!evt.key.repeat) + { mKeyboardListener->keyPressed(evt.key); - if (evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) - mViewer->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1)); + if (evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) + { + mViewer->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1)); + } + } break; case SDL_KEYUP: if (!evt.key.repeat) + { mKeyboardListener->keyReleased(evt.key); - if (evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) - mViewer->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1)); + if (evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) + mViewer->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1)); + } break; case SDL_TEXTEDITING: From 21aad00612d0f3fbd6e207e5a65d677ffb6dbc6f Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 5 Mar 2017 13:58:45 +0100 Subject: [PATCH 07/17] Don't pass key events to the viewer when Alt modifier is held Fixes the stats panel briefly showing up when using 'Alt+F4' to exit. --- components/sdlutil/sdlinputwrapper.cpp | 6 +++--- components/sdlutil/sdlinputwrapper.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/sdlutil/sdlinputwrapper.cpp b/components/sdlutil/sdlinputwrapper.cpp index a1c5e42b1..204680b44 100644 --- a/components/sdlutil/sdlinputwrapper.cpp +++ b/components/sdlutil/sdlinputwrapper.cpp @@ -90,7 +90,7 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr v { mKeyboardListener->keyPressed(evt.key); - if (evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) + if (!isModifierHeld(KMOD_ALT) && evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) { mViewer->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1)); } @@ -102,7 +102,7 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr v { mKeyboardListener->keyReleased(evt.key); - if (evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) + if (!isModifierHeld(KMOD_ALT) && evt.key.keysym.sym >= SDLK_F1 && evt.key.keysym.sym <= SDLK_F12) mViewer->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_F1 + (evt.key.keysym.sym - SDLK_F1)); } @@ -231,7 +231,7 @@ InputWrapper::InputWrapper(SDL_Window* window, osg::ref_ptr v } } - bool InputWrapper::isModifierHeld(SDL_Keymod mod) + bool InputWrapper::isModifierHeld(int mod) { return (SDL_GetModState() & mod) != 0; } diff --git a/components/sdlutil/sdlinputwrapper.hpp b/components/sdlutil/sdlinputwrapper.hpp index 62d6a565c..8387cbd6f 100644 --- a/components/sdlutil/sdlinputwrapper.hpp +++ b/components/sdlutil/sdlinputwrapper.hpp @@ -31,7 +31,7 @@ namespace SDLUtil void setControllerEventCallback(ControllerListener* listen) { mConListener = listen; } void capture(bool windowEventsOnly); - bool isModifierHeld(SDL_Keymod mod); + bool isModifierHeld(int mod); bool isKeyDown(SDL_Scancode key); void setMouseVisible (bool visible); From 809f5cd01be62a8a3746632511583166bdc729b9 Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 8 Mar 2017 01:28:56 +0100 Subject: [PATCH 08/17] Fix bad override --- apps/openmw/mwworld/inventorystore.cpp | 2 +- apps/openmw/mwworld/inventorystore.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp index b04720a58..df3f30bea 100644 --- a/apps/openmw/mwworld/inventorystore.cpp +++ b/apps/openmw/mwworld/inventorystore.cpp @@ -623,7 +623,7 @@ void MWWorld::InventoryStore::flagAsModified() mRechargingItemsUpToDate = false; } -bool MWWorld::InventoryStore::stacks(const ConstPtr& ptr1, const ConstPtr& ptr2) +bool MWWorld::InventoryStore::stacks(const ConstPtr& ptr1, const ConstPtr& ptr2) const { bool canStack = MWWorld::ContainerStore::stacks(ptr1, ptr2); if (!canStack) diff --git a/apps/openmw/mwworld/inventorystore.hpp b/apps/openmw/mwworld/inventorystore.hpp index eff4092d1..05f21370a 100644 --- a/apps/openmw/mwworld/inventorystore.hpp +++ b/apps/openmw/mwworld/inventorystore.hpp @@ -174,7 +174,7 @@ namespace MWWorld ///< \attention This function is internal to the world model and should not be called from /// outside. - virtual bool stacks (const ConstPtr& ptr1, const ConstPtr& ptr2); + virtual bool stacks (const ConstPtr& ptr1, const ConstPtr& ptr2) const; ///< @return true if the two specified objects can stack with each other virtual int remove(const Ptr& item, int count, const Ptr& actor); From 465b7361e1e8dc0f6c46ce5f6a11af7c33715401 Mon Sep 17 00:00:00 2001 From: Mitchell Schwitzer Date: Sun, 12 Mar 2017 15:18:02 -0700 Subject: [PATCH 09/17] fix skill window update invoke winMgr->updateSkillArea() in mechanicsmanagerimp.cpp after looping over ESM::Skill::SkillEnum if any updates have occurred. --- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index ca5d40b4a..e5b9e8fcf 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -338,16 +338,19 @@ namespace MWMechanics } } + bool updateSkills = false; //Loop over ESM::Skill::SkillEnum for(int i = 0; i < ESM::Skill::Length; ++i) { if(stats.getSkill(i) != mWatchedSkills[i] || mWatchedStatsEmpty) { + updateSkills = true; mWatchedSkills[i] = stats.getSkill(i); winMgr->setValue((ESM::Skill::SkillEnum)i, stats.getSkill(i)); } } + if (updateSkills) { winMgr->updateSkillArea(); } winMgr->setValue("level", stats.getLevel()); mWatchedStatsEmpty = false; From 7960d5a9a700a2af47903b3aa1ca5fb3776af48f Mon Sep 17 00:00:00 2001 From: Mitchell Schwitzer Date: Sun, 12 Mar 2017 16:44:56 -0700 Subject: [PATCH 10/17] fix skill progress bar v2 both widgets display their own progess indicator. it was being set for value (when you hovered over the level of your skill, eg the "5" in "Acrobatics 5"), but not for the name. this fixes that, but the progress information is being stored/displayed by two different widgets for one skill --- apps/openmw/mwgui/statswindow.cpp | 4 +++- apps/openmw/mwmechanics/mechanicsmanagerimp.cpp | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/statswindow.cpp b/apps/openmw/mwgui/statswindow.cpp index cee015da0..a47a6710b 100644 --- a/apps/openmw/mwgui/statswindow.cpp +++ b/apps/openmw/mwgui/statswindow.cpp @@ -237,8 +237,10 @@ namespace MWGui nameWidget->setSize(nameWidget->getWidth() - (widthAfter-widthBefore), nameWidget->getHeight()); } - if (value.getBase() < 100) + if (value.getBase() < 100) { + setSkillProgress(nameWidget, value.getProgress(), parSkill); setSkillProgress(valueWidget, value.getProgress(), parSkill); + } } } diff --git a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp index e5b9e8fcf..ca5d40b4a 100644 --- a/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp +++ b/apps/openmw/mwmechanics/mechanicsmanagerimp.cpp @@ -338,19 +338,16 @@ namespace MWMechanics } } - bool updateSkills = false; //Loop over ESM::Skill::SkillEnum for(int i = 0; i < ESM::Skill::Length; ++i) { if(stats.getSkill(i) != mWatchedSkills[i] || mWatchedStatsEmpty) { - updateSkills = true; mWatchedSkills[i] = stats.getSkill(i); winMgr->setValue((ESM::Skill::SkillEnum)i, stats.getSkill(i)); } } - if (updateSkills) { winMgr->updateSkillArea(); } winMgr->setValue("level", stats.getLevel()); mWatchedStatsEmpty = false; From f31e5ba85ef8dee288c2096fe73e659b32c234fe Mon Sep 17 00:00:00 2001 From: Mitchell Schwitzer Date: Sun, 12 Mar 2017 17:02:07 -0700 Subject: [PATCH 11/17] fix display maximum proficency reached --- apps/openmw/mwgui/statswindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/openmw/mwgui/statswindow.cpp b/apps/openmw/mwgui/statswindow.cpp index a47a6710b..2ba703b97 100644 --- a/apps/openmw/mwgui/statswindow.cpp +++ b/apps/openmw/mwgui/statswindow.cpp @@ -240,6 +240,16 @@ namespace MWGui if (value.getBase() < 100) { setSkillProgress(nameWidget, value.getProgress(), parSkill); setSkillProgress(valueWidget, value.getProgress(), parSkill); + } else { + nameWidget->setUserString("Visible_SkillMaxed", "true"); + nameWidget->setUserString("UserData^Hidden_SkillMaxed", "false"); + nameWidget->setUserString("Visible_SkillProgressVBox", "false"); + nameWidget->setUserString("UserData^Hidden_SkillProgressVBox", "true"); + + valueWidget->setUserString("Visible_SkillMaxed", "true"); + valueWidget->setUserString("UserData^Hidden_SkillMaxed", "false"); + valueWidget->setUserString("Visible_SkillProgressVBox", "false"); + valueWidget->setUserString("UserData^Hidden_SkillProgressVBox", "true"); } } } From 421b92ae05e566f1f783bc96640316cad8ab4a4a Mon Sep 17 00:00:00 2001 From: Mitchell Schwitzer Date: Sun, 12 Mar 2017 17:24:43 -0700 Subject: [PATCH 12/17] fix styling & add missing lines regarding max proficency --- apps/openmw/mwgui/statswindow.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/statswindow.cpp b/apps/openmw/mwgui/statswindow.cpp index 2ba703b97..b61212d88 100644 --- a/apps/openmw/mwgui/statswindow.cpp +++ b/apps/openmw/mwgui/statswindow.cpp @@ -237,7 +237,18 @@ namespace MWGui nameWidget->setSize(nameWidget->getWidth() - (widthAfter-widthBefore), nameWidget->getHeight()); } - if (value.getBase() < 100) { + if (value.getBase() < 100) + { + nameWidget->setUserString("Visible_SkillMaxed", "false"); + nameWidget->setUserString("UserData^Hidden_SkillMaxed", "true"); + nameWidget->setUserString("Visible_SkillProgressVBox", "true"); + nameWidget->setUserString("UserData^Hidden_SkillProgressVBox", "false"); + + valueWidget->setUserString("Visible_SkillMaxed", "false"); + valueWidget->setUserString("UserData^Hidden_SkillMaxed", "true"); + valueWidget->setUserString("Visible_SkillProgressVBox", "true"); + valueWidget->setUserString("UserData^Hidden_SkillProgressVBox", "false"); + setSkillProgress(nameWidget, value.getProgress(), parSkill); setSkillProgress(valueWidget, value.getProgress(), parSkill); } else { From e093a30736735d3063b192264c9dc6a2996564b0 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 13 Mar 2017 02:34:25 +0100 Subject: [PATCH 13/17] Update AUTHORS.md --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 7237b75cf..caaccc158 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -102,6 +102,7 @@ Programmers MichaƂ Moroz (dragonee) Miroslav Puda (pakanek) MiroslavR + Mitchell Schwitzer (schwitzerm) naclander Narmo Nathan Jeffords (blunted2night) From 13a6070629a5fe76fe1225db167c47e12f32cccf Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 28 Jan 2017 00:45:23 +0100 Subject: [PATCH 14/17] Remove warning spam in skeleton.cpp If the root bone is missing, that is caused by all bones being missing which will have been logged already. --- components/sceneutil/skeleton.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/components/sceneutil/skeleton.cpp b/components/sceneutil/skeleton.cpp index f7c141e20..49bc5b70f 100644 --- a/components/sceneutil/skeleton.cpp +++ b/components/sceneutil/skeleton.cpp @@ -127,8 +127,6 @@ void Skeleton::updateBoneMatrices(unsigned int traversalNumber) for (unsigned int i=0; imChildren.size(); ++i) mRootBone->mChildren[i]->update(NULL); } - else - std::cerr << "Error: no root bone" << std::endl; mNeedToUpdateBoneMatrices = false; } From 928e2061f7ea04fca85ef4f386fde9f0b639ad2a Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 27 Jan 2017 04:57:14 +0100 Subject: [PATCH 15/17] Remove redundant tolower --- components/resource/niffilemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/resource/niffilemanager.cpp b/components/resource/niffilemanager.cpp index 5076e9d84..dcc222ed1 100644 --- a/components/resource/niffilemanager.cpp +++ b/components/resource/niffilemanager.cpp @@ -49,7 +49,7 @@ namespace Resource return static_cast(obj.get())->mNifFile; else { - Nif::NIFFilePtr file (new Nif::NIFFile(mVFS->getNormalized(name), name)); + Nif::NIFFilePtr file (new Nif::NIFFile(mVFS->get(name), name)); obj = new NifFileHolder(file); mCache->addEntryToObjectCache(name, obj); return file; From 5de5be77f33ea80a7fbb2aeb8a5d68e3c5458361 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 13 Mar 2017 02:42:43 +0100 Subject: [PATCH 16/17] Fix Ptr/ConstPtr userdata mismatch (Bug #3784) --- apps/openmw/mwgui/merchantrepair.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/merchantrepair.cpp b/apps/openmw/mwgui/merchantrepair.cpp index 376fc7152..b96873983 100644 --- a/apps/openmw/mwgui/merchantrepair.cpp +++ b/apps/openmw/mwgui/merchantrepair.cpp @@ -44,10 +44,9 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor) MWWorld::Ptr player = MWMechanics::getPlayer(); int playerGold = player.getClass().getContainerStore(player).count(MWWorld::ContainerStore::sGoldId); - const MWWorld::ContainerStore& store = player.getClass().getContainerStore(player); + MWWorld::ContainerStore& store = player.getClass().getContainerStore(player); int categories = MWWorld::ContainerStore::Type_Weapon | MWWorld::ContainerStore::Type_Armor; - for (MWWorld::ConstContainerStoreIterator iter (store.cbegin(categories)); - iter!=store.cend(); ++iter) + for (MWWorld::ContainerStoreIterator iter (store.begin(categories)); iter!=store.end(); ++iter) { if (iter->getClass().hasItemHealth(*iter)) { From a556475fae2f1d32dbdc86c49eb465e5b60a49bf Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 13 Mar 2017 02:47:52 +0100 Subject: [PATCH 17/17] Explicitely set the user data type to avoid const/non-const mismatch --- apps/openmw/mwgui/alchemywindow.cpp | 6 +++--- apps/openmw/mwgui/enchantingdialog.cpp | 4 ++-- apps/openmw/mwgui/hud.cpp | 4 ++-- apps/openmw/mwgui/itemchargeview.cpp | 2 +- apps/openmw/mwgui/merchantrepair.cpp | 2 +- apps/openmw/mwgui/quickkeysmenu.cpp | 6 +++--- apps/openmw/mwgui/recharge.cpp | 2 +- apps/openmw/mwgui/repair.cpp | 2 +- apps/openmw/mwgui/spellview.cpp | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/openmw/mwgui/alchemywindow.cpp b/apps/openmw/mwgui/alchemywindow.cpp index 385010ac5..1d758cccf 100644 --- a/apps/openmw/mwgui/alchemywindow.cpp +++ b/apps/openmw/mwgui/alchemywindow.cpp @@ -122,7 +122,7 @@ namespace MWGui if (!iter->isEmpty()) { mApparatus.at (index)->setUserString ("ToolTipType", "ItemPtr"); - mApparatus.at (index)->setUserData (*iter); + mApparatus.at (index)->setUserData (MWWorld::Ptr(*iter)); } } @@ -190,9 +190,9 @@ namespace MWGui continue; ingredient->setUserString("ToolTipType", "ItemPtr"); - ingredient->setUserData(item); + ingredient->setUserData(MWWorld::Ptr(item)); - ingredient->setCount(ingredient->getUserData()->getRefData().getCount()); + ingredient->setCount(item.getRefData().getCount()); } mItemView->update(); diff --git a/apps/openmw/mwgui/enchantingdialog.cpp b/apps/openmw/mwgui/enchantingdialog.cpp index c182a0a52..e22891c9d 100644 --- a/apps/openmw/mwgui/enchantingdialog.cpp +++ b/apps/openmw/mwgui/enchantingdialog.cpp @@ -79,7 +79,7 @@ namespace MWGui { mSoulBox->setItem(gem); mSoulBox->setUserString ("ToolTipType", "ItemPtr"); - mSoulBox->setUserData(gem); + mSoulBox->setUserData(MWWorld::Ptr(gem)); mEnchanting.setSoulGem(gem); } } @@ -97,7 +97,7 @@ namespace MWGui mName->setCaption(item.getClass().getName(item)); mItemBox->setItem(item); mItemBox->setUserString ("ToolTipType", "ItemPtr"); - mItemBox->setUserData(item); + mItemBox->setUserData(MWWorld::Ptr(item)); mEnchanting.setOldItem(item); } } diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index b5c8dc8bb..19e032ff4 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -417,7 +417,7 @@ namespace MWGui mSpellStatus->setProgressPosition(chargePercent); mSpellBox->setUserString("ToolTipType", "ItemPtr"); - mSpellBox->setUserData(item); + mSpellBox->setUserData(MWWorld::Ptr(item)); mSpellImage->setItem(item); } @@ -435,7 +435,7 @@ namespace MWGui mWeapBox->clearUserStrings(); mWeapBox->setUserString("ToolTipType", "ItemPtr"); - mWeapBox->setUserData(item); + mWeapBox->setUserData(MWWorld::Ptr(item)); mWeapStatus->setProgressRange(100); mWeapStatus->setProgressPosition(durabilityPercent); diff --git a/apps/openmw/mwgui/itemchargeview.cpp b/apps/openmw/mwgui/itemchargeview.cpp index 522acca26..3001b9ef2 100644 --- a/apps/openmw/mwgui/itemchargeview.cpp +++ b/apps/openmw/mwgui/itemchargeview.cpp @@ -97,7 +97,7 @@ namespace MWGui line.mIcon = mScrollView->createWidget("MW_ItemIconSmall", MyGUI::IntCoord(), MyGUI::Align::Default); line.mIcon->setItem(line.mItemPtr); line.mIcon->setUserString("ToolTipType", "ItemPtr"); - line.mIcon->setUserData(line.mItemPtr); + line.mIcon->setUserData(MWWorld::Ptr(line.mItemPtr)); line.mIcon->eventMouseButtonClick += MyGUI::newDelegate(this, &ItemChargeView::onIconClicked); line.mIcon->eventMouseWheel += MyGUI::newDelegate(this, &ItemChargeView::onMouseWheelMoved); diff --git a/apps/openmw/mwgui/merchantrepair.cpp b/apps/openmw/mwgui/merchantrepair.cpp index b96873983..c4639d602 100644 --- a/apps/openmw/mwgui/merchantrepair.cpp +++ b/apps/openmw/mwgui/merchantrepair.cpp @@ -86,7 +86,7 @@ void MerchantRepair::startRepair(const MWWorld::Ptr &actor) currentY += 18; button->setUserString("Price", MyGUI::utility::toString(price)); - button->setUserData(*iter); + button->setUserData(MWWorld::Ptr(*iter)); button->setCaptionWithReplacing(name); button->setSize(button->getTextSize().width,18); button->eventMouseWheel += MyGUI::newDelegate(this, &MerchantRepair::onMouseWheel); diff --git a/apps/openmw/mwgui/quickkeysmenu.cpp b/apps/openmw/mwgui/quickkeysmenu.cpp index 061ac9eb6..63cc14d98 100644 --- a/apps/openmw/mwgui/quickkeysmenu.cpp +++ b/apps/openmw/mwgui/quickkeysmenu.cpp @@ -185,7 +185,7 @@ namespace MWGui button->setItem(item, ItemWidget::Barter); button->setUserString ("ToolTipType", "ItemPtr"); - button->setUserData(item); + button->setUserData(MWWorld::Ptr(item)); if (mItemSelectionDialog) mItemSelectionDialog->setVisible(false); @@ -209,7 +209,7 @@ namespace MWGui button->setIcon(item); button->setUserString ("ToolTipType", "ItemPtr"); - button->setUserData(item); + button->setUserData(MWWorld::Ptr(item)); if (mMagicSelectionDialog) mMagicSelectionDialog->setVisible(false); @@ -278,7 +278,7 @@ namespace MWGui if (Misc::StringUtils::ciEqual(it->getCellRef().getRefId(), id)) { item = *it; - button->setUserData(item); + button->setUserData(MWWorld::Ptr(item)); break; } } diff --git a/apps/openmw/mwgui/recharge.cpp b/apps/openmw/mwgui/recharge.cpp index 66d29bd59..990e4468b 100644 --- a/apps/openmw/mwgui/recharge.cpp +++ b/apps/openmw/mwgui/recharge.cpp @@ -68,7 +68,7 @@ void Recharge::start (const MWWorld::Ptr &item) { mGemIcon->setItem(item); mGemIcon->setUserString("ToolTipType", "ItemPtr"); - mGemIcon->setUserData(item); + mGemIcon->setUserData(MWWorld::Ptr(item)); updateView(); } diff --git a/apps/openmw/mwgui/repair.cpp b/apps/openmw/mwgui/repair.cpp index 07fd6520c..15a4a64d7 100644 --- a/apps/openmw/mwgui/repair.cpp +++ b/apps/openmw/mwgui/repair.cpp @@ -66,7 +66,7 @@ void Repair::startRepairItem(const MWWorld::Ptr &item) mToolIcon->setItem(item); mToolIcon->setUserString("ToolTipType", "ItemPtr"); - mToolIcon->setUserData(item); + mToolIcon->setUserData(MWWorld::Ptr(item)); updateRepairView(); } diff --git a/apps/openmw/mwgui/spellview.cpp b/apps/openmw/mwgui/spellview.cpp index 06809bb49..9932cddfa 100644 --- a/apps/openmw/mwgui/spellview.cpp +++ b/apps/openmw/mwgui/spellview.cpp @@ -278,7 +278,7 @@ namespace MWGui { if (spell.mType == Spell::Type_EnchantedItem) { - widget->setUserData(spell.mItem); + widget->setUserData(MWWorld::Ptr(spell.mItem)); widget->setUserString("ToolTipType", "ItemPtr"); } else