forked from teamnwah/openmw-tes3coop
parent
d5dd864404
commit
04964595ef
8 changed files with 13 additions and 30 deletions
|
@ -325,7 +325,6 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
store.setSelectedEnchantItem(it);
|
store.setSelectedEnchantItem(it);
|
||||||
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -322,7 +322,6 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
|
|
||||||
store.setSelectedEnchantItem(it);
|
store.setSelectedEnchantItem(it);
|
||||||
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item);
|
|
||||||
|
|
||||||
updateSpells();
|
updateSpells();
|
||||||
}
|
}
|
||||||
|
|
|
@ -740,10 +740,6 @@ bool CharacterController::updateWeaponState()
|
||||||
MWBase::Environment::get().getWindowManager()->messageBox(resultMessage);
|
MWBase::Environment::get().getWindowManager()->messageBox(resultMessage);
|
||||||
if(!resultSound.empty())
|
if(!resultSound.empty())
|
||||||
MWBase::Environment::get().getSoundManager()->playSound(resultSound, 1.0f, 1.0f);
|
MWBase::Environment::get().getSoundManager()->playSound(resultSound, 1.0f, 1.0f);
|
||||||
|
|
||||||
// Set again, just to update the charge bar
|
|
||||||
if(item.getRefData().getCount())
|
|
||||||
MWBase::Environment::get().getWindowManager()->setSelectedWeapon(item);
|
|
||||||
}
|
}
|
||||||
else if (ammunition)
|
else if (ammunition)
|
||||||
{
|
{
|
||||||
|
|
|
@ -325,6 +325,19 @@ namespace MWMechanics
|
||||||
winMgr->updateSkillArea();
|
winMgr->updateSkillArea();
|
||||||
|
|
||||||
winMgr->setValue("level", stats.getLevel());
|
winMgr->setValue("level", stats.getLevel());
|
||||||
|
|
||||||
|
// Update the equipped weapon icon
|
||||||
|
MWWorld::InventoryStore& inv = mWatched.getClass().getInventoryStore(mWatched);
|
||||||
|
MWWorld::ContainerStoreIterator weapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
||||||
|
if (weapon == inv.end())
|
||||||
|
winMgr->unsetSelectedWeapon();
|
||||||
|
else
|
||||||
|
winMgr->setSelectedWeapon(*weapon);
|
||||||
|
|
||||||
|
// Update the selected spell icon
|
||||||
|
MWWorld::ContainerStoreIterator enchantItem = inv.getSelectedEnchantItem();
|
||||||
|
if (enchantItem != inv.end())
|
||||||
|
winMgr->setSelectedEnchantItem(*enchantItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mUpdatePlayer)
|
if (mUpdatePlayer)
|
||||||
|
|
|
@ -575,7 +575,6 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
if (mCaster.getRefData().getHandle() == "player")
|
if (mCaster.getRefData().getHandle() == "player")
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item); // Set again to show the modified charge
|
|
||||||
mCaster.getClass().skillUsageSucceeded (mCaster, ESM::Skill::Enchant, 3);
|
mCaster.getClass().skillUsageSucceeded (mCaster, ESM::Skill::Enchant, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,13 +335,6 @@ void MWState::StateManager::loadGame (const Character *character, const Slot *sl
|
||||||
|
|
||||||
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
|
||||||
//Update the weapon icon in the hud with whatever the player is currently holding.
|
|
||||||
MWWorld::InventoryStore& invStore = ptr.getClass().getInventoryStore(ptr);
|
|
||||||
MWWorld::ContainerStoreIterator item = invStore.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
|
|
||||||
|
|
||||||
if (item != invStore.end())
|
|
||||||
MWBase::Environment::get().getWindowManager()->setSelectedWeapon(*item);
|
|
||||||
|
|
||||||
ESM::CellId cellId = ptr.getCell()->getCell()->getCellId();
|
ESM::CellId cellId = ptr.getCell()->getCell()->getCellId();
|
||||||
|
|
||||||
MWBase::Environment::get().getWorld()->changeToCell (cellId, ptr.getRefData().getPosition());
|
MWBase::Environment::get().getWorld()->changeToCell (cellId, ptr.getRefData().getPosition());
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
#include "../mwbase/windowmanager.hpp"
|
|
||||||
#include "../mwbase/mechanicsmanager.hpp"
|
#include "../mwbase/mechanicsmanager.hpp"
|
||||||
|
|
||||||
#include "../mwmechanics/npcstats.hpp"
|
#include "../mwmechanics/npcstats.hpp"
|
||||||
|
@ -150,10 +149,6 @@ void MWWorld::InventoryStore::equip (int slot, const ContainerStoreIterator& ite
|
||||||
|
|
||||||
fireEquipmentChangedEvent();
|
fireEquipmentChangedEvent();
|
||||||
updateMagicEffects(actor);
|
updateMagicEffects(actor);
|
||||||
|
|
||||||
// Update HUD icon for player weapon
|
|
||||||
if (slot == MWWorld::InventoryStore::Slot_CarriedRight)
|
|
||||||
MWBase::Environment::get().getWindowManager()->setSelectedWeapon(*getSlot(slot));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWWorld::InventoryStore::unequipAll(const MWWorld::Ptr& actor)
|
void MWWorld::InventoryStore::unequipAll(const MWWorld::Ptr& actor)
|
||||||
|
@ -494,7 +489,6 @@ int MWWorld::InventoryStore::remove(const Ptr& item, int count, const Ptr& actor
|
||||||
&& *mSelectedEnchantItem == item && actor.getRefData().getHandle() == "player")
|
&& *mSelectedEnchantItem == item && actor.getRefData().getHandle() == "player")
|
||||||
{
|
{
|
||||||
mSelectedEnchantItem = end();
|
mSelectedEnchantItem = end();
|
||||||
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateRechargingItems();
|
updateRechargingItems();
|
||||||
|
@ -532,18 +526,9 @@ MWWorld::ContainerStoreIterator MWWorld::InventoryStore::unequipSlot(int slot, c
|
||||||
if (script != "")
|
if (script != "")
|
||||||
(*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0);
|
(*it).getRefData().getLocals().setVarByInt(script, "onpcequip", 0);
|
||||||
|
|
||||||
// Update HUD icon when removing player weapon or selected enchanted item.
|
|
||||||
// We have to check for both as the weapon could also be the enchanted item.
|
|
||||||
if (slot == MWWorld::InventoryStore::Slot_CarriedRight)
|
|
||||||
{
|
|
||||||
// weapon
|
|
||||||
MWBase::Environment::get().getWindowManager()->unsetSelectedWeapon();
|
|
||||||
}
|
|
||||||
if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it))
|
if ((mSelectedEnchantItem != end()) && (mSelectedEnchantItem == it))
|
||||||
{
|
{
|
||||||
// enchanted item
|
|
||||||
mSelectedEnchantItem = end();
|
mSelectedEnchantItem = end();
|
||||||
MWBase::Environment::get().getWindowManager()->unsetSelectedSpell();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2056,7 +2056,6 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
// Update the GUI only when called on the player
|
// Update the GUI only when called on the player
|
||||||
MWBase::WindowManager* windowManager = MWBase::Environment::get().getWindowManager();
|
MWBase::WindowManager* windowManager = MWBase::Environment::get().getWindowManager();
|
||||||
windowManager->unsetSelectedWeapon();
|
|
||||||
|
|
||||||
if (werewolf)
|
if (werewolf)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue