1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-04 02:45:35 +00:00

Merge branch 'spellcreation' of git@github.com:scrawl/openmw.git into Travel_Dialogue

Conflicts:
	apps/openmw/CMakeLists.txt
	apps/openmw/mwdialogue/dialoguemanagerimp.cpp
	apps/openmw/mwgui/dialogue.cpp
	apps/openmw/mwgui/dialogue.hpp
	apps/openmw/mwgui/mode.hpp
	apps/openmw/mwgui/windowmanagerimp.cpp
This commit is contained in:
gugus 2012-09-28 17:09:15 +02:00
commit 4f5c4bf89a
50 changed files with 918 additions and 96 deletions

View file

@ -226,7 +226,7 @@ int main(int argc, char**argv)
case REC_BOOK:
{
Book b;
b.load(esm);
b.load(esm, id);
if(quiet) break;
cout << " Name: " << b.name << endl;
cout << " Mesh: " << b.model << endl;

View file

@ -29,7 +29,8 @@ add_openmw_dir (mwgui
map_window window_pinnable_base cursorreplace tooltips scrollwindow bookwindow list
formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog travelwindow
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog travelwindow spellcreationdialog
enchantingdialog
)
add_openmw_dir (mwdialogue

View file

@ -228,6 +228,9 @@ namespace MWBase
virtual bool getRestEnabled() = 0;
virtual bool getPlayerSleeping() = 0;
virtual void startSpellMaking(MWWorld::Ptr actor) = 0;
virtual void startEnchanting(MWWorld::Ptr actor) = 0;
};
}

View file

@ -124,8 +124,6 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);

View file

@ -129,8 +129,6 @@ namespace MWClass
info.caption = ref->base->name + MWGui::ToolTips::getCountString(ptr.getRefData().getCount());
info.icon = ref->base->icon;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
std::string text;
text += "\n#{sWeight}: " + MWGui::ToolTips::toString(ref->base->data.weight);

View file

@ -145,16 +145,17 @@ namespace
return false;
}
}
namespace MWDialogue
{
//helper function
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);
}
}
namespace MWDialogue
{
bool DialogueManager::functionFilter(const MWWorld::Ptr& actor, const ESM::DialInfo& info,bool choice)
{
@ -779,6 +780,8 @@ namespace MWDialogue
services = ref->base->mAiData.mServices;
}
int windowServices = 0;
if (services & ESM::NPC::Weapon
|| services & ESM::NPC::Armor
|| services & ESM::NPC::Clothing
@ -790,19 +793,24 @@ namespace MWDialogue
|| services & ESM::NPC::Apparatus
|| services & ESM::NPC::RepairItem
|| services & ESM::NPC::Misc)
win->setShowTrade(true);
else
win->setShowTrade(false);
windowServices |= MWGui::DialogueWindow::Service_Trade;
if (services & ESM::NPC::Spells)
win->setShowSpells(true);
else
win->setShowSpells(false);
if( !mActor.get<ESM::NPC>()->base->mTransport.empty())
win->setShowTravel(true);
else
win->setShowTravel(false);
if (services & ESM::NPC::Spells)
windowServices |= MWGui::DialogueWindow::Service_BuySpells;
if (services & ESM::NPC::Spellmaking)
windowServices |= MWGui::DialogueWindow::Service_CreateSpells;
if (services & ESM::NPC::Enchanting)
windowServices |= MWGui::DialogueWindow::Service_Enchant;
win->setServices (windowServices);
// sort again, because the previous sort was case-sensitive
keywordList.sort(stringCompareNoCase);
win->setKeywords(keywordList);

View file

@ -565,7 +565,7 @@ void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
{
delete mAttribDialog;
mAttribDialog = new SelectAttributeDialog(mWindowManager);
mAttribDialog->setAffectedWidget(_sender);
mAffectedAttribute = _sender;
mAttribDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
mAttribDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
mAttribDialog->setVisible(true);
@ -574,18 +574,17 @@ void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
void CreateClassDialog::onAttributeSelected()
{
ESM::Attribute::AttributeID id = mAttribDialog->getAttributeId();
Widgets::MWAttributePtr attribute = mAttribDialog->getAffectedWidget();
if (attribute == mFavoriteAttribute0)
if (mAffectedAttribute == mFavoriteAttribute0)
{
if (mFavoriteAttribute1->getAttributeId() == id)
mFavoriteAttribute1->setAttributeId(mFavoriteAttribute0->getAttributeId());
}
else if (attribute == mFavoriteAttribute1)
else if (mAffectedAttribute == mFavoriteAttribute1)
{
if (mFavoriteAttribute0->getAttributeId() == id)
mFavoriteAttribute0->setAttributeId(mFavoriteAttribute1->getAttributeId());
}
attribute->setAttributeId(id);
mAffectedAttribute->setAttributeId(id);
mWindowManager.removeDialog(mAttribDialog);
mAttribDialog = 0;
@ -596,7 +595,7 @@ void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
{
delete mSkillDialog;
mSkillDialog = new SelectSkillDialog(mWindowManager);
mSkillDialog->setAffectedWidget(_sender);
mAffectedSkill = _sender;
mSkillDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
mSkillDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
mSkillDialog->setVisible(true);
@ -605,22 +604,21 @@ void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
void CreateClassDialog::onSkillSelected()
{
ESM::Skill::SkillEnum id = mSkillDialog->getSkillId();
Widgets::MWSkillPtr skill = mSkillDialog->getAffectedWidget();
// Avoid duplicate skills by swapping any skill field that matches the selected one
std::vector<Widgets::MWSkillPtr>::const_iterator end = mSkills.end();
for (std::vector<Widgets::MWSkillPtr>::const_iterator it = mSkills.begin(); it != end; ++it)
{
if (*it == skill)
if (*it == mAffectedSkill)
continue;
if ((*it)->getSkillId() == id)
{
(*it)->setSkillId(skill->getSkillId());
(*it)->setSkillId(mAffectedSkill->getSkillId());
break;
}
}
skill->setSkillId(mSkillDialog->getSkillId());
mAffectedSkill->setSkillId(mSkillDialog->getSkillId());
mWindowManager.removeDialog(mSkillDialog);
mSkillDialog = 0;
update();

View file

@ -167,8 +167,6 @@ namespace MWGui
~SelectAttributeDialog();
ESM::Attribute::AttributeID getAttributeId() const { return mAttributeId; }
Widgets::MWAttributePtr getAffectedWidget() const { return mAffectedWidget; }
void setAffectedWidget(Widgets::MWAttributePtr widget) { mAffectedWidget = widget; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
@ -188,8 +186,6 @@ namespace MWGui
void onCancelClicked(MyGUI::Widget* _sender);
private:
Widgets::MWAttributePtr mAffectedWidget;
ESM::Attribute::AttributeID mAttributeId;
};
@ -200,8 +196,6 @@ namespace MWGui
~SelectSkillDialog();
ESM::Skill::SkillEnum getSkillId() const { return mSkillId; }
Widgets::MWSkillPtr getAffectedWidget() const { return mAffectedWidget; }
void setAffectedWidget(Widgets::MWSkillPtr widget) { mAffectedWidget = widget; }
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
@ -224,7 +218,6 @@ namespace MWGui
Widgets::MWSkillPtr mCombatSkill[9];
Widgets::MWSkillPtr mMagicSkill[9];
Widgets::MWSkillPtr mStealthSkill[9];
Widgets::MWSkillPtr mAffectedWidget;
ESM::Skill::SkillEnum mSkillId;
};
@ -301,6 +294,9 @@ namespace MWGui
DescriptionDialog *mDescDialog;
ESM::Class::Specialization mSpecializationId;
Widgets::MWAttributePtr mAffectedAttribute;
Widgets::MWSkillPtr mAffectedSkill;
};
}
#endif

View file

@ -362,7 +362,7 @@ void ContainerBase::drawItems()
int maxHeight = mItemView->getSize().height - 58;
bool onlyMagic = false;
int categories;
int categories = 0;
if (mFilter == Filter_All)
categories = MWWorld::ContainerStore::Type_All;
else if (mFilter == Filter_Weapon)

View file

@ -28,6 +28,8 @@ using namespace Widgets;
*Copied from the internet.
*/
namespace {
std::string lower_string(const std::string& str)
{
std::string lowerCase;
@ -43,12 +45,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);
}
}
DialogueWindow::DialogueWindow(MWBase::WindowManager& parWindowManager)
: WindowBase("openmw_dialogue_window.layout", parWindowManager)
, mEnabled(true)
, mShowTrade(false)
, mShowSpells(false)
, mServices(0)
{
// Centre dialog
center();
@ -142,6 +145,16 @@ void DialogueWindow::onSelectTopic(std::string topic)
mWindowManager.getTravelWindow()->startTravel(mPtr);
//mWindowManager.getSpellBuyingWindow()->startSpellBuying(mPtr);
}
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpellMakingMenuTitle")->getString())
{
mWindowManager.pushGuiMode(GM_SpellCreation);
mWindowManager.startSpellMaking (mPtr);
}
else if (topic == MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sEnchanting")->getString())
{
mWindowManager.pushGuiMode(GM_Enchanting);
mWindowManager.startEnchanting (mPtr);
}
else
MWBase::Environment::get().getDialogueManager()->keywordSelected(lower_string(topic));
}
@ -162,17 +175,23 @@ void DialogueWindow::setKeywords(std::list<std::string> keyWords)
{
mTopicsList->clear();
bool anyService = mShowTrade||mShowSpells;
bool anyService = mServices > 0;
if (mShowTrade)
if (mServices & Service_Trade)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sBarter")->getString());
if (mShowSpells)
if (mServices & Service_BuySpells)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpells")->getString());
if(mShowTravel)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sTravel")->getString());
if (mServices & Service_CreateSpells)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sSpellmakingMenuTitle")->getString());
if (mServices & Service_Enchant)
mTopicsList->addItem(MWBase::Environment::get().getWorld()->getStore().gameSettings.find("sEnchanting")->getString());
if (anyService || mShowTravel)
mTopicsList->addSeparator();

View file

@ -53,6 +53,15 @@ namespace MWGui
void setShowTrade(bool show) { mShowTrade = show; }
void setShowSpells(bool show) { mShowSpells = show; }
void setShowTravel(bool show) { mShowTravel = show; }
void setServices(int services) { mServices = services; }
enum Services
{
Service_Trade = 0x01,
Service_BuySpells = 0x02,
Service_CreateSpells = 0x04,
Service_Enchant = 0x08
};
protected:
void onSelectTopic(std::string topic);
@ -75,6 +84,8 @@ namespace MWGui
bool mShowSpells;
bool mShowTravel;
int mServices;
bool mEnabled;
DialogueHistory* mHistory;

View file

@ -0,0 +1,30 @@
#include "enchantingdialog.hpp"
namespace MWGui
{
EnchantingDialog::EnchantingDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_enchanting_dialog.layout", parWindowManager)
{
}
void EnchantingDialog::open()
{
center();
}
void EnchantingDialog::startEnchanting (MWWorld::Ptr actor)
{
mPtr = actor;
}
void EnchantingDialog::onReferenceUnavailable ()
{
mWindowManager.removeGuiMode (GM_Dialogue);
mWindowManager.removeGuiMode (GM_Enchanting);
}
}

View file

@ -0,0 +1,26 @@
#ifndef MWGUI_ENCHANTINGDIALOG_H
#define MWGUI_ENCHANTINGDIALOG_H
#include "window_base.hpp"
#include "referenceinterface.hpp"
#include "../mwbase/windowmanager.hpp"
namespace MWGui
{
class EnchantingDialog : public WindowBase, public ReferenceInterface
{
public:
EnchantingDialog(MWBase::WindowManager& parWindowManager);
virtual void open();
void startEnchanting(MWWorld::Ptr actor);
protected:
virtual void onReferenceUnavailable();
};
}
#endif

View file

@ -128,4 +128,10 @@ void MWList::onItemSelected(MyGUI::Widget* _sender)
std::string name = static_cast<MyGUI::Button*>(_sender)->getCaption();
eventItemSelected(name);
eventWidgetSelected(_sender);
}
MyGUI::Widget* MWList::getItemWidget(const std::string& name)
{
return mScrollView->findWidget (getName() + "_item_" + name);
}

View file

@ -18,6 +18,7 @@ namespace MWGui
MWList();
typedef MyGUI::delegates::CMultiDelegate1<std::string> EventHandle_String;
typedef MyGUI::delegates::CMultiDelegate1<MyGUI::Widget*> EventHandle_Widget;
/**
* Event: Item selected with the mouse.
@ -25,6 +26,13 @@ namespace MWGui
*/
EventHandle_String eventItemSelected;
/**
* Event: Item selected with the mouse.
* signature: void method(MyGUI::Widget* sender)
*/
EventHandle_Widget eventWidgetSelected;
/**
* Call after the size of the list changed, or items were inserted/removed
*/
@ -38,6 +46,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
void clear();
MyGUI::Widget* getItemWidget(const std::string& name);
///< get widget for an item name, useful to set up tooltip
protected:
void initialiseOverride();

View file

@ -224,6 +224,9 @@ void LocalMapBase::setPlayerPos(const float x, const float y)
{
if (x == mLastPositionX && y == mLastPositionY)
return;
notifyPlayerUpdate ();
MyGUI::IntSize size = mLocalMap->getCanvasSize();
MyGUI::IntPoint middle = MyGUI::IntPoint((1/3.f + x/3.f)*size.width,(1/3.f + y/3.f)*size.height);
MyGUI::IntCoord viewsize = mLocalMap->getCoord();
@ -239,6 +242,9 @@ void LocalMapBase::setPlayerDir(const float x, const float y)
{
if (x == mLastDirectionX && y == mLastDirectionY)
return;
notifyPlayerUpdate ();
MyGUI::ISubWidget* main = mCompass->getSubWidgetMain();
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
@ -407,3 +413,9 @@ void MapWindow::globalMapUpdatePlayer ()
MyGUI::IntPoint viewoffs(0.5*viewsize.width - worldX, 0.5*viewsize.height - worldY);
mGlobalMap->setViewOffset(viewoffs);
}
void MapWindow::notifyPlayerUpdate ()
{
if (mGlobal)
globalMapUpdatePlayer ();
}

View file

@ -49,6 +49,8 @@ namespace MWGui
void onMarkerFocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
virtual void notifyPlayerUpdate() {}
OEngine::GUI::Layout* mLayout;
bool mMapDragAndDrop;
@ -93,6 +95,8 @@ namespace MWGui
protected:
virtual void onPinToggled();
virtual void notifyPlayerUpdate();
};
}
#endif

View file

@ -23,6 +23,8 @@ namespace MWGui
GM_RestBed,
GM_SpellBuying,
GM_Travel,
GM_SpellCreation,
GM_Enchanting,
GM_Levelup,

View file

@ -33,11 +33,6 @@ RaceDialog::RaceDialog(MWBase::WindowManager& parWindowManager)
setText("AppearanceT", mWindowManager.getGameSettingString("sRaceMenu1", "Appearance"));
getWidget(mPreviewImage, "PreviewImage");
MWBase::Environment::get().getWorld ()->setupExternalRendering (mPreview);
mPreview.update (0);
mPreviewImage->setImageTexture ("CharacterHeadPreview");
getWidget(mHeadRotate, "HeadRotate");
mHeadRotate->setScrollRange(50);
mHeadRotate->setScrollPosition(25);
@ -107,6 +102,12 @@ void RaceDialog::open()
updateRaces();
updateSkills();
updateSpellPowers();
mPreview = new MWRender::RaceSelectionPreview();
MWBase::Environment::get().getWorld ()->setupExternalRendering (*mPreview);
mPreview->update (0);
mPreviewImage->setImageTexture ("CharacterHeadPreview");
}
@ -138,6 +139,12 @@ int wrap(int index, int max)
return index;
}
void RaceDialog::close()
{
delete mPreview;
mPreview = 0;
}
// widget controls
void RaceDialog::onOkClicked(MyGUI::Widget* _sender)
@ -154,7 +161,7 @@ void RaceDialog::onHeadRotate(MyGUI::ScrollBar*, size_t _position)
{
float angle = (float(_position) / 49.f - 0.5) * 3.14 * 2;
float diff = angle - mCurrentAngle;
mPreview.update (diff);
mPreview->update (diff);
mCurrentAngle += diff;
}

View file

@ -46,6 +46,7 @@ namespace MWGui
void setNextButtonShow(bool shown);
virtual void open();
virtual void close();
// Events
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
@ -94,7 +95,7 @@ namespace MWGui
float mCurrentAngle;
MWRender::RaceSelectionPreview mPreview;
MWRender::RaceSelectionPreview* mPreview;
};
}
#endif

View file

@ -24,7 +24,6 @@ namespace MWGui
SpellBuyingWindow::SpellBuyingWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_spell_buying_window.layout", parWindowManager)
, ContainerBase(NULL) // no drag&drop
, mCurrentY(0)
, mLastPos(0)
{
@ -77,7 +76,7 @@ namespace MWGui
void SpellBuyingWindow::startSpellBuying(const MWWorld::Ptr& actor)
{
center();
mActor = actor;
mPtr = actor;
clearSpells();
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
@ -114,7 +113,7 @@ namespace MWGui
MWMechanics::Spells& spells = stats.getSpells();
spells.add (mSpellsWidgetMap.find(_sender)->second);
mWindowManager.getTradeWindow()->addOrRemoveGold(-price);
startSpellBuying(mActor);
startSpellBuying(mPtr);
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
}

View file

@ -1,10 +1,8 @@
#ifndef MWGUI_SpellBuyingWINDOW_H
#define MWGUI_SpellBuyingWINDOW_H
#include "container.hpp"
#include "window_base.hpp"
#include "../mwworld/ptr.hpp"
#include "referenceinterface.hpp"
namespace MyGUI
{
@ -20,7 +18,7 @@ namespace MWGui
namespace MWGui
{
class SpellBuyingWindow : public ContainerBase, public WindowBase
class SpellBuyingWindow : public ReferenceInterface, public WindowBase
{
public:
SpellBuyingWindow(MWBase::WindowManager& parWindowManager);
@ -35,8 +33,6 @@ namespace MWGui
MyGUI::ScrollView* mSpellsView;
MWWorld::Ptr mActor;
std::map<MyGUI::Widget*, std::string> mSpellsWidgetMap;
void onCancelButtonClicked(MyGUI::Widget* _sender);

View file

@ -0,0 +1,219 @@
#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
{
EditEffectDialog::EditEffectDialog(MWBase::WindowManager &parWindowManager)
: WindowModal("openmw_edit_effect.layout", parWindowManager)
{
getWidget(mCancelButton, "CancelButton");
getWidget(mOkButton, "OkButton");
getWidget(mDeleteButton, "DeleteButton");
getWidget(mRangeButton, "RangeButton");
getWidget(mMagnitudeMinValue, "MagnitudeMinValue");
getWidget(mMagnitudeMaxValue, "MagnitudeMaxValue");
getWidget(mDurationValue, "DurationValue");
getWidget(mAreaValue, "AreaValue");
getWidget(mMagnitudeMinSlider, "MagnitudeMinSlider");
getWidget(mMagnitudeMaxSlider, "MagnitudeMaxSlider");
getWidget(mDurationSlider, "DurationSlider");
getWidget(mAreaSlider, "AreaSlider");
getWidget(mEffectImage, "EffectImage");
getWidget(mEffectName, "EffectName");
getWidget(mAreaText, "AreaText");
mRangeButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onRangeButtonClicked);
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onOkButtonClicked);
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onCancelButtonClicked);
mDeleteButton->eventMouseButtonClick += MyGUI::newDelegate(this, &EditEffectDialog::onDeleteButtonClicked);
}
void EditEffectDialog::open()
{
WindowModal::open();
center();
mEffect.range = ESM::RT_Self;
onRangeButtonClicked(mRangeButton);
}
void EditEffectDialog::setEffect (const ESM::MagicEffect *effect)
{
std::string icon = effect->icon;
icon[icon.size()-3] = 'd';
icon[icon.size()-2] = 'd';
icon[icon.size()-1] = 's';
icon = "icons\\" + icon;
mEffectImage->setImageTexture (icon);
mEffectName->setCaptionWithReplacing("#{"+Widgets::MWSpellEffect::effectIDToString (effect->index)+"}");
}
void EditEffectDialog::onRangeButtonClicked (MyGUI::Widget* sender)
{
mEffect.range = (mEffect.range+1)%3;
if (mEffect.range == ESM::RT_Self)
mRangeButton->setCaptionWithReplacing ("#{sRangeSelf}");
else if (mEffect.range == ESM::RT_Target)
mRangeButton->setCaptionWithReplacing ("#{sRangeTarget}");
else if (mEffect.range == ESM::RT_Touch)
mRangeButton->setCaptionWithReplacing ("#{sRangeTouch}");
mAreaSlider->setVisible (mEffect.range != ESM::RT_Self);
mAreaText->setVisible (mEffect.range != ESM::RT_Self);
}
void EditEffectDialog::onDeleteButtonClicked (MyGUI::Widget* sender)
{
}
void EditEffectDialog::onOkButtonClicked (MyGUI::Widget* sender)
{
setVisible(false);
}
void EditEffectDialog::onCancelButtonClicked (MyGUI::Widget* sender)
{
setVisible(false);
}
// ------------------------------------------------------------------------------------------------
SpellCreationDialog::SpellCreationDialog(MWBase::WindowManager &parWindowManager)
: WindowBase("openmw_spellcreation_dialog.layout", parWindowManager)
, mAddEffectDialog(parWindowManager)
, mSelectAttributeDialog(NULL)
, mSelectSkillDialog(NULL)
{
getWidget(mNameEdit, "NameEdit");
getWidget(mMagickaCost, "MagickaCost");
getWidget(mSuccessChance, "SuccessChance");
getWidget(mAvailableEffectsList, "AvailableEffects");
getWidget(mUsedEffectsView, "UsedEffects");
getWidget(mPriceLabel, "PriceLabel");
getWidget(mBuyButton, "BuyButton");
getWidget(mCancelButton, "CancelButton");
mAddEffectDialog.setVisible(false);
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellCreationDialog::onCancelButtonClicked);
mBuyButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SpellCreationDialog::onBuyButtonClicked);
mAvailableEffectsList->eventWidgetSelected += MyGUI::newDelegate(this, &SpellCreationDialog::onAvailableEffectClicked);
}
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);
w->setUserData(*it);
ToolTips::createMagicEffectToolTip (w, *it);
}
}
void SpellCreationDialog::onCancelButtonClicked (MyGUI::Widget* sender)
{
mWindowManager.removeGuiMode (MWGui::GM_SpellCreation);
}
void SpellCreationDialog::onBuyButtonClicked (MyGUI::Widget* sender)
{
}
void SpellCreationDialog::onAvailableEffectClicked (MyGUI::Widget* sender)
{
short effectId = *sender->getUserData<short>();
const ESM::MagicEffect* effect = MWBase::Environment::get().getWorld()->getStore().magicEffects.find(effectId);
mAddEffectDialog.setVisible(true);
mAddEffectDialog.setEffect (effect);
}
}

View file

@ -0,0 +1,90 @@
#ifndef MWGUI_SPELLCREATION_H
#define MWGUI_SPELLCREATION_H
#include "window_base.hpp"
#include "referenceinterface.hpp"
#include "list.hpp"
namespace MWGui
{
class SelectSkillDialog;
class SelectAttributeDialog;
class EditEffectDialog : public WindowModal
{
public:
EditEffectDialog(MWBase::WindowManager& parWindowManager);
virtual void open();
void setEffect (const ESM::MagicEffect* effect);
protected:
MyGUI::Button* mCancelButton;
MyGUI::Button* mOkButton;
MyGUI::Button* mDeleteButton;
MyGUI::Button* mRangeButton;
MyGUI::TextBox* mMagnitudeMinValue;
MyGUI::TextBox* mMagnitudeMaxValue;
MyGUI::TextBox* mDurationValue;
MyGUI::TextBox* mAreaValue;
MyGUI::ScrollBar* mMagnitudeMinSlider;
MyGUI::ScrollBar* mMagnitudeMaxSlider;
MyGUI::ScrollBar* mDurationSlider;
MyGUI::ScrollBar* mAreaSlider;
MyGUI::TextBox* mAreaText;
MyGUI::ImageBox* mEffectImage;
MyGUI::TextBox* mEffectName;
protected:
void onRangeButtonClicked (MyGUI::Widget* sender);
void onDeleteButtonClicked (MyGUI::Widget* sender);
void onOkButtonClicked (MyGUI::Widget* sender);
void onCancelButtonClicked (MyGUI::Widget* sender);
protected:
ESM::ENAMstruct mEffect;
};
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);
void onAvailableEffectClicked (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;
EditEffectDialog mAddEffectDialog;
SelectAttributeDialog* mSelectAttributeDialog;
SelectSkillDialog* mSelectSkillDialog;
};
}
#endif

View file

@ -475,8 +475,6 @@ void StatsWindow::updateSkillArea()
text += "\n#BF9959";
for (int i=0; i<6; ++i)
{
const ESM::Skill* skill = MWBase::Environment::get().getWorld()->getStore().skills.search(faction->data.skillID[i]);
assert(skill);
text += "#{"+ESM::Skill::sSkillNameIds[faction->data.skillID[i]]+"}";
if (i<5)
text += ", ";

View file

@ -368,7 +368,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
if (text.size() > 0 && text[0] == '\n')
text.erase(0, 1);
const ESM::Enchantment* enchant;
const ESM::Enchantment* enchant = 0;
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
if (info.enchant != "")
{
@ -440,6 +440,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
if (info.enchant != "")
{
assert(enchant);
Widget* enchantArea = mDynamicToolTipBox->createWidget<Widget>("",
IntCoord(0, totalSize.height, 300, 300-totalSize.height),
Align::Stretch, "ToolTipEnchantArea");
@ -586,8 +587,6 @@ void ToolTips::createSkillToolTip(MyGUI::Widget* widget, int skillId)
widget->setUserString("Caption_SkillNoProgressDescription", skill->description);
widget->setUserString("Caption_SkillNoProgressAttribute", "#{sGoverningAttribute}: #{" + attr->name + "}");
widget->setUserString("ImageTexture_SkillNoProgressImage", icon);
widget->setUserString("ToolTipLayout", "SkillNoProgressToolTip");
widget->setUserString("ToolTipLayout", "SkillNoProgressToolTip");
}
void ToolTips::createAttributeToolTip(MyGUI::Widget* widget, int attributeId)
@ -713,6 +712,38 @@ void ToolTips::createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playe
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)
{
mDelay = delay;

View file

@ -71,6 +71,7 @@ namespace MWGui
static void createBirthsignToolTip(MyGUI::Widget* widget, const std::string& birthsignId);
static void createRaceToolTip(MyGUI::Widget* widget, const ESM::Race* playerRace);
static void createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass);
static void createMagicEffectToolTip(MyGUI::Widget* widget, short id);
private:
MyGUI::Widget* mDynamicToolTipBox;

View file

@ -249,11 +249,13 @@ namespace MWGui
void setWindowManager(MWBase::WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
void setSpellEffect(const SpellEffectParams& params);
std::string effectIDToString(const short effectID);
bool effectHasMagnitude (const std::string& effect);
bool effectHasDuration (const std::string& effect);
bool effectInvolvesAttribute (const std::string& effect);
bool effectInvolvesSkill (const std::string& effect);
static std::string effectIDToString(const short effectID);
/// \todo Remove all of these! The information can be obtained via the ESM::MagicEffect's flags!
static bool effectHasMagnitude (const std::string& effect);
static bool effectHasDuration (const std::string& effect);
static bool effectInvolvesAttribute (const std::string& effect);
static bool effectInvolvesSkill (const std::string& effect);
int getRequestedWidth() const { return mRequestedWidth; }

View file

@ -47,6 +47,8 @@
#include "loadingscreen.hpp"
#include "levelupdialog.hpp"
#include "waitdialog.hpp"
#include "spellcreationdialog.hpp"
#include "enchantingdialog.hpp"
using namespace MWGui;
@ -77,6 +79,8 @@ WindowManager::WindowManager(
, mCharGen(NULL)
, mLevelupDialog(NULL)
, mWaitDialog(NULL)
, mSpellCreationDialog(NULL)
, mEnchantingDialog(NULL)
, mPlayerClass()
, mPlayerName()
, mPlayerRaceId()
@ -158,6 +162,8 @@ WindowManager::WindowManager(
mQuickKeysMenu = new QuickKeysMenu(*this);
mLevelupDialog = new LevelupDialog(*this);
mWaitDialog = new WaitDialog(*this);
mSpellCreationDialog = new SpellCreationDialog(*this);
mEnchantingDialog = new EnchantingDialog(*this);
mLoadingScreen = new LoadingScreen(mOgre->getScene (), mOgre->getWindow (), *this);
mLoadingScreen->onResChange (w,h);
@ -214,6 +220,8 @@ WindowManager::~WindowManager()
delete mLoadingScreen;
delete mLevelupDialog;
delete mWaitDialog;
delete mSpellCreationDialog;
delete mEnchantingDialog;
cleanupGarbage();
@ -264,6 +272,8 @@ void WindowManager::updateVisible()
mQuickKeysMenu->setVisible(false);
mLevelupDialog->setVisible(false);
mWaitDialog->setVisible(false);
mSpellCreationDialog->setVisible(false);
mEnchantingDialog->setVisible(false);
mHud->setVisible(true);
@ -366,6 +376,11 @@ void WindowManager::updateVisible()
break;
case GM_Travel:
mTravelWindow->setVisible(true);
case GM_SpellCreation:
mSpellCreationDialog->setVisible(true);
break;
case GM_Enchanting:
mEnchantingDialog->setVisible(true);
break;
case GM_InterMessageBox:
break;
@ -569,6 +584,7 @@ void WindowManager::onFrame (float frameDuration)
mDialogueWindow->checkReferenceAvailable();
mTradeWindow->checkReferenceAvailable();
mSpellBuyingWindow->checkReferenceAvailable();
mSpellCreationDialog->checkReferenceAvailable();
mContainerWindow->checkReferenceAvailable();
mConsole->checkReferenceAvailable();
}
@ -969,3 +985,13 @@ void WindowManager::addVisitedLocation(const std::string& name, int x, int y)
{
mMap->addVisitedLocation (name, x, y);
}
void WindowManager::startSpellMaking(MWWorld::Ptr actor)
{
mSpellCreationDialog->startSpellMaking (actor);
}
void WindowManager::startEnchanting (MWWorld::Ptr actor)
{
mEnchantingDialog->startEnchanting (actor);
}

View file

@ -64,6 +64,8 @@ namespace MWGui
class LoadingScreen;
class LevelupDialog;
class WaitDialog;
class SpellCreationDialog;
class EnchantingDialog;
class WindowManager : public MWBase::WindowManager
{
@ -211,6 +213,9 @@ namespace MWGui
virtual bool getPlayerSleeping();
virtual void startSpellMaking(MWWorld::Ptr actor);
virtual void startEnchanting(MWWorld::Ptr actor);
private:
OEngine::GUI::MyGUIManager *mGuiManager;
HUD *mHud;
@ -239,6 +244,8 @@ namespace MWGui
LoadingScreen* mLoadingScreen;
LevelupDialog* mLevelupDialog;
WaitDialog* mWaitDialog;
SpellCreationDialog* mSpellCreationDialog;
EnchantingDialog* mEnchantingDialog;
CharacterCreation* mCharGen;

View file

@ -227,3 +227,13 @@ int MWMechanics::NpcStats::getLevelupAttributeMultiplier(int attribute) const
else
return 5;
}
void MWMechanics::NpcStats::flagAsUsed (const std::string& id)
{
mUsedIds.insert (id);
}
bool MWMechanics::NpcStats::hasBeenUsed (const std::string& id) const
{
return mUsedIds.find (id)!=mUsedIds.end();
}

View file

@ -50,6 +50,8 @@ namespace MWMechanics
std::vector<int> mSkillIncreases; // number of skill increases for each attribute
std::set<std::string> mUsedIds;
public:
NpcStats();
@ -86,6 +88,10 @@ namespace MWMechanics
int getLevelupAttributeMultiplier(int attribute) const;
void levelUp();
void flagAsUsed (const std::string& id);
bool hasBeenUsed (const std::string& id) const;
};
}

View file

@ -25,6 +25,7 @@ namespace MWRender
, mPosition(position)
, mLookAt(lookAt)
, mCharacter(character)
, mAnimation(NULL)
{
}
@ -53,10 +54,13 @@ namespace MWRender
mCamera->setNearClipDistance (0.01);
mCamera->setFarClipDistance (1000);
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
mTexture = Ogre::TextureManager::getSingleton().getByName (mName);
if (mTexture.isNull ())
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
mRenderTarget->removeAllViewports ();
mViewport = mRenderTarget->addViewport(mCamera);
mViewport->setOverlaysEnabled(false);
mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
@ -71,7 +75,7 @@ namespace MWRender
CharacterPreview::~CharacterPreview ()
{
Ogre::TextureManager::getSingleton().remove(mName);
//Ogre::TextureManager::getSingleton().remove(mName);
mSceneMgr->destroyCamera (mName);
delete mAnimation;
}

View file

@ -35,22 +35,21 @@ namespace MWWorld
MWBase::Environment::get().getWindowManager()->getBookWindow()->open(getTarget());
}
/*
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer();
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
// Skill gain from books
if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length)
if (ref->base->data.skillID >= 0 && ref->base->data.skillID < ESM::Skill::Length
&& !npcStats.hasBeenUsed (ref->base->id))
{
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer().getPlayer();
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
MWWorld::LiveCellRef<ESM::NPC> *playerRef = player.get<ESM::NPC>();
const ESM::Class *class_ = MWBase::Environment::get().getWorld()->getStore().classes.find (
playerRef->base->cls);
npcStats.increaseSkill (ref->base->data.skillID, *class_, true);
/// \todo Remove skill from the book. Right now you can read as many times as you want
/// and the skill will still increase.
npcStats.flagAsUsed (ref->base->id);
}
*/
}
}

View file

@ -41,7 +41,8 @@ const float WeatherGlobals::mThunderSoundDelay = 0.25;
WeatherManager::WeatherManager(MWRender::RenderingManager* rendering) :
mHour(14), mCurrentWeather("clear"), mFirstUpdate(true), mWeatherUpdateTime(0),
mThunderFlash(0), mThunderChance(0), mThunderChanceNeeded(50), mThunderSoundDelay(0),
mRemainingTransitionTime(0), mMonth(0), mDay(0)
mRemainingTransitionTime(0), mMonth(0), mDay(0),
mTimePassed(0)
{
mRendering = rendering;
@ -487,7 +488,10 @@ WeatherResult WeatherManager::transition(float factor)
void WeatherManager::update(float duration)
{
mWeatherUpdateTime -= duration * MWBase::Environment::get().getWorld()->getTimeScaleFactor();
float timePassed = mTimePassed;
mTimePassed = 0;
mWeatherUpdateTime -= timePassed;
bool exterior = (MWBase::Environment::get().getWorld()->isCellExterior() || MWBase::Environment::get().getWorld()->isCellQuasiExterior());
@ -558,7 +562,7 @@ void WeatherManager::update(float duration)
if (mNextWeather != "")
{
mRemainingTransitionTime -= duration * MWBase::Environment::get().getWorld()->getTimeScaleFactor();
mRemainingTransitionTime -= timePassed;
if (mRemainingTransitionTime < 0)
{
mCurrentWeather = mNextWeather;

View file

@ -231,6 +231,11 @@ namespace MWWorld
void setDate(const int day, const int month);
void advanceTime(double hours)
{
mTimePassed += hours*3600;
}
unsigned int getWeatherID() const;
private:
@ -261,6 +266,8 @@ namespace MWWorld
float mThunderChanceNeeded;
float mThunderSoundDelay;
double mTimePassed; // time passed since last update
WeatherResult transition(const float factor);
WeatherResult getResult(const Ogre::String& weather);

View file

@ -366,6 +366,8 @@ namespace MWWorld
void World::advanceTime (double hours)
{
mWeatherManager->advanceTime (hours);
hours += mGlobalVariables->getFloat ("gamehour");
setHour (hours);

View file

@ -3,7 +3,7 @@
namespace ESM
{
void Book::load(ESMReader &esm)
void Book::load(ESMReader &esm, const std::string& recordId)
{
model = esm.getHNString("MODL");
name = esm.getHNOString("FNAM");
@ -12,6 +12,7 @@ void Book::load(ESMReader &esm)
icon = esm.getHNOString("ITEX");
text = esm.getHNOString("TEXT");
enchant = esm.getHNOString("ENAM");
id = recordId;
}
}

View file

@ -20,8 +20,9 @@ struct Book
BKDTstruct data;
std::string name, model, icon, script, enchant, text;
std::string id;
void load(ESMReader &esm);
void load(ESMReader &esm, const std::string& recordId);
};
}
#endif

View file

@ -34,7 +34,7 @@ namespace ESMS
RecListT<Apparatus> appas;
RecListT<Armor> armors;
RecListT<BodyPart> bodyParts;
RecListT<Book> books;
RecListWithIDT<Book> books;
RecListT<BirthSign> birthSigns;
RecListT<Class> classes;
RecListT<Clothing> clothes;

View file

@ -193,7 +193,8 @@ void ManualBulletShapeLoader::handleNode(Nif::Node *node, int flags,
// affecting the entire subtree of this node
Nif::NiStringExtraData *sd = (Nif::NiStringExtraData*)e;
if (sd->string == "NCO")
// not sure what the difference between NCO and NCC is, or if there even is one
if (sd->string == "NCO" || sd->string == "NCC")
{
// No collision. Use an internal flag setting to mark this.
flags |= 0x800;

View file

@ -75,6 +75,9 @@ set(MYGUI_FILES
openmw_levelup_dialog.layout
openmw_wait_dialog.layout
openmw_wait_dialog_progressbar.layout
openmw_spellcreation_dialog.layout
openmw_edit_effect.layout
openmw_enchanting_dialog.layout
smallbars.png
VeraMono.ttf
markers.png

View file

@ -3,7 +3,7 @@
<MyGUI type="List">
<List file="core.skin" />
<List file="openmw_resources.xml" />
<List file="openmw.font.xml" />
<List file="openmw_font.xml"/>
<List file="openmw_text.skin.xml" />
<List file="openmw_windows.skin.xml" />
<List file="openmw_button.skin.xml" />

View file

@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 362 310" name="_Main">
<Widget type="ImageBox" skin="ImageBox" position="8 12 16 16" name="EffectImage">
</Widget>
<Widget type="TextBox" skin="NormalText" position="36 8 400 24" name="EffectName">
<Property key="TextAlign" value="Left HCenter"/>
</Widget>
<!-- Range -->
<Widget type="TextBox" skin="NormalText" position="8 36 400 24">
<Property key="Caption" value="#{sRange}"/>
<Property key="TextAlign" value="Left HCenter"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" position="130 36 0 24" name="RangeButton">
<Property key="Caption" value="#{sRangeTouch}"/>
</Widget>
<!-- Magnitude -->
<Widget type="TextBox" skin="NormalText" position="8 80 400 24">
<Property key="Caption" value="#{sMagnitude}"/>
<Property key="TextAlign" value="Left HCenter"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="130 80 210 20" name="MagnitudeMinValue">
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="130 100 210 13" name="MagnitudeMinSlider">
</Widget>
<Widget type="TextBox" skin="SandText" position="130 112 210 20" name="MagnitudeMaxValue">
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="130 132 210 13" name="MagnitudeMaxSlider">
</Widget>
<!-- Duration -->
<Widget type="TextBox" skin="NormalText" position="8 173 400 24">
<Property key="Caption" value="#{sDuration}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="130 153 210 20" name="DurationValue">
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="130 173 210 13" name="DurationSlider">
</Widget>
<!-- Area -->
<Widget type="TextBox" skin="NormalText" position="8 217 400 24" name="AreaText">
<Property key="Caption" value="#{sArea}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="130 197 210 20" name="AreaValue">
<Property key="TextAlign" value="Center"/>
<Property key="Caption" value="0"/>
</Widget>
<Widget type="ScrollBar" skin="MW_HSlider" position="130 217 210 13" name="AreaSlider">
</Widget>
<Widget type="HBox" position="8 266 336 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="DeleteButton">
<Property key="Caption" value="#{sDelete}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton">
<Property key="Caption" value="#{sOk}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
<Property key="Caption" value="#{sCancel}"/>
</Widget>
</Widget>
</Widget>
</MyGUI>

View file

@ -0,0 +1,96 @@
<?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>
<!-- Item -->
<Widget type="AutoSizedTextBox" skin="NormalText" position="12 48 0 24">
<Property key="Caption" value="#{sItem}"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="280 0 300 24">
<Property key="Caption" value="#{sEnchantmentMenu3}:"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="280 0 258 24" name="Enchantment">
<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="#{sCastCost}:"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="280 24 258 24" name="CastCost">
<Property key="Caption" value="39"/>
<Property key="TextAlign" value="Right HCenter"/>
</Widget>
<Widget type="TextBox" skin="NormalText" position="280 48 300 24">
<Property key="Caption" value="#{sCharges}"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="280 48 258 24" name="Charge">
<Property key="Caption" value="39"/>
<Property key="TextAlign" value="Right HCenter"/>
</Widget>
<!-- Available effects -->
<Widget type="TextBox" skin="NormalText" position="12 148 300 24">
<Property key="Caption" value="#{sMagicEffects}"/>
</Widget>
<Widget type="MWList" skin="MW_SimpleList" position="12 176 202 169" name="AvailableEffects">
</Widget>
<!-- Used effects -->
<Widget type="TextBox" skin="NormalText" position="226 148 300 24">
<Property key="Caption" value="#{sEffects}"/>
</Widget>
<Widget type="Widget" skin="MW_Box" position="226 176 316 169">
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 308 161" 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>

View 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>

View file

@ -196,6 +196,31 @@
</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>
</MyGUI>

View file

@ -303,16 +303,11 @@ namespace Physic
+ boost::lexical_cast<std::string>(y);
// find the minimum and maximum heights (needed for bullet)
float minh;
float maxh;
float minh = heights[0];
float maxh = heights[0];
for (int i=0; i<sqrtVerts*sqrtVerts; ++i)
{
float h = heights[i];
if (i==0)
{
minh = h;
maxh = h;
}
if (h>maxh) maxh = h;
if (h<minh) minh = h;

View file

@ -171,11 +171,11 @@ bool PM_SlideMove( bool gravity )
Ogre::Vector3 clipVelocity;
int i, j, k;
struct traceResults trace;
Ogre::Vector3 end;
Ogre::Vector3 end(0,0,0);
float time_left;
float into;
Ogre::Vector3 endVelocity;
Ogre::Vector3 endClipVelocity;
Ogre::Vector3 endVelocity(0,0,0);
Ogre::Vector3 endClipVelocity(0,0,0);
numbumps = 4;

View file

@ -13,8 +13,8 @@
void newtrace(traceResults* const results, const Ogre::Vector3& start, const Ogre::Vector3& end, const Ogre::Vector3& BBHalfExtents, const float rotation, bool isInterior, OEngine::Physic::PhysicEngine* enginePass) //Traceobj was a Aedra Object
{
static float lastyaw = 0.0f;
static float lastpitch = 0.0f;
//static float lastyaw = 0.0f;
//static float lastpitch = 0.0f;
//if (!traceobj)
// return;