From 37ea0f3fb9708e49aafa3f23a165d3db3f48d2d4 Mon Sep 17 00:00:00 2001 From: Emanuel Guevel Date: Mon, 12 Aug 2013 15:36:16 +0200 Subject: [PATCH] Display refusal message when weapon/magic icons are clicked as werewolf --- apps/openmw/mwgui/hud.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/openmw/mwgui/hud.cpp b/apps/openmw/mwgui/hud.cpp index 9c737e5e4..f9d31bdcd 100644 --- a/apps/openmw/mwgui/hud.cpp +++ b/apps/openmw/mwgui/hud.cpp @@ -317,11 +317,25 @@ namespace MWGui void HUD::onWeaponClicked(MyGUI::Widget* _sender) { + const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); + if (MWWorld::Class::get(player).getNpcStats(player).isWerewolf()) + { + MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}"); + return; + } + MWBase::Environment::get().getWindowManager()->toggleVisible(GW_Inventory); } void HUD::onMagicClicked(MyGUI::Widget* _sender) { + const MWWorld::Ptr& player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer(); + if (MWWorld::Class::get(player).getNpcStats(player).isWerewolf()) + { + MWBase::Environment::get().getWindowManager()->messageBox("#{sWerewolfRefusal}"); + return; + } + MWBase::Environment::get().getWindowManager()->toggleVisible(GW_Magic); }