mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:19:40 +00:00
and go
This commit is contained in:
parent
f45a6b71a9
commit
9d7c35ae48
20 changed files with 375 additions and 31 deletions
|
@ -29,7 +29,7 @@ add_openmw_dir (mwgui
|
||||||
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
|
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
|
||||||
formatting inventorywindow container hud countdialog tradewindow settingswindow
|
formatting inventorywindow container hud countdialog tradewindow settingswindow
|
||||||
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
|
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
|
||||||
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog
|
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
|
||||||
)
|
)
|
||||||
|
|
||||||
add_openmw_dir (mwdialogue
|
add_openmw_dir (mwdialogue
|
||||||
|
|
|
@ -226,6 +226,8 @@ namespace MWBase
|
||||||
virtual bool getRestEnabled() = 0;
|
virtual bool getRestEnabled() = 0;
|
||||||
|
|
||||||
virtual bool getPlayerSleeping() = 0;
|
virtual bool getPlayerSleeping() = 0;
|
||||||
|
|
||||||
|
virtual void startSpellMaking(MWWorld::Ptr actor) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -145,16 +145,17 @@ namespace
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
namespace MWDialogue
|
|
||||||
{
|
|
||||||
|
|
||||||
//helper function
|
//helper function
|
||||||
std::string::size_type find_str_ci(const std::string& str, const std::string& substr,size_t pos)
|
std::string::size_type find_str_ci(const std::string& str, const std::string& substr,size_t pos)
|
||||||
{
|
{
|
||||||
return toLower(str).find(toLower(substr),pos);
|
return toLower(str).find(toLower(substr),pos);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace MWDialogue
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
bool DialogueManager::functionFilter(const MWWorld::Ptr& actor, const ESM::DialInfo& info,bool choice)
|
bool DialogueManager::functionFilter(const MWWorld::Ptr& actor, const ESM::DialInfo& info,bool choice)
|
||||||
{
|
{
|
||||||
|
@ -779,6 +780,8 @@ namespace MWDialogue
|
||||||
services = ref->base->mAiData.mServices;
|
services = ref->base->mAiData.mServices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int windowServices = 0;
|
||||||
|
|
||||||
if (services & ESM::NPC::Weapon
|
if (services & ESM::NPC::Weapon
|
||||||
|| services & ESM::NPC::Armor
|
|| services & ESM::NPC::Armor
|
||||||
|| services & ESM::NPC::Clothing
|
|| services & ESM::NPC::Clothing
|
||||||
|
@ -790,14 +793,15 @@ namespace MWDialogue
|
||||||
|| services & ESM::NPC::Apparatus
|
|| services & ESM::NPC::Apparatus
|
||||||
|| services & ESM::NPC::RepairItem
|
|| services & ESM::NPC::RepairItem
|
||||||
|| services & ESM::NPC::Misc)
|
|| services & ESM::NPC::Misc)
|
||||||
win->setShowTrade(true);
|
windowServices |= MWGui::DialogueWindow::Service_Trade;
|
||||||
else
|
|
||||||
win->setShowTrade(false);
|
|
||||||
|
|
||||||
if (services & ESM::NPC::Spells)
|
if (services & ESM::NPC::Spells)
|
||||||
win->setShowSpells(true);
|
windowServices |= MWGui::DialogueWindow::Service_BuySpells;
|
||||||
else
|
|
||||||
win->setShowSpells(false);
|
if (services & ESM::NPC::Spellmaking)
|
||||||
|
windowServices |= MWGui::DialogueWindow::Service_CreateSpells;
|
||||||
|
|
||||||
|
win->setServices (windowServices);
|
||||||
|
|
||||||
// sort again, because the previous sort was case-sensitive
|
// sort again, because the previous sort was case-sensitive
|
||||||
keywordList.sort(stringCompareNoCase);
|
keywordList.sort(stringCompareNoCase);
|
||||||
|
|
|
@ -27,6 +27,8 @@ using namespace Widgets;
|
||||||
*Copied from the internet.
|
*Copied from the internet.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
|
||||||
std::string lower_string(const std::string& str)
|
std::string lower_string(const std::string& str)
|
||||||
{
|
{
|
||||||
std::string lowerCase;
|
std::string lowerCase;
|
||||||
|
@ -42,12 +44,13 @@ std::string::size_type find_str_ci(const std::string& str, const std::string& su
|
||||||
return lower_string(str).find(lower_string(substr),pos);
|
return lower_string(str).find(lower_string(substr),pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DialogueWindow::DialogueWindow(MWBase::WindowManager& parWindowManager)
|
DialogueWindow::DialogueWindow(MWBase::WindowManager& parWindowManager)
|
||||||
: WindowBase("openmw_dialogue_window.layout", parWindowManager)
|
: WindowBase("openmw_dialogue_window.layout", parWindowManager)
|
||||||
, mEnabled(true)
|
, mEnabled(true)
|
||||||
, mShowTrade(false)
|
, mServices(0)
|
||||||
, mShowSpells(false)
|
|
||||||
{
|
{
|
||||||
// Centre dialog
|
// Centre dialog
|
||||||
center();
|
center();
|
||||||
|
@ -134,7 +137,11 @@ void DialogueWindow::onSelectTopic(std::string topic)
|
||||||
mWindowManager.pushGuiMode(GM_SpellBuying);
|
mWindowManager.pushGuiMode(GM_SpellBuying);
|
||||||
mWindowManager.getSpellBuyingWindow()->startSpellBuying(mPtr);
|
mWindowManager.getSpellBuyingWindow()->startSpellBuying(mPtr);
|
||||||
}
|
}
|
||||||
|
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpellMakingMenuTitle")->str)
|
||||||
|
{
|
||||||
|
mWindowManager.pushGuiMode(GM_SpellCreation);
|
||||||
|
mWindowManager.startSpellMaking (mPtr);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
MWBase::Environment::get().getDialogueManager()->keywordSelected(lower_string(topic));
|
MWBase::Environment::get().getDialogueManager()->keywordSelected(lower_string(topic));
|
||||||
}
|
}
|
||||||
|
@ -155,14 +162,17 @@ void DialogueWindow::setKeywords(std::list<std::string> keyWords)
|
||||||
{
|
{
|
||||||
mTopicsList->clear();
|
mTopicsList->clear();
|
||||||
|
|
||||||
bool anyService = mShowTrade||mShowSpells;
|
bool anyService = mServices > 0;
|
||||||
|
|
||||||
if (mShowTrade)
|
if (mServices & Service_Trade)
|
||||||
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarter")->str);
|
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sBarter")->str);
|
||||||
|
|
||||||
if (mShowSpells)
|
if (mServices & Service_BuySpells)
|
||||||
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpells")->str);
|
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpells")->str);
|
||||||
|
|
||||||
|
if (mServices & Service_CreateSpells)
|
||||||
|
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.search("sSpellmakingMenuTitle")->str);
|
||||||
|
|
||||||
if (anyService)
|
if (anyService)
|
||||||
mTopicsList->addSeparator();
|
mTopicsList->addSeparator();
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,14 @@ namespace MWGui
|
||||||
|
|
||||||
// various service button visibilities, depending if the npc/creature talked to has these services
|
// various service button visibilities, depending if the npc/creature talked to has these services
|
||||||
// make sure to call these before setKeywords()
|
// make sure to call these before setKeywords()
|
||||||
void setShowTrade(bool show) { mShowTrade = show; }
|
void setServices(int services) { mServices = services; }
|
||||||
void setShowSpells(bool show) { mShowSpells = show; }
|
|
||||||
|
enum Services
|
||||||
|
{
|
||||||
|
Service_Trade = 0x01,
|
||||||
|
Service_BuySpells = 0x02,
|
||||||
|
Service_CreateSpells = 0x04
|
||||||
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onSelectTopic(std::string topic);
|
void onSelectTopic(std::string topic);
|
||||||
|
@ -73,6 +79,8 @@ namespace MWGui
|
||||||
bool mShowTrade;
|
bool mShowTrade;
|
||||||
bool mShowSpells;
|
bool mShowSpells;
|
||||||
|
|
||||||
|
int mServices;
|
||||||
|
|
||||||
bool mEnabled;
|
bool mEnabled;
|
||||||
|
|
||||||
DialogueHistory* mHistory;
|
DialogueHistory* mHistory;
|
||||||
|
|
|
@ -129,3 +129,8 @@ void MWList::onItemSelected(MyGUI::Widget* _sender)
|
||||||
|
|
||||||
eventItemSelected(name);
|
eventItemSelected(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MyGUI::Widget* MWList::getItemWidget(const std::string& name)
|
||||||
|
{
|
||||||
|
return mScrollView->findWidget (getName() + "_item_" + name);
|
||||||
|
}
|
||||||
|
|
|
@ -38,6 +38,9 @@ namespace MWGui
|
||||||
std::string getItemNameAt(unsigned int at); ///< \attention if there are separators, this method will return "" at the place where the separator is
|
std::string getItemNameAt(unsigned int at); ///< \attention if there are separators, this method will return "" at the place where the separator is
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
|
MyGUI::Widget* getItemWidget(const std::string& name);
|
||||||
|
///< get widget for an item name, useful to set up tooltip
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void initialiseOverride();
|
void initialiseOverride();
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ namespace MWGui
|
||||||
GM_Rest,
|
GM_Rest,
|
||||||
GM_RestBed,
|
GM_RestBed,
|
||||||
GM_SpellBuying,
|
GM_SpellBuying,
|
||||||
|
GM_SpellCreation,
|
||||||
|
|
||||||
GM_Levelup,
|
GM_Levelup,
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ namespace MWGui
|
||||||
|
|
||||||
SpellBuyingWindow::SpellBuyingWindow(MWBase::WindowManager& parWindowManager) :
|
SpellBuyingWindow::SpellBuyingWindow(MWBase::WindowManager& parWindowManager) :
|
||||||
WindowBase("openmw_spell_buying_window.layout", parWindowManager)
|
WindowBase("openmw_spell_buying_window.layout", parWindowManager)
|
||||||
, ContainerBase(NULL) // no drag&drop
|
|
||||||
, mCurrentY(0)
|
, mCurrentY(0)
|
||||||
, mLastPos(0)
|
, mLastPos(0)
|
||||||
{
|
{
|
||||||
|
@ -77,7 +76,7 @@ namespace MWGui
|
||||||
void SpellBuyingWindow::startSpellBuying(const MWWorld::Ptr& actor)
|
void SpellBuyingWindow::startSpellBuying(const MWWorld::Ptr& actor)
|
||||||
{
|
{
|
||||||
center();
|
center();
|
||||||
mActor = actor;
|
mPtr = actor;
|
||||||
clearSpells();
|
clearSpells();
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
|
@ -114,7 +113,7 @@ namespace MWGui
|
||||||
MWMechanics::Spells& spells = stats.getSpells();
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
spells.add (mSpellsWidgetMap.find(_sender)->second);
|
spells.add (mSpellsWidgetMap.find(_sender)->second);
|
||||||
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
|
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
|
||||||
startSpellBuying(mActor);
|
startSpellBuying(mPtr);
|
||||||
|
|
||||||
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
#ifndef MWGUI_SpellBuyingWINDOW_H
|
#ifndef MWGUI_SpellBuyingWINDOW_H
|
||||||
#define MWGUI_SpellBuyingWINDOW_H
|
#define MWGUI_SpellBuyingWINDOW_H
|
||||||
|
|
||||||
#include "container.hpp"
|
|
||||||
#include "window_base.hpp"
|
#include "window_base.hpp"
|
||||||
|
#include "referenceinterface.hpp"
|
||||||
#include "../mwworld/ptr.hpp"
|
|
||||||
|
|
||||||
namespace MyGUI
|
namespace MyGUI
|
||||||
{
|
{
|
||||||
|
@ -20,7 +18,7 @@ namespace MWGui
|
||||||
|
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
class SpellBuyingWindow : public ContainerBase, public WindowBase
|
class SpellBuyingWindow : public ReferenceInterface, public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SpellBuyingWindow(MWBase::WindowManager& parWindowManager);
|
SpellBuyingWindow(MWBase::WindowManager& parWindowManager);
|
||||||
|
@ -35,8 +33,6 @@ namespace MWGui
|
||||||
|
|
||||||
MyGUI::ScrollView* mSpellsView;
|
MyGUI::ScrollView* mSpellsView;
|
||||||
|
|
||||||
MWWorld::Ptr mActor;
|
|
||||||
|
|
||||||
std::map<MyGUI::Widget*, std::string> mSpellsWidgetMap;
|
std::map<MyGUI::Widget*, std::string> mSpellsWidgetMap;
|
||||||
|
|
||||||
void onCancelButtonClicked(MyGUI::Widget* _sender);
|
void onCancelButtonClicked(MyGUI::Widget* _sender);
|
||||||
|
|
120
apps/openmw/mwgui/spellcreationdialog.cpp
Normal file
120
apps/openmw/mwgui/spellcreationdialog.cpp
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
#include "spellcreationdialog.hpp"
|
||||||
|
|
||||||
|
#include <components/esm_store/store.hpp>
|
||||||
|
|
||||||
|
#include "../mwbase/windowmanager.hpp"
|
||||||
|
|
||||||
|
#include "../mwbase/world.hpp"
|
||||||
|
#include "../mwbase/environment.hpp"
|
||||||
|
|
||||||
|
#include "../mwworld/player.hpp"
|
||||||
|
#include "../mwworld/class.hpp"
|
||||||
|
|
||||||
|
#include "../mwmechanics/spells.hpp"
|
||||||
|
#include "../mwmechanics/creaturestats.hpp"
|
||||||
|
|
||||||
|
#include "tooltips.hpp"
|
||||||
|
#include "widgets.hpp"
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
|
||||||
|
bool sortMagicEffects (short id1, short id2)
|
||||||
|
{
|
||||||
|
return MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(MWGui::Widgets::MWSpellEffect::effectIDToString (id1))->getString()
|
||||||
|
< MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(MWGui::Widgets::MWSpellEffect::effectIDToString (id2))->getString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace MWGui
|
||||||
|
{
|
||||||
|
|
||||||
|
SpellCreationDialog::SpellCreationDialog(MWBase::WindowManager &parWindowManager)
|
||||||
|
: WindowBase("openmw_spellcreation_dialog.layout", parWindowManager)
|
||||||
|
{
|
||||||
|
getWidget(mNameEdit, "NameEdit");
|
||||||
|
getWidget(mMagickaCost, "MagickaCost");
|
||||||
|
getWidget(mSuccessChance, "SuccessChance");
|
||||||
|
getWidget(mAvailableEffectsList, "AvailableEffects");
|
||||||
|
getWidget(mUsedEffectsView, "UsedEffects");
|
||||||
|
getWidget(mPriceLabel, "PriceLabel");
|
||||||
|
getWidget(mBuyButton, "BuyButton");
|
||||||
|
getWidget(mCancelButton, "CancelButton");
|
||||||
|
|
||||||
|
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellCreationDialog::onCancelButtonClicked);
|
||||||
|
mBuyButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellCreationDialog::onBuyButtonClicked);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SpellCreationDialog::open()
|
||||||
|
{
|
||||||
|
center();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpellCreationDialog::onReferenceUnavailable ()
|
||||||
|
{
|
||||||
|
mWindowManager.removeGuiMode (GM_Dialogue);
|
||||||
|
mWindowManager.removeGuiMode (GM_SpellCreation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpellCreationDialog::startSpellMaking (MWWorld::Ptr actor)
|
||||||
|
{
|
||||||
|
mPtr = actor;
|
||||||
|
|
||||||
|
// get the list of magic effects that are known to the player
|
||||||
|
|
||||||
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
|
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
|
||||||
|
MWMechanics::Spells& spells = stats.getSpells();
|
||||||
|
|
||||||
|
std::vector<short> knownEffects;
|
||||||
|
|
||||||
|
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
|
||||||
|
{
|
||||||
|
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().spells.find(*it);
|
||||||
|
|
||||||
|
// only normal spells count
|
||||||
|
if (spell->data.type != ESM::Spell::ST_Spell)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const std::vector<ESM::ENAMstruct>& list = spell->effects.list;
|
||||||
|
for (std::vector<ESM::ENAMstruct>::const_iterator it2 = list.begin(); it2 != list.end(); ++it2)
|
||||||
|
{
|
||||||
|
if (std::find(knownEffects.begin(), knownEffects.end(), it2->effectID) == knownEffects.end())
|
||||||
|
knownEffects.push_back(it2->effectID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::sort(knownEffects.begin(), knownEffects.end(), sortMagicEffects);
|
||||||
|
|
||||||
|
mAvailableEffectsList->clear ();
|
||||||
|
|
||||||
|
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
|
||||||
|
{
|
||||||
|
mAvailableEffectsList->addItem(MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(
|
||||||
|
MWGui::Widgets::MWSpellEffect::effectIDToString (*it))->getString());
|
||||||
|
}
|
||||||
|
mAvailableEffectsList->adjustSize ();
|
||||||
|
|
||||||
|
for (std::vector<short>::const_iterator it = knownEffects.begin(); it != knownEffects.end(); ++it)
|
||||||
|
{
|
||||||
|
std::string name = MWBase::Environment::get().getWorld ()->getStore ().gameSettings.find(
|
||||||
|
MWGui::Widgets::MWSpellEffect::effectIDToString (*it))->getString();
|
||||||
|
MyGUI::Widget* w = mAvailableEffectsList->getItemWidget(name);
|
||||||
|
|
||||||
|
ToolTips::createMagicEffectToolTip (w, *it);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpellCreationDialog::onCancelButtonClicked (MyGUI::Widget* sender)
|
||||||
|
{
|
||||||
|
mWindowManager.removeGuiMode (MWGui::GM_SpellCreation);
|
||||||
|
}
|
||||||
|
|
||||||
|
void SpellCreationDialog::onBuyButtonClicked (MyGUI::Widget* sender)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
40
apps/openmw/mwgui/spellcreationdialog.hpp
Normal file
40
apps/openmw/mwgui/spellcreationdialog.hpp
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
#ifndef MWGUI_SPELLCREATION_H
|
||||||
|
#define MWGUI_SPELLCREATION_H
|
||||||
|
|
||||||
|
#include "window_base.hpp"
|
||||||
|
#include "referenceinterface.hpp"
|
||||||
|
#include "list.hpp"
|
||||||
|
|
||||||
|
namespace MWGui
|
||||||
|
{
|
||||||
|
|
||||||
|
class SpellCreationDialog : public WindowBase, public ReferenceInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
SpellCreationDialog(MWBase::WindowManager& parWindowManager);
|
||||||
|
|
||||||
|
virtual void open();
|
||||||
|
|
||||||
|
void startSpellMaking(MWWorld::Ptr actor);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void onReferenceUnavailable ();
|
||||||
|
|
||||||
|
void onCancelButtonClicked (MyGUI::Widget* sender);
|
||||||
|
void onBuyButtonClicked (MyGUI::Widget* sender);
|
||||||
|
|
||||||
|
|
||||||
|
MyGUI::EditBox* mNameEdit;
|
||||||
|
MyGUI::TextBox* mMagickaCost;
|
||||||
|
MyGUI::TextBox* mSuccessChance;
|
||||||
|
Widgets::MWList* mAvailableEffectsList;
|
||||||
|
MyGUI::ScrollView* mUsedEffectsView;
|
||||||
|
MyGUI::Button* mBuyButton;
|
||||||
|
MyGUI::Button* mCancelButton;
|
||||||
|
MyGUI::TextBox* mPriceLabel;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -586,8 +586,6 @@ void ToolTips::createSkillToolTip(MyGUI::Widget* widget, int skillId)
|
||||||
widget->setUserString("Caption_SkillNoProgressDescription", skill->description);
|
widget->setUserString("Caption_SkillNoProgressDescription", skill->description);
|
||||||
widget->setUserString("Caption_SkillNoProgressAttribute", "#{sGoverningAttribute}: #{" + attr->name + "}");
|
widget->setUserString("Caption_SkillNoProgressAttribute", "#{sGoverningAttribute}: #{" + attr->name + "}");
|
||||||
widget->setUserString("ImageTexture_SkillNoProgressImage", icon);
|
widget->setUserString("ImageTexture_SkillNoProgressImage", icon);
|
||||||
widget->setUserString("ToolTipLayout", "SkillNoProgressToolTip");
|
|
||||||
widget->setUserString("ToolTipLayout", "SkillNoProgressToolTip");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolTips::createAttributeToolTip(MyGUI::Widget* widget, int attributeId)
|
void ToolTips::createAttributeToolTip(MyGUI::Widget* widget, int attributeId)
|
||||||
|
@ -713,6 +711,38 @@ void ToolTips::createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playe
|
||||||
widget->setUserString("ToolTipLayout", "ClassToolTip");
|
widget->setUserString("ToolTipLayout", "ClassToolTip");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ToolTips::createMagicEffectToolTip(MyGUI::Widget* widget, short id)
|
||||||
|
{
|
||||||
|
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld ()->getStore ().magicEffects.find(id);
|
||||||
|
const std::string &name = Widgets::MWSpellEffect::effectIDToString (id);
|
||||||
|
|
||||||
|
std::string icon = effect->icon;
|
||||||
|
|
||||||
|
int slashPos = icon.find("\\");
|
||||||
|
icon.insert(slashPos+1, "b_");
|
||||||
|
|
||||||
|
icon[icon.size()-3] = 'd';
|
||||||
|
icon[icon.size()-2] = 'd';
|
||||||
|
icon[icon.size()-1] = 's';
|
||||||
|
|
||||||
|
icon = "icons\\" + icon;
|
||||||
|
|
||||||
|
std::vector<std::string> schools;
|
||||||
|
schools.push_back ("#{sSchoolAlteration}");
|
||||||
|
schools.push_back ("#{sSchoolConjuration}");
|
||||||
|
schools.push_back ("#{sSchoolDestruction}");
|
||||||
|
schools.push_back ("#{sSchoolIllusion}");
|
||||||
|
schools.push_back ("#{sSchoolMysticism}");
|
||||||
|
schools.push_back ("#{sSchoolRestoration}");
|
||||||
|
|
||||||
|
widget->setUserString("ToolTipType", "Layout");
|
||||||
|
widget->setUserString("ToolTipLayout", "MagicEffectToolTip");
|
||||||
|
widget->setUserString("Caption_MagicEffectName", "#{" + name + "}");
|
||||||
|
widget->setUserString("Caption_MagicEffectDescription", effect->description);
|
||||||
|
widget->setUserString("Caption_MagicEffectSchool", "#{sSchool}: " + schools[effect->data.school]);
|
||||||
|
widget->setUserString("ImageTexture_MagicEffectImage", icon);
|
||||||
|
}
|
||||||
|
|
||||||
void ToolTips::setDelay(float delay)
|
void ToolTips::setDelay(float delay)
|
||||||
{
|
{
|
||||||
mDelay = delay;
|
mDelay = delay;
|
||||||
|
|
|
@ -71,6 +71,7 @@ namespace MWGui
|
||||||
static void createBirthsignToolTip(MyGUI::Widget* widget, const std::string& birthsignId);
|
static void createBirthsignToolTip(MyGUI::Widget* widget, const std::string& birthsignId);
|
||||||
static void createRaceToolTip(MyGUI::Widget* widget, const ESM::Race* playerRace);
|
static void createRaceToolTip(MyGUI::Widget* widget, const ESM::Race* playerRace);
|
||||||
static void createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass);
|
static void createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass);
|
||||||
|
static void createMagicEffectToolTip(MyGUI::Widget* widget, short id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::Widget* mDynamicToolTipBox;
|
MyGUI::Widget* mDynamicToolTipBox;
|
||||||
|
|
|
@ -249,7 +249,7 @@ namespace MWGui
|
||||||
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
||||||
void setSpellEffect(const SpellEffectParams& params);
|
void setSpellEffect(const SpellEffectParams& params);
|
||||||
|
|
||||||
std::string effectIDToString(const short effectID);
|
static std::string effectIDToString(const short effectID);
|
||||||
bool effectHasMagnitude (const std::string& effect);
|
bool effectHasMagnitude (const std::string& effect);
|
||||||
bool effectHasDuration (const std::string& effect);
|
bool effectHasDuration (const std::string& effect);
|
||||||
bool effectInvolvesAttribute (const std::string& effect);
|
bool effectInvolvesAttribute (const std::string& effect);
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "loadingscreen.hpp"
|
#include "loadingscreen.hpp"
|
||||||
#include "levelupdialog.hpp"
|
#include "levelupdialog.hpp"
|
||||||
#include "waitdialog.hpp"
|
#include "waitdialog.hpp"
|
||||||
|
#include "spellcreationdialog.hpp"
|
||||||
|
|
||||||
using namespace MWGui;
|
using namespace MWGui;
|
||||||
|
|
||||||
|
@ -75,6 +76,7 @@ WindowManager::WindowManager(
|
||||||
, mCharGen(NULL)
|
, mCharGen(NULL)
|
||||||
, mLevelupDialog(NULL)
|
, mLevelupDialog(NULL)
|
||||||
, mWaitDialog(NULL)
|
, mWaitDialog(NULL)
|
||||||
|
, mSpellCreationDialog(NULL)
|
||||||
, mPlayerClass()
|
, mPlayerClass()
|
||||||
, mPlayerName()
|
, mPlayerName()
|
||||||
, mPlayerRaceId()
|
, mPlayerRaceId()
|
||||||
|
@ -155,6 +157,7 @@ WindowManager::WindowManager(
|
||||||
mQuickKeysMenu = new QuickKeysMenu(*this);
|
mQuickKeysMenu = new QuickKeysMenu(*this);
|
||||||
mLevelupDialog = new LevelupDialog(*this);
|
mLevelupDialog = new LevelupDialog(*this);
|
||||||
mWaitDialog = new WaitDialog(*this);
|
mWaitDialog = new WaitDialog(*this);
|
||||||
|
mSpellCreationDialog = new SpellCreationDialog(*this);
|
||||||
|
|
||||||
mLoadingScreen = new LoadingScreen(mOgre->getScene (), mOgre->getWindow (), *this);
|
mLoadingScreen = new LoadingScreen(mOgre->getScene (), mOgre->getWindow (), *this);
|
||||||
mLoadingScreen->onResChange (w,h);
|
mLoadingScreen->onResChange (w,h);
|
||||||
|
@ -210,6 +213,7 @@ WindowManager::~WindowManager()
|
||||||
delete mLoadingScreen;
|
delete mLoadingScreen;
|
||||||
delete mLevelupDialog;
|
delete mLevelupDialog;
|
||||||
delete mWaitDialog;
|
delete mWaitDialog;
|
||||||
|
delete mSpellCreationDialog;
|
||||||
|
|
||||||
cleanupGarbage();
|
cleanupGarbage();
|
||||||
|
|
||||||
|
@ -259,6 +263,7 @@ void WindowManager::updateVisible()
|
||||||
mQuickKeysMenu->setVisible(false);
|
mQuickKeysMenu->setVisible(false);
|
||||||
mLevelupDialog->setVisible(false);
|
mLevelupDialog->setVisible(false);
|
||||||
mWaitDialog->setVisible(false);
|
mWaitDialog->setVisible(false);
|
||||||
|
mSpellCreationDialog->setVisible(false);
|
||||||
|
|
||||||
mHud->setVisible(true);
|
mHud->setVisible(true);
|
||||||
|
|
||||||
|
@ -359,6 +364,9 @@ void WindowManager::updateVisible()
|
||||||
case GM_SpellBuying:
|
case GM_SpellBuying:
|
||||||
mSpellBuyingWindow->setVisible(true);
|
mSpellBuyingWindow->setVisible(true);
|
||||||
break;
|
break;
|
||||||
|
case GM_SpellCreation:
|
||||||
|
mSpellCreationDialog->setVisible(true);
|
||||||
|
break;
|
||||||
case GM_InterMessageBox:
|
case GM_InterMessageBox:
|
||||||
break;
|
break;
|
||||||
case GM_Journal:
|
case GM_Journal:
|
||||||
|
@ -561,6 +569,7 @@ void WindowManager::onFrame (float frameDuration)
|
||||||
mDialogueWindow->checkReferenceAvailable();
|
mDialogueWindow->checkReferenceAvailable();
|
||||||
mTradeWindow->checkReferenceAvailable();
|
mTradeWindow->checkReferenceAvailable();
|
||||||
mSpellBuyingWindow->checkReferenceAvailable();
|
mSpellBuyingWindow->checkReferenceAvailable();
|
||||||
|
mSpellCreationDialog->checkReferenceAvailable();
|
||||||
mContainerWindow->checkReferenceAvailable();
|
mContainerWindow->checkReferenceAvailable();
|
||||||
mConsole->checkReferenceAvailable();
|
mConsole->checkReferenceAvailable();
|
||||||
}
|
}
|
||||||
|
@ -960,3 +969,8 @@ void WindowManager::addVisitedLocation(const std::string& name, int x, int y)
|
||||||
{
|
{
|
||||||
mMap->addVisitedLocation (name, x, y);
|
mMap->addVisitedLocation (name, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowManager::startSpellMaking(MWWorld::Ptr actor)
|
||||||
|
{
|
||||||
|
mSpellCreationDialog->startSpellMaking (actor);
|
||||||
|
}
|
||||||
|
|
|
@ -64,6 +64,8 @@ namespace MWGui
|
||||||
class LoadingScreen;
|
class LoadingScreen;
|
||||||
class LevelupDialog;
|
class LevelupDialog;
|
||||||
class WaitDialog;
|
class WaitDialog;
|
||||||
|
class SpellCreationDialog;
|
||||||
|
|
||||||
|
|
||||||
class WindowManager : public MWBase::WindowManager
|
class WindowManager : public MWBase::WindowManager
|
||||||
{
|
{
|
||||||
|
@ -210,6 +212,8 @@ namespace MWGui
|
||||||
|
|
||||||
virtual bool getPlayerSleeping();
|
virtual bool getPlayerSleeping();
|
||||||
|
|
||||||
|
virtual void startSpellMaking(MWWorld::Ptr actor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OEngine::GUI::MyGUIManager *mGuiManager;
|
OEngine::GUI::MyGUIManager *mGuiManager;
|
||||||
HUD *mHud;
|
HUD *mHud;
|
||||||
|
@ -237,6 +241,7 @@ namespace MWGui
|
||||||
LoadingScreen* mLoadingScreen;
|
LoadingScreen* mLoadingScreen;
|
||||||
LevelupDialog* mLevelupDialog;
|
LevelupDialog* mLevelupDialog;
|
||||||
WaitDialog* mWaitDialog;
|
WaitDialog* mWaitDialog;
|
||||||
|
SpellCreationDialog* mSpellCreationDialog;
|
||||||
|
|
||||||
CharacterCreation* mCharGen;
|
CharacterCreation* mCharGen;
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ set(MYGUI_FILES
|
||||||
openmw_levelup_dialog.layout
|
openmw_levelup_dialog.layout
|
||||||
openmw_wait_dialog.layout
|
openmw_wait_dialog.layout
|
||||||
openmw_wait_dialog_progressbar.layout
|
openmw_wait_dialog_progressbar.layout
|
||||||
|
openmw_spellcreation_dialog.layout
|
||||||
smallbars.png
|
smallbars.png
|
||||||
VeraMono.ttf
|
VeraMono.ttf
|
||||||
markers.png
|
markers.png
|
||||||
|
|
80
files/mygui/openmw_spellcreation_dialog.layout
Normal file
80
files/mygui/openmw_spellcreation_dialog.layout
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<MyGUI type="Layout">
|
||||||
|
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 560 400" name="_Main">
|
||||||
|
|
||||||
|
<Widget type="HBox" position="12 12 250 30">
|
||||||
|
|
||||||
|
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||||
|
<Property key="Caption" value="#{sName}"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="EditBox" skin="MW_TextEdit" position="0 0 30 30" name="NameEdit">
|
||||||
|
<UserString key="HStretch" value="true"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="Widget">
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="TextBox" skin="NormalText" position="280 0 300 24">
|
||||||
|
<Property key="Caption" value="#{sEnchantmentMenu4}"/>
|
||||||
|
</Widget>
|
||||||
|
<Widget type="TextBox" skin="SandText" position="280 0 258 24" name="MagickaCost">
|
||||||
|
<Property key="Caption" value="1"/>
|
||||||
|
<Property key="TextAlign" value="Right HCenter"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
|
||||||
|
<Widget type="TextBox" skin="NormalText" position="280 24 300 24">
|
||||||
|
<Property key="Caption" value="#{sSpellmakingMenu1}"/>
|
||||||
|
</Widget>
|
||||||
|
<Widget type="TextBox" skin="SandText" position="280 24 258 24" name="SuccessChance">
|
||||||
|
<Property key="Caption" value="39"/>
|
||||||
|
<Property key="TextAlign" value="Right HCenter"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Available effects -->
|
||||||
|
<Widget type="TextBox" skin="NormalText" position="12 48 300 24">
|
||||||
|
<Property key="Caption" value="#{sMagicEffects}"/>
|
||||||
|
</Widget>
|
||||||
|
<Widget type="MWList" skin="MW_SimpleList" position="12 76 202 269" name="AvailableEffects">
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<!-- Used effects -->
|
||||||
|
<Widget type="TextBox" skin="NormalText" position="226 48 300 24">
|
||||||
|
<Property key="Caption" value="#{sEffects}"/>
|
||||||
|
</Widget>
|
||||||
|
<Widget type="Widget" skin="MW_Box" position="226 76 316 269">
|
||||||
|
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 308 261" name="UsedEffects">
|
||||||
|
</Widget>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="HBox" position="0 340 560 60">
|
||||||
|
<Property key="Padding" value="16"/>
|
||||||
|
|
||||||
|
<Widget type="Widget" position="0 0 0 0">
|
||||||
|
<UserString key="HStretch" value="true"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="AutoSizedTextBox" skin="NormalText">
|
||||||
|
<Property key="Caption" value="#{sBarterDialog7}"/>
|
||||||
|
</Widget>
|
||||||
|
<Widget type="AutoSizedTextBox" skin="SandText" name="PriceLabel">
|
||||||
|
<Property key="Caption" value="30"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
|
||||||
|
<Widget type="AutoSizedButton" skin="MW_Button" name="BuyButton">
|
||||||
|
<Property key="Caption" value="#{sBuy}"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
|
||||||
|
<Property key="Caption" value="#{sCancel}"/>
|
||||||
|
</Widget>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
</Widget>
|
||||||
|
</MyGUI>
|
|
@ -196,6 +196,31 @@
|
||||||
</Widget>
|
</Widget>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
|
<!-- Magic effect tooltip -->
|
||||||
|
<Widget type="Widget" skin="HUD_Box_NoTransp" position="0 0 300 52" align="Stretch" name="MagicEffectToolTip">
|
||||||
|
<Property key="Visible" value="false"/>
|
||||||
|
|
||||||
|
<Widget type="ImageBox" skin="ImageBox" position="8 8 32 32" align="Left Top" name="MagicEffectImage"/>
|
||||||
|
|
||||||
|
<Widget type="TextBox" skin="NormalText" position="44 8 252 16" align="Left Top HStretch" name="MagicEffectName">
|
||||||
|
<Property key="TextAlign" value="Left"/>
|
||||||
|
<UserString key="AutoResizeHorizontal" value="true"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="TextBox" skin="SandText" position="44 24 252 16" align="Left Top HStretch" name="MagicEffectSchool">
|
||||||
|
<Property key="TextAlign" value="Left"/>
|
||||||
|
<UserString key="AutoResizeHorizontal" value="true"/>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
|
<Widget type="EditBox" skin="SandText" position="8 44 284 0" align="Left Top Stretch" name="MagicEffectDescription">
|
||||||
|
<Property key="MultiLine" value="true"/>
|
||||||
|
<Property key="WordWrap" value="true"/>
|
||||||
|
<Property key="TextAlign" value="Left Top"/>
|
||||||
|
<UserString key="AutoResizeHorizontal" value="true"/>
|
||||||
|
<UserString key="AutoResizeVertical" value="true"/>
|
||||||
|
</Widget>
|
||||||
|
</Widget>
|
||||||
|
|
||||||
</Widget>
|
</Widget>
|
||||||
</MyGUI>
|
</MyGUI>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue