1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00

Merge remote-tracking branch 'zini/next' into nifogre

This commit is contained in:
Chris Robinson 2013-04-18 15:14:28 -07:00
commit 434f3ac8c8
28 changed files with 8661 additions and 8526 deletions

View File

@ -15,7 +15,7 @@ include (OpenMWMacros)
# Version
set (OPENMW_VERSION_MAJOR 0)
set (OPENMW_VERSION_MINOR 22)
set (OPENMW_VERSION_MINOR 23)
set (OPENMW_VERSION_RELEASE 0)
set (OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}")

View File

@ -9,9 +9,6 @@
#include "widgets.hpp"
using namespace MWGui;
using namespace Widgets;
namespace
{
@ -22,6 +19,9 @@ bool sortBirthSigns(const std::pair<std::string, const ESM::BirthSign*>& left, c
}
namespace MWGui
{
BirthDialog::BirthDialog()
: WindowModal("openmw_chargen_birth.layout")
{
@ -166,7 +166,7 @@ void BirthDialog::updateSpells()
if (mCurrentBirthId.empty())
return;
MWSpellPtr spellWidget;
Widgets::MWSpellPtr spellWidget;
const int lineHeight = 18;
MyGUI::IntCoord coord(0, 0, mSpellArea->getWidth(), 18);
@ -177,7 +177,7 @@ void BirthDialog::updateSpells()
store.get<ESM::BirthSign>().find(mCurrentBirthId);
std::string texturePath = std::string("textures\\") + birth->mTexture;
fixTexturePath(texturePath);
Widgets::fixTexturePath(texturePath);
mBirthImage->setImageTexture(texturePath);
std::vector<std::string> abilities, powers, spells;
@ -227,7 +227,7 @@ void BirthDialog::updateSpells()
for (std::vector<std::string>::const_iterator it = categories[category].spells.begin(); it != end; ++it)
{
const std::string &spellId = *it;
spellWidget = mSpellArea->createWidget<MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("Spell") + boost::lexical_cast<std::string>(i));
spellWidget = mSpellArea->createWidget<Widgets::MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("Spell") + boost::lexical_cast<std::string>(i));
spellWidget->setSpellId(spellId);
mSpellItems.push_back(spellWidget);
@ -235,7 +235,7 @@ void BirthDialog::updateSpells()
MyGUI::IntCoord spellCoord = coord;
spellCoord.height = 24; // TODO: This should be fetched from the skin somehow, or perhaps a widget in the layout as a template?
spellWidget->createEffectWidgets(mSpellItems, mSpellArea, spellCoord, (category == 0) ? MWEffectList::EF_Constant : 0);
spellWidget->createEffectWidgets(mSpellItems, mSpellArea, spellCoord, (category == 0) ? Widgets::MWEffectList::EF_Constant : 0);
coord.top = spellCoord.top;
++i;
@ -243,3 +243,5 @@ void BirthDialog::updateSpells()
}
}
}
}

View File

@ -12,7 +12,8 @@
#include "formatting.hpp"
using namespace MWGui;
namespace MWGui
{
BookWindow::BookWindow ()
: WindowBase("openmw_book.layout")
@ -157,3 +158,5 @@ void BookWindow::updatePages()
++i;
}
}
}

View File

@ -43,7 +43,8 @@ namespace
};
}
using namespace MWGui;
namespace MWGui
{
CharacterCreation::CharacterCreation()
: mNameDialog(0)
@ -722,3 +723,5 @@ CharacterCreation::~CharacterCreation()
delete mBirthSignDialog;
delete mReviewDialog;
}
}

View File

@ -11,7 +11,8 @@
#undef min
#undef max
using namespace MWGui;
namespace MWGui
{
/* GenerateClassResultDialog */
@ -878,3 +879,5 @@ void DescriptionDialog::onOkClicked(MyGUI::Widget* _sender)
{
eventDone(this);
}
}

View File

@ -278,16 +278,15 @@ namespace MWGui
std::string Console::complete( std::string input, std::vector<std::string> &matches )
{
using namespace std;
string output=input;
string tmp=input;
std::string output = input;
std::string tmp = input;
bool has_front_quote = false;
/* Does the input string contain things that don't have to be completed? If yes erase them. */
/* Are there quotation marks? */
if( tmp.find('"') != string::npos ) {
if( tmp.find('"') != std::string::npos ) {
int numquotes=0;
for(string::iterator it=tmp.begin(); it < tmp.end(); ++it) {
for(std::string::iterator it=tmp.begin(); it < tmp.end(); ++it) {
if( *it == '"' )
numquotes++;
}
@ -299,7 +298,7 @@ namespace MWGui
}
else {
size_t pos;
if( ( ((pos = tmp.rfind(' ')) != string::npos ) ) && ( pos > tmp.rfind('"') ) ) {
if( ( ((pos = tmp.rfind(' ')) != std::string::npos ) ) && ( pos > tmp.rfind('"') ) ) {
tmp.erase( 0, tmp.rfind(' ')+1);
}
else {
@ -311,7 +310,7 @@ namespace MWGui
/* No quotation marks. Are there spaces?*/
else {
size_t rpos;
if( (rpos=tmp.rfind(' ')) != string::npos ) {
if( (rpos=tmp.rfind(' ')) != std::string::npos ) {
if( rpos == 0 ) {
tmp.clear();
}
@ -330,7 +329,7 @@ namespace MWGui
}
/* Iterate through the vector. */
for(vector<string>::iterator it=mNames.begin(); it < mNames.end();++it) {
for(std::vector<std::string>::iterator it=mNames.begin(); it < mNames.end();++it) {
bool string_different=false;
/* Is the string shorter than the input string? If yes skip it. */
@ -338,7 +337,7 @@ namespace MWGui
continue;
/* Is the beginning of the string different from the input string? If yes skip it. */
for( string::iterator iter=tmp.begin(), iter2=(*it).begin(); iter < tmp.end();iter++, iter2++) {
for( std::string::iterator iter=tmp.begin(), iter2=(*it).begin(); iter < tmp.end();iter++, iter2++) {
if( tolower(*iter) != tolower(*iter2) ) {
string_different=true;
break;
@ -361,24 +360,24 @@ namespace MWGui
/* Only one match. We're done. */
if( matches.size() == 1 ) {
/* Adding quotation marks when the input string started with a quotation mark or has spaces in it*/
if( ( matches.front().find(' ') != string::npos ) ) {
if( ( matches.front().find(' ') != std::string::npos ) ) {
if( !has_front_quote )
output.append(string("\""));
return output.append(matches.front() + string("\" "));
output.append(std::string("\""));
return output.append(matches.front() + std::string("\" "));
}
else if( has_front_quote ) {
return output.append(matches.front() + string("\" "));
return output.append(matches.front() + std::string("\" "));
}
else {
return output.append(matches.front() + string(" "));
return output.append(matches.front() + std::string(" "));
}
}
/* Check if all matching strings match further than input. If yes complete to this match. */
int i = tmp.length();
for(string::iterator iter=matches.front().begin()+tmp.length(); iter < matches.front().end(); iter++, i++) {
for(vector<string>::iterator it=matches.begin(); it < matches.end();++it) {
for(std::string::iterator iter=matches.front().begin()+tmp.length(); iter < matches.front().end(); iter++, i++) {
for(std::vector<std::string>::iterator it=matches.begin(); it < matches.end();++it) {
if( tolower((*it)[i]) != tolower(*iter) ) {
/* Append the longest match to the end of the output string*/
output.append(matches.front().substr( 0, i));

View File

@ -14,10 +14,6 @@
#include "tradewindow.hpp"
#include "inventorywindow.hpp"
using namespace MWGui;
using namespace Widgets;
namespace
{
bool compareType(std::string type1, std::string type2)
@ -68,6 +64,8 @@ namespace
}
}
namespace MWGui
{
ContainerBase::ContainerBase(DragAndDrop* dragAndDrop)
: mDragAndDrop(dragAndDrop)
@ -751,3 +749,5 @@ void ContainerWindow::onReferenceUnavailable()
{
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Container);
}
}

View File

@ -19,14 +19,12 @@
#include "inventorywindow.hpp"
#include "travelwindow.hpp"
using namespace MWGui;
using namespace Widgets;
/**
*Copied from the internet.
*/
namespace {
namespace
{
std::string lower_string(const std::string& str)
{
@ -46,7 +44,8 @@ bool sortByLength (const std::string& left, const std::string& right)
}
}
namespace MWGui
{
PersuasionDialog::PersuasionDialog()
: WindowModal("openmw_persuasion_dialog.layout")
@ -537,3 +536,4 @@ void DialogueWindow::onFrame()
mDispositionText->addText("#B29154"+boost::lexical_cast<std::string>(disp)+std::string("/100")+"#B29154");
}
}
}

View File

@ -12,8 +12,8 @@
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
using namespace MWGui;
using namespace Widgets;
namespace MWGui
{
MyGUI::UString DialogueHistory::getColorAtPos(size_t _pos)
{
@ -74,3 +74,5 @@ void DialogueHistory::addDialogText(const MyGUI::UString& parText)
addText(parText);
addText("\n");
}
}

View File

@ -9,8 +9,6 @@
#include <boost/lexical_cast.hpp>
#include <OgreUTFString.h>
using namespace MWGui;
namespace
{
int convertFromHex(std::string hex)
@ -78,6 +76,9 @@ namespace
}
}
namespace MWGui
{
std::vector<std::string> BookTextParser::split(std::string utf8Text, const int width, const int height)
{
using Ogre::UTFString;
@ -362,3 +363,5 @@ void BookTextParser::parseSubText(std::string text)
parseSubText(text.substr(tagStart, text.size()));
}
}
}

View File

@ -12,7 +12,8 @@
#include "console.hpp"
#include "spellicons.hpp"
using namespace MWGui;
namespace MWGui
{
HUD::HUD(int width, int height, int fpsLevel, DragAndDrop* dragAndDrop)
: Layout("openmw_hud.layout")
@ -537,3 +538,5 @@ void HUD::update()
{
mSpellIcons->updateWidgets(mEffectBox, true);
}
}

View File

@ -5,8 +5,11 @@
#include <MyGUI_ImageBox.h>
#include <MyGUI_ScrollBar.h>
using namespace MWGui;
using namespace MWGui::Widgets;
namespace MWGui
{
namespace Widgets
{
MWList::MWList() :
mClient(0)
@ -161,3 +164,6 @@ size_t MWScrollView::getScrollRange()
{
return getVScroll()->getScrollRange();
}
}
}

View File

@ -13,7 +13,8 @@
#include "widgets.hpp"
using namespace MWGui;
namespace MWGui
{
LocalMapBase::LocalMapBase()
: mCurX(0)
@ -440,3 +441,5 @@ void MapWindow::notifyMapChanged ()
mButton->setCaptionWithReplacing( mGlobal ? "#{sLocal}" :
"#{sWorld}");
}
}

View File

@ -5,7 +5,8 @@
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/inputmanager.hpp"
using namespace MWGui;
namespace MWGui
{
MessageBoxManager::MessageBoxManager ()
{
@ -413,3 +414,5 @@ int InteractiveMessageBox::readPressedButton ()
mButtonPressed = -1;
return pressed;
}
}

View File

@ -10,9 +10,6 @@
#include "tooltips.hpp"
using namespace MWGui;
using namespace Widgets;
namespace
{
int wrap(int index, int max)
@ -26,6 +23,9 @@ int wrap(int index, int max)
}
}
namespace MWGui
{
RaceDialog::RaceDialog()
: WindowModal("openmw_chargen_race.layout")
, mGenderIndex(0)
@ -322,7 +322,7 @@ void RaceDialog::updateSkills()
if (mCurrentRaceId.empty())
return;
MWSkillPtr skillWidget;
Widgets::MWSkillPtr skillWidget;
const int lineHeight = 18;
MyGUI::IntCoord coord1(0, 0, mSkillList->getWidth(), 18);
@ -335,10 +335,10 @@ void RaceDialog::updateSkills()
if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes
continue;
skillWidget = mSkillList->createWidget<MWSkill>("MW_StatNameValue", coord1, MyGUI::Align::Default,
skillWidget = mSkillList->createWidget<Widgets::MWSkill>("MW_StatNameValue", coord1, MyGUI::Align::Default,
std::string("Skill") + boost::lexical_cast<std::string>(i));
skillWidget->setSkillNumber(skillId);
skillWidget->setSkillValue(MWSkill::SkillValue(race->mData.mBonus[i].mBonus));
skillWidget->setSkillValue(Widgets::MWSkill::SkillValue(race->mData.mBonus[i].mBonus));
ToolTips::createSkillToolTip(skillWidget, skillId);
@ -359,7 +359,7 @@ void RaceDialog::updateSpellPowers()
if (mCurrentRaceId.empty())
return;
MWSpellPtr spellPowerWidget;
Widgets::MWSpellPtr spellPowerWidget;
const int lineHeight = 18;
MyGUI::IntCoord coord(0, 0, mSpellPowerList->getWidth(), 18);
@ -371,7 +371,7 @@ void RaceDialog::updateSpellPowers()
for (int i = 0; it != end; ++it)
{
const std::string &spellpower = *it;
spellPowerWidget = mSpellPowerList->createWidget<MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("SpellPower") + boost::lexical_cast<std::string>(i));
spellPowerWidget = mSpellPowerList->createWidget<Widgets::MWSpell>("MW_StatName", coord, MyGUI::Align::Default, std::string("SpellPower") + boost::lexical_cast<std::string>(i));
spellPowerWidget->setSpellId(spellpower);
spellPowerWidget->setUserString("ToolTipType", "Spell");
spellPowerWidget->setUserString("Spell", spellpower);
@ -382,3 +382,4 @@ void RaceDialog::updateSpellPowers()
++i;
}
}
}

View File

@ -11,8 +11,8 @@
#undef min
#undef max
using namespace MWGui;
using namespace Widgets;
namespace MWGui
{
const int ReviewDialog::sLineHeight = 18;
@ -60,13 +60,13 @@ ReviewDialog::ReviewDialog()
// Setup attributes
MWAttributePtr attribute;
Widgets::MWAttributePtr attribute;
for (int idx = 0; idx < ESM::Attribute::Length; ++idx)
{
getWidget(attribute, std::string("Attribute") + boost::lexical_cast<std::string>(idx));
mAttributeWidgets.insert(std::make_pair(static_cast<int>(ESM::Attribute::sAttributeIds[idx]), attribute));
attribute->setAttributeId(ESM::Attribute::sAttributeIds[idx]);
attribute->setAttributeValue(MWAttribute::AttributeValue(0, 0));
attribute->setAttributeValue(Widgets::MWAttribute::AttributeValue(0, 0));
}
// Setup skills
@ -155,7 +155,7 @@ void ReviewDialog::setFatigue(const MWMechanics::DynamicStat<float>& value)
void ReviewDialog::setAttribute(ESM::Attribute::AttributeID attributeId, const MWMechanics::Stat<int>& value)
{
std::map<int, MWAttributePtr>::iterator attr = mAttributeWidgets.find(static_cast<int>(attributeId));
std::map<int, Widgets::MWAttributePtr>::iterator attr = mAttributeWidgets.find(static_cast<int>(attributeId));
if (attr == mAttributeWidgets.end())
return;
@ -365,3 +365,5 @@ void ReviewDialog::onMouseWheel(MyGUI::Widget* _sender, int _rel)
else
mSkillView->setViewOffset(MyGUI::IntPoint(0, mSkillView->getViewOffset().top + _rel*0.3));
}
}

View File

@ -10,7 +10,8 @@
#include "formatting.hpp"
using namespace MWGui;
namespace MWGui
{
ScrollWindow::ScrollWindow ()
: WindowBase("openmw_scroll.layout")
@ -78,3 +79,4 @@ void ScrollWindow::onTakeButtonClicked (MyGUI::Widget* _sender)
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Scroll);
}
}

View File

@ -13,7 +13,9 @@
#include "tooltips.hpp"
using namespace MWGui;
namespace MWGui
{
const int StatsWindow::sLineHeight = 18;
StatsWindow::StatsWindow ()
@ -572,3 +574,4 @@ void StatsWindow::onPinToggled()
{
MWBase::Environment::get().getWindowManager()->setHMSVisibility(!mPinned);
}
}

View File

@ -3,7 +3,8 @@
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/environment.hpp"
using namespace MWGui;
namespace MWGui
{
TextInputDialog::TextInputDialog()
: WindowModal("openmw_text_input.layout")
@ -68,3 +69,5 @@ void TextInputDialog::onTextAccepted(MyGUI::Edit* _sender)
else
eventDone(this);
}
}

View File

@ -9,8 +9,8 @@
#include "mapwindow.hpp"
#include "inventorywindow.hpp"
using namespace MWGui;
using namespace MyGUI;
namespace MWGui
{
ToolTips::ToolTips() :
Layout("openmw_tooltips.layout")
@ -62,7 +62,7 @@ void ToolTips::onFrame(float frameDuration)
mMainWidget->getChildAt(i)->setVisible(false);
}
const IntSize &viewSize = RenderManager::getInstance().getViewSize();
const MyGUI::IntSize &viewSize = MyGUI::RenderManager::getInstance().getViewSize();
if (!mEnabled)
{
@ -71,7 +71,7 @@ void ToolTips::onFrame(float frameDuration)
if (!mGameMode)
{
const MyGUI::IntPoint& mousePos = InputManager::getInstance().getMousePosition();
const MyGUI::IntPoint& mousePos = MyGUI::InputManager::getInstance().getMousePosition();
if (MWBase::Environment::get().getWindowManager()->getWorldMouseOver() && ((MWBase::Environment::get().getWindowManager()->getMode() == GM_Console)
|| (MWBase::Environment::get().getWindowManager()->getMode() == GM_Container)
@ -84,7 +84,7 @@ void ToolTips::onFrame(float frameDuration)
const MWWorld::Class& objectclass = MWWorld::Class::get (mFocusObject);
IntSize tooltipSize;
MyGUI::IntSize tooltipSize;
if ((!objectclass.hasToolTip(mFocusObject))&&(MWBase::Environment::get().getWindowManager()->getMode() == GM_Console))
{
setCoord(0, 0, 300, 300);
@ -97,7 +97,7 @@ void ToolTips::onFrame(float frameDuration)
else
tooltipSize = getToolTipViaPtr(true);
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
MyGUI::IntPoint tooltipPosition = MyGUI::InputManager::getInstance().getMousePosition() + MyGUI::IntPoint(0, 24);
// make the tooltip stay completely in the viewport
if ((tooltipPosition.left + tooltipSize.width) > viewSize.width)
@ -114,7 +114,7 @@ void ToolTips::onFrame(float frameDuration)
else
{
const MyGUI::IntPoint& lastPressed = InputManager::getInstance().getLastPressedPosition(MyGUI::MouseButton::Left);
const MyGUI::IntPoint& lastPressed = MyGUI::InputManager::getInstance().getLastPressedPosition(MyGUI::MouseButton::Left);
if (mousePos == lastPressed) // mouseclick makes tooltip disappear
return;
@ -135,11 +135,11 @@ void ToolTips::onFrame(float frameDuration)
if (mRemainingDelay > 0)
return;
Widget* focus = InputManager::getInstance().getMouseFocusWidget();
MyGUI::Widget* focus = MyGUI::InputManager::getInstance().getMouseFocusWidget();
if (focus == 0)
return;
IntSize tooltipSize;
MyGUI::IntSize tooltipSize;
// try to go 1 level up until there is a widget that has tooltip
// this is necessary because some skin elements are actually separate widgets
@ -252,7 +252,7 @@ void ToolTips::onFrame(float frameDuration)
else
throw std::runtime_error ("unknown tooltip type");
IntPoint tooltipPosition = InputManager::getInstance().getMousePosition() + IntPoint(0, 24);
MyGUI::IntPoint tooltipPosition = MyGUI::InputManager::getInstance().getMousePosition() + MyGUI::IntPoint(0, 24);
// make the tooltip stay completely in the viewport
if ((tooltipPosition.left + tooltipSize.width) > viewSize.width)
@ -271,7 +271,7 @@ void ToolTips::onFrame(float frameDuration)
{
if (!mFocusObject.isEmpty())
{
IntSize tooltipSize = getToolTipViaPtr();
MyGUI::IntSize tooltipSize = getToolTipViaPtr();
setCoord(viewSize.width/2 - tooltipSize.width/2,
std::max(0, int(mFocusToolTipY*viewSize.height - tooltipSize.height)),
@ -298,12 +298,12 @@ void ToolTips::setFocusObject(const MWWorld::Ptr& focus)
mFocusObject = focus;
}
IntSize ToolTips::getToolTipViaPtr (bool image)
MyGUI::IntSize ToolTips::getToolTipViaPtr (bool image)
{
// this the maximum width of the tooltip before it starts word-wrapping
setCoord(0, 0, 300, 300);
IntSize tooltipSize;
MyGUI::IntSize tooltipSize;
const MWWorld::Class& object = MWWorld::Class::get (mFocusObject);
if (!object.hasToolTip(mFocusObject))
@ -337,7 +337,7 @@ void ToolTips::findImageExtension(std::string& image)
}
}
IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
MyGUI::IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
{
mDynamicToolTipBox->setVisible(true);
@ -371,7 +371,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
// this the maximum width of the tooltip before it starts word-wrapping
setCoord(0, 0, 300, 300);
const IntPoint padding(8, 8);
const MyGUI::IntPoint padding(8, 8);
const int maximumWidth = 500;
@ -381,32 +381,32 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
std::string realImage = "icons\\" + image;
findImageExtension(realImage);
EditBox* captionWidget = mDynamicToolTipBox->createWidget<EditBox>("NormalText", IntCoord(0, 0, 300, 300), Align::Left | Align::Top, "ToolTipCaption");
MyGUI::EditBox* captionWidget = mDynamicToolTipBox->createWidget<MyGUI::EditBox>("NormalText", MyGUI::IntCoord(0, 0, 300, 300), MyGUI::Align::Left | MyGUI::Align::Top, "ToolTipCaption");
captionWidget->setProperty("Static", "true");
captionWidget->setCaptionWithReplacing(caption);
IntSize captionSize = captionWidget->getTextSize();
MyGUI::IntSize captionSize = captionWidget->getTextSize();
int captionHeight = std::max(caption != "" ? captionSize.height : 0, imageSize);
EditBox* textWidget = mDynamicToolTipBox->createWidget<EditBox>("SandText", IntCoord(0, captionHeight+imageCaptionVPadding, 300, 300-captionHeight-imageCaptionVPadding), Align::Stretch, "ToolTipText");
MyGUI::EditBox* textWidget = mDynamicToolTipBox->createWidget<MyGUI::EditBox>("SandText", MyGUI::IntCoord(0, captionHeight+imageCaptionVPadding, 300, 300-captionHeight-imageCaptionVPadding), MyGUI::Align::Stretch, "ToolTipText");
textWidget->setProperty("Static", "true");
textWidget->setProperty("MultiLine", "true");
textWidget->setProperty("WordWrap", info.wordWrap ? "true" : "false");
textWidget->setCaptionWithReplacing(text);
textWidget->setTextAlign(Align::HCenter | Align::Top);
IntSize textSize = textWidget->getTextSize();
textWidget->setTextAlign(MyGUI::Align::HCenter | MyGUI::Align::Top);
MyGUI::IntSize textSize = textWidget->getTextSize();
captionSize += IntSize(imageSize, 0); // adjust for image
IntSize totalSize = IntSize( std::min(std::max(textSize.width,captionSize.width + ((image != "") ? imageCaptionHPadding : 0)),maximumWidth),
captionSize += MyGUI::IntSize(imageSize, 0); // adjust for image
MyGUI::IntSize totalSize = MyGUI::IntSize( std::min(std::max(textSize.width,captionSize.width + ((image != "") ? imageCaptionHPadding : 0)),maximumWidth),
((text != "") ? textSize.height + imageCaptionVPadding : 0) + captionHeight );
if (!info.effects.empty())
{
Widget* effectArea = mDynamicToolTipBox->createWidget<Widget>("",
IntCoord(0, totalSize.height, 300, 300-totalSize.height),
Align::Stretch, "ToolTipEffectArea");
MyGUI::Widget* effectArea = mDynamicToolTipBox->createWidget<MyGUI::Widget>("",
MyGUI::IntCoord(0, totalSize.height, 300, 300-totalSize.height),
MyGUI::Align::Stretch, "ToolTipEffectArea");
IntCoord coord(0, 6, totalSize.width, 24);
MyGUI::IntCoord coord(0, 6, totalSize.width, 24);
/**
* \todo
@ -415,7 +415,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
*/
Widgets::MWEffectListPtr effectsWidget = effectArea->createWidget<Widgets::MWEffectList>
("MW_StatName", coord, Align::Default, "ToolTipEffectsWidget");
("MW_StatName", coord, MyGUI::Align::Default, "ToolTipEffectsWidget");
effectsWidget->setEffectList(info.effects);
std::vector<MyGUI::Widget*> effectItems;
@ -427,14 +427,14 @@ 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");
MyGUI::Widget* enchantArea = mDynamicToolTipBox->createWidget<MyGUI::Widget>("",
MyGUI::IntCoord(0, totalSize.height, 300, 300-totalSize.height),
MyGUI::Align::Stretch, "ToolTipEnchantArea");
IntCoord coord(0, 6, totalSize.width, 24);
MyGUI::IntCoord coord(0, 6, totalSize.width, 24);
Widgets::MWEffectListPtr enchantWidget = enchantArea->createWidget<Widgets::MWEffectList>
("MW_StatName", coord, Align::Default, "ToolTipEnchantWidget");
("MW_StatName", coord, MyGUI::Align::Default, "ToolTipEnchantWidget");
enchantWidget->setEffectList(Widgets::MWEffectList::effectListFromESM(&enchant->mEffects));
std::vector<MyGUI::Widget*> enchantEffectItems;
@ -451,7 +451,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
const int chargeWidth = 204;
TextBox* chargeText = enchantArea->createWidget<TextBox>("SandText", IntCoord(0, 0, 10, 18), Align::Default, "ToolTipEnchantChargeText");
MyGUI::TextBox* chargeText = enchantArea->createWidget<MyGUI::TextBox>("SandText", MyGUI::IntCoord(0, 0, 10, 18), MyGUI::Align::Default, "ToolTipEnchantChargeText");
chargeText->setCaptionWithReplacing("#{sCharges}");
const int chargeTextWidth = chargeText->getTextSize().width + 5;
@ -462,18 +462,18 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
chargeText->setCoord((totalSize.width - chargeAndTextWidth)/2, coord.top+6, chargeTextWidth, 18);
IntCoord chargeCoord;
MyGUI::IntCoord chargeCoord;
if (totalSize.width < chargeWidth)
{
totalSize.width = chargeWidth;
chargeCoord = IntCoord(0, coord.top+6, chargeWidth, 18);
chargeCoord = MyGUI::IntCoord(0, coord.top+6, chargeWidth, 18);
}
else
{
chargeCoord = IntCoord((totalSize.width - chargeAndTextWidth)/2 + chargeTextWidth, coord.top+6, chargeWidth, 18);
chargeCoord = MyGUI::IntCoord((totalSize.width - chargeAndTextWidth)/2 + chargeTextWidth, coord.top+6, chargeWidth, 18);
}
Widgets::MWDynamicStatPtr chargeWidget = enchantArea->createWidget<Widgets::MWDynamicStat>
("MW_ChargeBar", chargeCoord, Align::Default, "ToolTipEnchantCharge");
("MW_ChargeBar", chargeCoord, MyGUI::Align::Default, "ToolTipEnchantCharge");
chargeWidget->setValue(charge, charge);
totalSize.height += 24;
}
@ -497,23 +497,23 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
}else{
horizontal_scroll = 80 - mHorizontalScrollIndex;
}
captionWidget->setPosition (IntPoint(horizontal_scroll, captionWidget->getPosition().top + padding.top));
captionWidget->setPosition (MyGUI::IntPoint(horizontal_scroll, captionWidget->getPosition().top + padding.top));
} else {
captionWidget->setPosition (captionWidget->getPosition() + padding);
}
textWidget->setPosition (textWidget->getPosition() + IntPoint(0, padding.top)); // only apply vertical padding, the horizontal works automatically due to Align::HCenter
textWidget->setPosition (textWidget->getPosition() + MyGUI::IntPoint(0, padding.top)); // only apply vertical padding, the horizontal works automatically due to Align::HCenter
if (image != "")
{
ImageBox* imageWidget = mDynamicToolTipBox->createWidget<ImageBox>("ImageBox",
IntCoord((totalSize.width - captionSize.width - imageCaptionHPadding)/2, 0, imageSize, imageSize),
Align::Left | Align::Top, "ToolTipImage");
MyGUI::ImageBox* imageWidget = mDynamicToolTipBox->createWidget<MyGUI::ImageBox>("ImageBox",
MyGUI::IntCoord((totalSize.width - captionSize.width - imageCaptionHPadding)/2, 0, imageSize, imageSize),
MyGUI::Align::Left | MyGUI::Align::Top, "ToolTipImage");
imageWidget->setImageTexture(realImage);
imageWidget->setPosition (imageWidget->getPosition() + padding);
}
totalSize += IntSize(padding.left*2, padding.top*2);
totalSize += MyGUI::IntSize(padding.left*2, padding.top*2);
return totalSize;
}
@ -767,3 +767,5 @@ void ToolTips::setDelay(float delay)
mDelay = delay;
mRemainingDelay = mDelay;
}
}

View File

@ -12,8 +12,10 @@
#undef min
#undef max
using namespace MWGui;
using namespace MWGui::Widgets;
namespace MWGui
{
namespace Widgets
{
/* Helper functions */
@ -21,7 +23,7 @@ using namespace MWGui::Widgets;
* Fixes the filename of a texture path to use the correct .dds extension.
* This is needed on some ESM entries which point to a .tga file instead.
*/
void MWGui::Widgets::fixTexturePath(std::string &path)
void fixTexturePath(std::string &path)
{
int offset = path.rfind(".");
if (offset < 0)
@ -891,3 +893,5 @@ void VBox::onWidgetCreated(MyGUI::Widget* _widget)
{
align();
}
}
}

View File

@ -39,7 +39,8 @@
#include "companionwindow.hpp"
#include "inventorywindow.hpp"
using namespace MWGui;
namespace MWGui
{
WindowManager::WindowManager(
const Compiler::Extensions& extensions, int fpsLevel, bool newGame, OEngine::Render::OgreRenderer *ogre,
@ -1179,3 +1180,5 @@ void WindowManager::frameStarted (float dt)
{
mInventoryWindow->doRenderUpdate ();
}
}

View File

@ -2,8 +2,8 @@
#include "exposedwindow.hpp"
using namespace MWGui;
namespace MWGui
{
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout)
: WindowBase(parLayout), mPinned(false), mVisible(false)
{
@ -24,3 +24,4 @@ void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
onPinToggled();
}
}

View File

@ -548,7 +548,7 @@ namespace MWMechanics
float bribeMod;
if (type == PT_Bribe10) bribeMod = gmst.find("fBribe10Mod")->getFloat();
if (type == PT_Bribe100) bribeMod = gmst.find("fBribe100Mod")->getFloat();
else if (type == PT_Bribe100) bribeMod = gmst.find("fBribe100Mod")->getFloat();
else bribeMod = gmst.find("fBribe1000Mod")->getFloat();
float target3 = d * (playerRating3 - npcRating3 + 50) + bribeMod;

View File

@ -1,5 +1,5 @@
#include "pathfinding.hpp"
#include <boost/graph/astar_search.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/adjacency_list.hpp>
#include "boost/tuple/tuple.hpp"
#include "OgreMath.h"
@ -55,7 +55,7 @@ namespace
struct found_path {};
class goalVisited : public boost::default_astar_visitor
/*class goalVisited : public boost::default_astar_visitor
{
public:
goalVisited(PointID goal) : mGoal(goal) {}
@ -69,7 +69,7 @@ namespace
PointID mGoal;
};
class DistanceHeuristic : public boost::astar_heuristic <PathGridGraph, float>
class DistanceHeuristic : public boost::atasr_heuristic <PathGridGraph, float>
{
public:
DistanceHeuristic(const PathGridGraph & l, PointID goal)
@ -87,11 +87,23 @@ namespace
private:
const PathGridGraph & mGraph;
PointID mGoal;
};
}
};*/
namespace MWMechanics
class goalVisited : public boost::default_dijkstra_visitor
{
public:
goalVisited(PointID goal) : mGoal(goal) {}
void examine_vertex(PointID u, const PathGridGraph g)
{
if(u == mGoal)
throw found_path();
}
private:
PointID mGoal;
};
PathGridGraph buildGraph(const ESM::Pathgrid* pathgrid,float xCell = 0,float yCell = 0)
{
PathGridGraph graph;
@ -126,11 +138,10 @@ namespace MWMechanics
std::list<ESM::Pathgrid::Point> shortest_path;
try {
boost::astar_search
boost::dijkstra_shortest_paths
(
graph,
start,
DistanceHeuristic(graph,end),
boost::predecessor_map(&p[0]).distance_map(&d[0]).visitor(goalVisited(end))//.weight_map(boost::get(&Edge::distance, graph))
);
@ -146,6 +157,10 @@ namespace MWMechanics
//end of helpers functions
}
namespace MWMechanics
{
PathFinder::PathFinder()
{
mIsPathConstructed = false;

View File

@ -415,8 +415,18 @@ namespace MWWorld
}
};
struct DynamicExtCmp
{
bool operator()(const std::pair<int, int> &left, const std::pair<int, int> &right) const {
if (left.first == right.first) {
return left.second < right.second;
}
return left.first < right.first;
}
};
typedef std::map<std::string, ESM::Cell> DynamicInt;
typedef std::map<std::pair<int, int>, ESM::Cell> DynamicExt;
typedef std::map<std::pair<int, int>, ESM::Cell, DynamicExtCmp> DynamicExt;
DynamicInt mInt;
DynamicExt mExt;

View File

@ -511,8 +511,8 @@ namespace Physic
void PhysicEngine::stepSimulation(double deltaT)
{
// This isn't needed as there are no dynamic objects at this point
//dynamicsWorld->stepSimulation(deltaT,10, 1/60.0);
// This seems to be needed for character controller objects
dynamicsWorld->stepSimulation(deltaT,10, 1/60.0);
if(isDebugCreated)
{
mDebugDrawer->step();

View File

@ -3,7 +3,7 @@ OpenMW: A reimplementation of The Elder Scrolls III: Morrowind
OpenMW is an attempt at recreating the engine for the popular role-playing game
Morrowind by Bethesda Softworks. You need to own and install the original game for OpenMW to work.
Version: 0.22.0
Version: 0.23.0
License: GPL (see GPL3.txt for more information)
Website: http://www.openmw.org
@ -94,6 +94,65 @@ Allowed options:
CHANGELOG
0.23.0
Bug #522: Player collides with placeable items
Bug #553: Open/Close sounds played when accessing main menu w/ Journal Open
Bug #561: Tooltip word wrapping delay
Bug #578: Bribing works incorrectly
Bug #601: PositionCell fails on negative coordinates
Bug #606: Some NPCs hairs not rendered with Better Heads addon
Bug #609: Bad rendering of bone boots
Bug #613: Messagebox causing assert to fail
Bug #631: Segfault on shutdown
Bug #634: Exception when talking to Calvus Horatius in Mournhold, royal palace courtyard
Bug #635: Scale NPCs depending on race
Bug #643: Dialogue Race select function is inverted
Bug #646: Twohanded weapons don't work properly
Bug #654: Crash when dropping objects without a collision shape
Bug #655/656: Objects that were disabled or deleted (but not both) were added to the scene when re-entering a cell
Bug #660: "g" in "change" cut off in Race Menu
Bug #661: Arrille sells me the key to his upstairs room
Bug #662: Day counter starts at 2 instead of 1
Bug #663: Cannot select "come unprepared" topic in dialog with Dagoth Ur
Bug #665: Pickpocket -> "Grab all" grabs all NPC inventory, even not listed in container window.
Bug #666: Looking up/down problem
Bug #667: Active effects border visible during loading
Bug #669: incorrect player position at new game start
Bug #670: race selection menu: sex, face and hair left button not totally clickable
Bug #671: new game: player is naked
Bug #674: buying or selling items doesn't change amount of gold
Bug #675: fatigue is not set to its maximum when starting a new game
Bug #678: Wrong rotation order causes RefData's rotation to be stored incorrectly
Bug #680: different gold coins in Tel Mara
Bug #682: Race menu ignores playable flag for some hairs and faces
Bug #685: Script compiler does not accept ":" after a function name
Bug #688: dispose corpse makes cross-hair to disappear
Bug #691: Auto equipping ignores equipment conditions
Bug #692: OpenMW doesnt load "loose file" texture packs that places resources directly in data folder
Bug #696: Draugr incorrect head offset
Bug #697: Sail transparency issue
Bug #700: "On the rocks" mod does not load its UV coordinates correctly.
Bug #702: Some race mods don't work
Bug #711: Crash during character creation
Bug #715: Growing Tauryon
Feature #55/657: Item Repairing
Feature #62/87: Enchanting
Feature #99: Pathfinding
Feature #104: AI Package: Travel
Feature #129: Levelled items
Feature #204: Texture animations
Feature #239: Fallback-Settings
Feature #535: Console object selection improvements
Feature #629: Add levelup description in levelup layout dialog
Feature #630: Optional format subrecord in (tes3) header
Feature #641: Armor rating
Feature #645: OnDeath script function
Feature #683: Companion item UI
Feature #698: Basic Particles
Task #648: Split up components/esm/loadlocks
Task #695: mwgui cleanup
0.22.0
Bug #311: Potential infinite recursion in script compiler