forked from teamnwah/openmw-tes3coop
Deleted *_* files in MwGui, builds.
This commit is contained in:
parent
ce9bc6d9ba
commit
d768f6b57e
13 changed files with 3 additions and 1581 deletions
|
@ -24,9 +24,9 @@ add_openmw_dir (mwinput
|
|||
)
|
||||
|
||||
add_openmw_dir (mwgui
|
||||
text_input widgets race class birth review windowmanagerimp console dialogue
|
||||
dialogue_history window_base stats_window messagebox journalwindow charactercreation
|
||||
map_window window_pinnable_base tooltips scrollwindow bookwindow list
|
||||
textinput widgets race class birth review windowmanagerimp console dialogue
|
||||
dialoguehistory windowbase statswindow messagebox journalwindow charactercreation
|
||||
mapwindow windowpinnablebase tooltips scrollwindow bookwindow list
|
||||
formatting inventorywindow container hud countdialog tradewindow settingswindow
|
||||
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
|
||||
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
|
||||
|
|
|
@ -1,76 +0,0 @@
|
|||
#include "dialogue_history.hpp"
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "widgets.hpp"
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
using namespace MWGui;
|
||||
using namespace Widgets;
|
||||
|
||||
MyGUI::UString DialogueHistory::getColorAtPos(size_t _pos)
|
||||
{
|
||||
MyGUI::UString colour = MyGUI::TextIterator::convertTagColour(getTextColour());
|
||||
MyGUI::TextIterator iterator(getCaption());
|
||||
while(iterator.moveNext())
|
||||
{
|
||||
size_t pos = iterator.getPosition();
|
||||
iterator.getTagColour(colour);
|
||||
if (pos < _pos)
|
||||
continue;
|
||||
else if (pos == _pos)
|
||||
break;
|
||||
}
|
||||
return colour;
|
||||
}
|
||||
|
||||
MyGUI::UString DialogueHistory::getColorTextAt(size_t _pos)
|
||||
{
|
||||
bool breakOnNext = false;
|
||||
MyGUI::UString colour = MyGUI::TextIterator::convertTagColour(getTextColour());
|
||||
MyGUI::UString colour2 = colour;
|
||||
MyGUI::TextIterator iterator(getCaption());
|
||||
MyGUI::TextIterator col_start = iterator;
|
||||
while(iterator.moveNext())
|
||||
{
|
||||
size_t pos = iterator.getPosition();
|
||||
iterator.getTagColour(colour);
|
||||
if(colour != colour2)
|
||||
{
|
||||
if(breakOnNext)
|
||||
{
|
||||
return getOnlyText().substr(col_start.getPosition(), iterator.getPosition()-col_start.getPosition());
|
||||
}
|
||||
col_start = iterator;
|
||||
colour2 = colour;
|
||||
}
|
||||
if (pos < _pos)
|
||||
continue;
|
||||
else if (pos == _pos)
|
||||
{
|
||||
breakOnNext = true;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void DialogueHistory::addDialogHeading(const MyGUI::UString& parText)
|
||||
{
|
||||
MyGUI::UString head("\n#D8C09A");
|
||||
head.append(parText);
|
||||
head.append("#B29154\n");
|
||||
addText(head);
|
||||
}
|
||||
|
||||
void DialogueHistory::addDialogText(const MyGUI::UString& parText)
|
||||
{
|
||||
addText(parText);
|
||||
addText("\n");
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#ifndef MWGUI_DIALOGE_HISTORY_H
|
||||
#define MWGUI_DIALOGE_HISTORY_H
|
||||
#include <openengine/gui/layout.hpp>
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class DialogueHistory : public MyGUI::EditBox
|
||||
{
|
||||
MYGUI_RTTI_DERIVED( DialogueHistory )
|
||||
public:
|
||||
Widget* getClient() { return mClient; }
|
||||
MyGUI::UString getColorAtPos(size_t _pos);
|
||||
MyGUI::UString getColorTextAt(size_t _pos);
|
||||
void addDialogHeading(const MyGUI::UString& parText);
|
||||
void addDialogText(const MyGUI::UString& parText);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,446 +0,0 @@
|
|||
#include "map_window.hpp"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <OgreVector2.h>
|
||||
#include <OgreTextureManager.h>
|
||||
#include <OgreSceneNode.h>
|
||||
|
||||
#include <MyGUI_Gui.h>
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwworld/player.hpp"
|
||||
|
||||
#include "../mwrender/globalmap.hpp"
|
||||
|
||||
#include "widgets.hpp"
|
||||
|
||||
using namespace MWGui;
|
||||
|
||||
LocalMapBase::LocalMapBase()
|
||||
: mCurX(0)
|
||||
, mCurY(0)
|
||||
, mInterior(false)
|
||||
, mFogOfWar(true)
|
||||
, mLocalMap(NULL)
|
||||
, mMapDragAndDrop(false)
|
||||
, mPrefix()
|
||||
, mChanged(true)
|
||||
, mLayout(NULL)
|
||||
, mLastPositionX(0.0f)
|
||||
, mLastPositionY(0.0f)
|
||||
, mLastDirectionX(0.0f)
|
||||
, mLastDirectionY(0.0f)
|
||||
, mCompass(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
void LocalMapBase::init(MyGUI::ScrollView* widget, MyGUI::ImageBox* compass, OEngine::GUI::Layout* layout, bool mapDragAndDrop)
|
||||
{
|
||||
mLocalMap = widget;
|
||||
mLayout = layout;
|
||||
mMapDragAndDrop = mapDragAndDrop;
|
||||
mCompass = compass;
|
||||
|
||||
// create 3x3 map widgets, 512x512 each, holding a 1024x1024 texture each
|
||||
const int widgetSize = 512;
|
||||
for (int mx=0; mx<3; ++mx)
|
||||
{
|
||||
for (int my=0; my<3; ++my)
|
||||
{
|
||||
MyGUI::ImageBox* map = mLocalMap->createWidget<MyGUI::ImageBox>("ImageBox",
|
||||
MyGUI::IntCoord(mx*widgetSize, my*widgetSize, widgetSize, widgetSize),
|
||||
MyGUI::Align::Top | MyGUI::Align::Left, "Map_" + boost::lexical_cast<std::string>(mx) + "_" + boost::lexical_cast<std::string>(my));
|
||||
|
||||
MyGUI::ImageBox* fog = map->createWidget<MyGUI::ImageBox>("ImageBox",
|
||||
MyGUI::IntCoord(0, 0, widgetSize, widgetSize),
|
||||
MyGUI::Align::Top | MyGUI::Align::Left, "Map_" + boost::lexical_cast<std::string>(mx) + "_" + boost::lexical_cast<std::string>(my) + "_fog");
|
||||
|
||||
if (!mMapDragAndDrop)
|
||||
{
|
||||
map->setNeedMouseFocus(false);
|
||||
fog->setNeedMouseFocus(false);
|
||||
}
|
||||
|
||||
mMapWidgets.push_back(map);
|
||||
mFogWidgets.push_back(fog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LocalMapBase::setCellPrefix(const std::string& prefix)
|
||||
{
|
||||
mPrefix = prefix;
|
||||
mChanged = true;
|
||||
}
|
||||
|
||||
void LocalMapBase::toggleFogOfWar()
|
||||
{
|
||||
mFogOfWar = !mFogOfWar;
|
||||
applyFogOfWar();
|
||||
}
|
||||
|
||||
void LocalMapBase::applyFogOfWar()
|
||||
{
|
||||
for (int mx=0; mx<3; ++mx)
|
||||
{
|
||||
for (int my=0; my<3; ++my)
|
||||
{
|
||||
std::string name = "Map_" + boost::lexical_cast<std::string>(mx) + "_"
|
||||
+ boost::lexical_cast<std::string>(my);
|
||||
|
||||
std::string image = mPrefix+"_"+ boost::lexical_cast<std::string>(mCurX + (mx-1)) + "_"
|
||||
+ boost::lexical_cast<std::string>(mCurY + (-1*(my-1)));
|
||||
MyGUI::ImageBox* fog = mFogWidgets[my + 3*mx];
|
||||
fog->setImageTexture(mFogOfWar ?
|
||||
((MyGUI::RenderManager::getInstance().getTexture(image+"_fog") != 0) ? image+"_fog"
|
||||
: "black.png" )
|
||||
: "");
|
||||
}
|
||||
}
|
||||
notifyMapChanged ();
|
||||
}
|
||||
|
||||
void LocalMapBase::onMarkerFocused (MyGUI::Widget* w1, MyGUI::Widget* w2)
|
||||
{
|
||||
applyFogOfWar ();
|
||||
}
|
||||
|
||||
void LocalMapBase::onMarkerUnfocused (MyGUI::Widget* w1, MyGUI::Widget* w2)
|
||||
{
|
||||
applyFogOfWar ();
|
||||
}
|
||||
|
||||
void LocalMapBase::setActiveCell(const int x, const int y, bool interior)
|
||||
{
|
||||
if (x==mCurX && y==mCurY && mInterior==interior && !mChanged) return; // don't do anything if we're still in the same cell
|
||||
|
||||
// clear all previous markers
|
||||
for (unsigned int i=0; i< mLocalMap->getChildCount(); ++i)
|
||||
{
|
||||
if (mLocalMap->getChildAt(i)->getName ().substr (0, 6) == "Marker")
|
||||
{
|
||||
MyGUI::Gui::getInstance ().destroyWidget (mLocalMap->getChildAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
for (int mx=0; mx<3; ++mx)
|
||||
{
|
||||
for (int my=0; my<3; ++my)
|
||||
{
|
||||
// map
|
||||
std::string image = mPrefix+"_"+ boost::lexical_cast<std::string>(x + (mx-1)) + "_"
|
||||
+ boost::lexical_cast<std::string>(y + (-1*(my-1)));
|
||||
|
||||
std::string name = "Map_" + boost::lexical_cast<std::string>(mx) + "_"
|
||||
+ boost::lexical_cast<std::string>(my);
|
||||
|
||||
MyGUI::ImageBox* box = mMapWidgets[my + 3*mx];
|
||||
|
||||
if (MyGUI::RenderManager::getInstance().getTexture(image) != 0)
|
||||
box->setImageTexture(image);
|
||||
else
|
||||
box->setImageTexture("black.png");
|
||||
|
||||
|
||||
// door markers
|
||||
|
||||
// interior map only consists of one cell, so handle the markers only once
|
||||
if (interior && (mx != 2 || my != 2))
|
||||
continue;
|
||||
|
||||
MWWorld::CellStore* cell;
|
||||
if (interior)
|
||||
cell = MWBase::Environment::get().getWorld ()->getInterior (mPrefix);
|
||||
else
|
||||
cell = MWBase::Environment::get().getWorld ()->getExterior (x+mx-1, y-(my-1));
|
||||
|
||||
std::vector<MWBase::World::DoorMarker> doors = MWBase::Environment::get().getWorld ()->getDoorMarkers (cell);
|
||||
|
||||
for (std::vector<MWBase::World::DoorMarker>::iterator it = doors.begin(); it != doors.end(); ++it)
|
||||
{
|
||||
MWBase::World::DoorMarker marker = *it;
|
||||
|
||||
// convert world coordinates to normalized cell coordinates
|
||||
MyGUI::IntCoord widgetCoord;
|
||||
float nX,nY;
|
||||
int cellDx, cellDy;
|
||||
if (!interior)
|
||||
{
|
||||
const int cellSize = 8192;
|
||||
|
||||
nX = (marker.x - cellSize * (x+mx-1)) / cellSize;
|
||||
nY = 1 - (marker.y - cellSize * (y-(my-1))) / cellSize;
|
||||
|
||||
widgetCoord = MyGUI::IntCoord(nX * 512 - 4 + mx * 512, nY * 512 - 4 + my * 512, 8, 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
Ogre::Vector2 position (marker.x, marker.y);
|
||||
MWBase::Environment::get().getWorld ()->getInteriorMapPosition (position, nX, nY, cellDx, cellDy);
|
||||
|
||||
widgetCoord = MyGUI::IntCoord(nX * 512 - 4 + (1+cellDx-x) * 512, nY * 512 - 4 + (1+cellDy-y) * 512, 8, 8);
|
||||
}
|
||||
|
||||
static int counter = 0;
|
||||
++counter;
|
||||
MyGUI::Button* markerWidget = mLocalMap->createWidget<MyGUI::Button>("ButtonImage",
|
||||
widgetCoord, MyGUI::Align::Default, "Marker" + boost::lexical_cast<std::string>(counter));
|
||||
markerWidget->setImageResource("DoorMarker");
|
||||
markerWidget->setUserString("ToolTipType", "Layout");
|
||||
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
|
||||
markerWidget->setUserString("Caption_TextOneLine", marker.name);
|
||||
markerWidget->setUserString("IsMarker", "true");
|
||||
markerWidget->eventMouseSetFocus += MyGUI::newDelegate(this, &LocalMapBase::onMarkerFocused);
|
||||
markerWidget->eventMouseLostFocus += MyGUI::newDelegate(this, &LocalMapBase::onMarkerUnfocused);
|
||||
|
||||
MarkerPosition markerPos;
|
||||
markerPos.interior = interior;
|
||||
markerPos.cellX = interior ? cellDx : x + mx - 1;
|
||||
markerPos.cellY = interior ? cellDy : y + ((my - 1)*-1);
|
||||
markerPos.nX = nX;
|
||||
markerPos.nY = nY;
|
||||
|
||||
markerWidget->setUserData(markerPos);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
mInterior = interior;
|
||||
mCurX = x;
|
||||
mCurY = y;
|
||||
mChanged = false;
|
||||
|
||||
// fog of war
|
||||
applyFogOfWar();
|
||||
|
||||
// set the compass texture again, because MyGUI determines sorting of ImageBox widgets
|
||||
// based on the last setImageTexture call
|
||||
std::string tex = "textures\\compass.dds";
|
||||
mCompass->setImageTexture("");
|
||||
mCompass->setImageTexture(tex);
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
MyGUI::IntPoint pos(0.5*viewsize.width - middle.left, 0.5*viewsize.height - middle.top);
|
||||
mLocalMap->setViewOffset(pos);
|
||||
|
||||
mCompass->setPosition(MyGUI::IntPoint(512+x*512-16, 512+y*512-16));
|
||||
mLastPositionX = x;
|
||||
mLastPositionY = y;
|
||||
}
|
||||
|
||||
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));
|
||||
float angle = std::atan2(x,y);
|
||||
rotatingSubskin->setAngle(angle);
|
||||
|
||||
mLastDirectionX = x;
|
||||
mLastDirectionY = y;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------
|
||||
|
||||
MapWindow::MapWindow(MWBase::WindowManager& parWindowManager, const std::string& cacheDir)
|
||||
: MWGui::WindowPinnableBase("openmw_map_window.layout", parWindowManager)
|
||||
, mGlobal(false)
|
||||
{
|
||||
setCoord(500,0,320,300);
|
||||
|
||||
mGlobalMapRender = new MWRender::GlobalMap(cacheDir);
|
||||
mGlobalMapRender->render();
|
||||
|
||||
getWidget(mLocalMap, "LocalMap");
|
||||
getWidget(mGlobalMap, "GlobalMap");
|
||||
getWidget(mGlobalMapImage, "GlobalMapImage");
|
||||
getWidget(mGlobalMapOverlay, "GlobalMapOverlay");
|
||||
getWidget(mPlayerArrowLocal, "CompassLocal");
|
||||
getWidget(mPlayerArrowGlobal, "CompassGlobal");
|
||||
|
||||
mGlobalMapImage->setImageTexture("GlobalMap.png");
|
||||
mGlobalMapOverlay->setImageTexture("GlobalMapOverlay");
|
||||
|
||||
mGlobalMap->setVisible (false);
|
||||
|
||||
getWidget(mButton, "WorldButton");
|
||||
mButton->eventMouseButtonClick += MyGUI::newDelegate(this, &MapWindow::onWorldButtonClicked);
|
||||
mButton->setCaptionWithReplacing("#{sWorld}");
|
||||
|
||||
getWidget(mEventBoxGlobal, "EventBoxGlobal");
|
||||
mEventBoxGlobal->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
|
||||
mEventBoxGlobal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
|
||||
getWidget(mEventBoxLocal, "EventBoxLocal");
|
||||
mEventBoxLocal->eventMouseDrag += MyGUI::newDelegate(this, &MapWindow::onMouseDrag);
|
||||
mEventBoxLocal->eventMouseButtonPressed += MyGUI::newDelegate(this, &MapWindow::onDragStart);
|
||||
|
||||
LocalMapBase::init(mLocalMap, mPlayerArrowLocal, this);
|
||||
}
|
||||
|
||||
MapWindow::~MapWindow()
|
||||
{
|
||||
delete mGlobalMapRender;
|
||||
}
|
||||
|
||||
void MapWindow::setCellName(const std::string& cellName)
|
||||
{
|
||||
setTitle("#{sCell=" + cellName + "}");
|
||||
}
|
||||
|
||||
void MapWindow::addVisitedLocation(const std::string& name, int x, int y)
|
||||
{
|
||||
float worldX, worldY;
|
||||
mGlobalMapRender->cellTopLeftCornerToImageSpace (x, y, worldX, worldY);
|
||||
|
||||
MyGUI::IntCoord widgetCoord(
|
||||
worldX * mGlobalMapRender->getWidth()+6,
|
||||
worldY * mGlobalMapRender->getHeight()+6,
|
||||
12, 12);
|
||||
|
||||
|
||||
static int _counter=0;
|
||||
MyGUI::Button* markerWidget = mGlobalMapImage->createWidget<MyGUI::Button>("ButtonImage",
|
||||
widgetCoord, MyGUI::Align::Default, "Marker" + boost::lexical_cast<std::string>(_counter));
|
||||
markerWidget->setImageResource("DoorMarker");
|
||||
markerWidget->setUserString("ToolTipType", "Layout");
|
||||
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
|
||||
markerWidget->setUserString("Caption_TextOneLine", name);
|
||||
++_counter;
|
||||
|
||||
markerWidget = mEventBoxGlobal->createWidget<MyGUI::Button>("",
|
||||
widgetCoord, MyGUI::Align::Default);
|
||||
markerWidget->setNeedMouseFocus (true);
|
||||
markerWidget->setUserString("ToolTipType", "Layout");
|
||||
markerWidget->setUserString("ToolTipLayout", "TextToolTipOneLine");
|
||||
markerWidget->setUserString("Caption_TextOneLine", name);
|
||||
}
|
||||
|
||||
void MapWindow::cellExplored(int x, int y)
|
||||
{
|
||||
mGlobalMapRender->exploreCell(x,y);
|
||||
}
|
||||
|
||||
void MapWindow::onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
|
||||
{
|
||||
if (_id!=MyGUI::MouseButton::Left) return;
|
||||
mLastDragPos = MyGUI::IntPoint(_left, _top);
|
||||
}
|
||||
|
||||
void MapWindow::onMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
|
||||
{
|
||||
if (_id!=MyGUI::MouseButton::Left) return;
|
||||
|
||||
MyGUI::IntPoint diff = MyGUI::IntPoint(_left, _top) - mLastDragPos;
|
||||
|
||||
if (!mGlobal)
|
||||
mLocalMap->setViewOffset( mLocalMap->getViewOffset() + diff );
|
||||
else
|
||||
mGlobalMap->setViewOffset( mGlobalMap->getViewOffset() + diff );
|
||||
|
||||
|
||||
mLastDragPos = MyGUI::IntPoint(_left, _top);
|
||||
}
|
||||
|
||||
void MapWindow::onWorldButtonClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
mGlobal = !mGlobal;
|
||||
mGlobalMap->setVisible(mGlobal);
|
||||
mLocalMap->setVisible(!mGlobal);
|
||||
|
||||
mButton->setCaptionWithReplacing( mGlobal ? "#{sLocal}" :
|
||||
"#{sWorld}");
|
||||
|
||||
if (mGlobal)
|
||||
globalMapUpdatePlayer ();
|
||||
}
|
||||
|
||||
void MapWindow::onPinToggled()
|
||||
{
|
||||
mWindowManager.setMinimapVisibility(!mPinned);
|
||||
}
|
||||
|
||||
void MapWindow::open()
|
||||
{
|
||||
mGlobalMap->setCanvasSize (mGlobalMapRender->getWidth(), mGlobalMapRender->getHeight());
|
||||
mGlobalMapImage->setSize(mGlobalMapRender->getWidth(), mGlobalMapRender->getHeight());
|
||||
|
||||
for (unsigned int i=0; i<mGlobalMapImage->getChildCount (); ++i)
|
||||
{
|
||||
if (mGlobalMapImage->getChildAt (i)->getName().substr(0,6) == "Marker")
|
||||
mGlobalMapImage->getChildAt (i)->castType<MyGUI::Button>()->setImageResource("DoorMarker");
|
||||
}
|
||||
|
||||
globalMapUpdatePlayer();
|
||||
|
||||
mPlayerArrowGlobal->setImageTexture ("textures\\compass.dds");
|
||||
}
|
||||
|
||||
void MapWindow::globalMapUpdatePlayer ()
|
||||
{
|
||||
Ogre::Vector3 pos = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer().getRefData ().getBaseNode ()->_getDerivedPosition ();
|
||||
Ogre::Quaternion orient = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer().getRefData ().getBaseNode ()->_getDerivedOrientation ();
|
||||
Ogre::Vector2 dir (orient.yAxis ().x, orient.yAxis().y);
|
||||
|
||||
float worldX, worldY;
|
||||
mGlobalMapRender->worldPosToImageSpace (pos.x, pos.y, worldX, worldY);
|
||||
worldX *= mGlobalMapRender->getWidth();
|
||||
worldY *= mGlobalMapRender->getHeight();
|
||||
|
||||
|
||||
// for interiors, we have no choice other than using the last position & direction.
|
||||
/// \todo save this last position in the savegame?
|
||||
if (MWBase::Environment::get().getWorld ()->isCellExterior ())
|
||||
{
|
||||
mPlayerArrowGlobal->setPosition(MyGUI::IntPoint(worldX - 16, worldY - 16));
|
||||
|
||||
MyGUI::ISubWidget* main = mPlayerArrowGlobal->getSubWidgetMain();
|
||||
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
|
||||
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
|
||||
float angle = std::atan2(dir.x, dir.y);
|
||||
rotatingSubskin->setAngle(angle);
|
||||
|
||||
// set the view offset so that player is in the center
|
||||
MyGUI::IntSize viewsize = mGlobalMap->getSize();
|
||||
MyGUI::IntPoint viewoffs(0.5*viewsize.width - worldX, 0.5*viewsize.height - worldY);
|
||||
mGlobalMap->setViewOffset(viewoffs);
|
||||
}
|
||||
}
|
||||
|
||||
void MapWindow::notifyPlayerUpdate ()
|
||||
{
|
||||
globalMapUpdatePlayer ();
|
||||
}
|
||||
|
||||
void MapWindow::notifyMapChanged ()
|
||||
{
|
||||
// workaround to prevent the map from drawing on top of the button
|
||||
MyGUI::IntCoord oldCoord = mButton->getCoord ();
|
||||
MyGUI::Gui::getInstance().destroyWidget (mButton);
|
||||
mButton = mMainWidget->createWidget<MWGui::Widgets::AutoSizedButton>("MW_Button",
|
||||
oldCoord, MyGUI::Align::Bottom | MyGUI::Align::Right);
|
||||
mButton->setProperty ("ExpandDirection", "Left");
|
||||
|
||||
mButton->eventMouseButtonClick += MyGUI::newDelegate(this, &MapWindow::onWorldButtonClicked);
|
||||
mButton->setCaptionWithReplacing( mGlobal ? "#{sLocal}" :
|
||||
"#{sWorld}");
|
||||
}
|
|
@ -1,107 +0,0 @@
|
|||
#ifndef MWGUI_MAPWINDOW_H
|
||||
#define MWGUI_MAPWINDOW_H
|
||||
|
||||
#include "window_pinnable_base.hpp"
|
||||
|
||||
namespace MWRender
|
||||
{
|
||||
class GlobalMap;
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class LocalMapBase
|
||||
{
|
||||
public:
|
||||
LocalMapBase();
|
||||
void init(MyGUI::ScrollView* widget, MyGUI::ImageBox* compass, OEngine::GUI::Layout* layout, bool mapDragAndDrop=false);
|
||||
|
||||
void setCellPrefix(const std::string& prefix);
|
||||
void setActiveCell(const int x, const int y, bool interior=false);
|
||||
void setPlayerDir(const float x, const float y);
|
||||
void setPlayerPos(const float x, const float y);
|
||||
|
||||
void toggleFogOfWar();
|
||||
|
||||
struct MarkerPosition
|
||||
{
|
||||
bool interior;
|
||||
int cellX;
|
||||
int cellY;
|
||||
float nX;
|
||||
float nY;
|
||||
};
|
||||
|
||||
protected:
|
||||
int mCurX, mCurY;
|
||||
bool mInterior;
|
||||
MyGUI::ScrollView* mLocalMap;
|
||||
MyGUI::ImageBox* mCompass;
|
||||
std::string mPrefix;
|
||||
bool mChanged;
|
||||
bool mFogOfWar;
|
||||
|
||||
std::vector<MyGUI::ImageBox*> mMapWidgets;
|
||||
std::vector<MyGUI::ImageBox*> mFogWidgets;
|
||||
|
||||
void applyFogOfWar();
|
||||
|
||||
void onMarkerFocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
|
||||
void onMarkerUnfocused(MyGUI::Widget* w1, MyGUI::Widget* w2);
|
||||
|
||||
virtual void notifyPlayerUpdate() {}
|
||||
virtual void notifyMapChanged() {}
|
||||
|
||||
OEngine::GUI::Layout* mLayout;
|
||||
|
||||
bool mMapDragAndDrop;
|
||||
|
||||
float mLastPositionX;
|
||||
float mLastPositionY;
|
||||
float mLastDirectionX;
|
||||
float mLastDirectionY;
|
||||
};
|
||||
|
||||
class MapWindow : public MWGui::WindowPinnableBase, public LocalMapBase
|
||||
{
|
||||
public:
|
||||
MapWindow(MWBase::WindowManager& parWindowManager, const std::string& cacheDir);
|
||||
virtual ~MapWindow();
|
||||
|
||||
void setCellName(const std::string& cellName);
|
||||
|
||||
void addVisitedLocation(const std::string& name, int x, int y); // adds the marker to the global map
|
||||
void cellExplored(int x, int y);
|
||||
|
||||
virtual void open();
|
||||
|
||||
private:
|
||||
void onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
|
||||
void onMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
|
||||
void onWorldButtonClicked(MyGUI::Widget* _sender);
|
||||
|
||||
void globalMapUpdatePlayer();
|
||||
|
||||
MyGUI::ScrollView* mGlobalMap;
|
||||
MyGUI::ImageBox* mGlobalMapImage;
|
||||
MyGUI::ImageBox* mGlobalMapOverlay;
|
||||
MyGUI::ImageBox* mPlayerArrowLocal;
|
||||
MyGUI::ImageBox* mPlayerArrowGlobal;
|
||||
MyGUI::Button* mButton;
|
||||
MyGUI::IntPoint mLastDragPos;
|
||||
bool mGlobal;
|
||||
|
||||
MyGUI::Button* mEventBoxGlobal;
|
||||
MyGUI::Button* mEventBoxLocal;
|
||||
|
||||
MWRender::GlobalMap* mGlobalMapRender;
|
||||
|
||||
protected:
|
||||
virtual void onPinToggled();
|
||||
|
||||
virtual void notifyPlayerUpdate();
|
||||
virtual void notifyMapChanged();
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
|
@ -1,580 +0,0 @@
|
|||
#include "stats_window.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
#include "../mwbase/mechanicsmanager.hpp"
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "../mwworld/player.hpp"
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
#include "../mwmechanics/npcstats.hpp"
|
||||
|
||||
#include "tooltips.hpp"
|
||||
|
||||
|
||||
using namespace MWGui;
|
||||
const int StatsWindow::sLineHeight = 18;
|
||||
|
||||
StatsWindow::StatsWindow (MWBase::WindowManager& parWindowManager)
|
||||
: WindowPinnableBase("openmw_stats_window.layout", parWindowManager)
|
||||
, mSkillView(NULL)
|
||||
, mClientHeight(0)
|
||||
, mMajorSkills()
|
||||
, mMinorSkills()
|
||||
, mMiscSkills()
|
||||
, mSkillValues()
|
||||
, mSkillWidgetMap()
|
||||
, mFactionWidgetMap()
|
||||
, mFactions()
|
||||
, mBirthSignId()
|
||||
, mReputation(0)
|
||||
, mBounty(0)
|
||||
, mSkillWidgets()
|
||||
, mChanged(true)
|
||||
{
|
||||
setCoord(0,0,498, 342);
|
||||
|
||||
const char *names[][2] =
|
||||
{
|
||||
{ "Attrib1", "sAttributeStrength" },
|
||||
{ "Attrib2", "sAttributeIntelligence" },
|
||||
{ "Attrib3", "sAttributeWillpower" },
|
||||
{ "Attrib4", "sAttributeAgility" },
|
||||
{ "Attrib5", "sAttributeSpeed" },
|
||||
{ "Attrib6", "sAttributeEndurance" },
|
||||
{ "Attrib7", "sAttributePersonality" },
|
||||
{ "Attrib8", "sAttributeLuck" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
|
||||
for (int i=0; names[i][0]; ++i)
|
||||
{
|
||||
setText (names[i][0], store.get<ESM::GameSetting>().find (names[i][1])->getString());
|
||||
}
|
||||
|
||||
getWidget(mSkillView, "SkillView");
|
||||
getWidget(mLeftPane, "LeftPane");
|
||||
getWidget(mRightPane, "RightPane");
|
||||
|
||||
for (int i = 0; i < ESM::Skill::Length; ++i)
|
||||
{
|
||||
mSkillValues.insert(std::pair<int, MWMechanics::Stat<float> >(i, MWMechanics::Stat<float>()));
|
||||
mSkillWidgetMap.insert(std::pair<int, MyGUI::TextBox*>(i, (MyGUI::TextBox*)NULL));
|
||||
}
|
||||
|
||||
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget);
|
||||
t->eventWindowChangeCoord += MyGUI::newDelegate(this, &StatsWindow::onWindowResize);
|
||||
}
|
||||
|
||||
void StatsWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||
{
|
||||
if (mSkillView->getViewOffset().top + _rel*0.3 > 0)
|
||||
mSkillView->setViewOffset(MyGUI::IntPoint(0, 0));
|
||||
else
|
||||
mSkillView->setViewOffset(MyGUI::IntPoint(0, mSkillView->getViewOffset().top + _rel*0.3));
|
||||
}
|
||||
|
||||
void StatsWindow::onWindowResize(MyGUI::Window* window)
|
||||
{
|
||||
mLeftPane->setCoord( MyGUI::IntCoord(0, 0, 0.44*window->getSize().width, window->getSize().height) );
|
||||
mRightPane->setCoord( MyGUI::IntCoord(0.44*window->getSize().width, 0, 0.56*window->getSize().width, window->getSize().height) );
|
||||
mSkillView->setCanvasSize (mSkillView->getWidth(), std::max(mSkillView->getHeight(), mClientHeight));
|
||||
}
|
||||
|
||||
void StatsWindow::setBar(const std::string& name, const std::string& tname, int val, int max)
|
||||
{
|
||||
MyGUI::ProgressPtr pt;
|
||||
getWidget(pt, name);
|
||||
pt->setProgressRange(max);
|
||||
pt->setProgressPosition(val);
|
||||
|
||||
std::stringstream out;
|
||||
out << val << "/" << max;
|
||||
setText(tname, out.str().c_str());
|
||||
}
|
||||
|
||||
void StatsWindow::setPlayerName(const std::string& playerName)
|
||||
{
|
||||
static_cast<MyGUI::Window*>(mMainWidget)->setCaption(playerName);
|
||||
adjustWindowCaption();
|
||||
}
|
||||
|
||||
void StatsWindow::setValue (const std::string& id, const MWMechanics::Stat<int>& value)
|
||||
{
|
||||
static const char *ids[] =
|
||||
{
|
||||
"AttribVal1", "AttribVal2", "AttribVal3", "AttribVal4", "AttribVal5",
|
||||
"AttribVal6", "AttribVal7", "AttribVal8",
|
||||
0
|
||||
};
|
||||
|
||||
for (int i=0; ids[i]; ++i)
|
||||
if (ids[i]==id)
|
||||
{
|
||||
std::ostringstream valueString;
|
||||
valueString << value.getModified();
|
||||
setText (id, valueString.str());
|
||||
|
||||
MyGUI::TextBox* box;
|
||||
getWidget(box, id);
|
||||
|
||||
if (value.getModified()>value.getBase())
|
||||
box->_setWidgetState("increased");
|
||||
else if (value.getModified()<value.getBase())
|
||||
box->_setWidgetState("decreased");
|
||||
else
|
||||
box->_setWidgetState("normal");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value)
|
||||
{
|
||||
static const char *ids[] =
|
||||
{
|
||||
"HBar", "MBar", "FBar",
|
||||
0
|
||||
};
|
||||
|
||||
for (int i=0; ids[i]; ++i)
|
||||
{
|
||||
if (ids[i]==id)
|
||||
{
|
||||
std::string id (ids[i]);
|
||||
setBar (id, id + "T", static_cast<int>(value.getCurrent()), static_cast<int>(value.getModified()));
|
||||
|
||||
// health, magicka, fatigue tooltip
|
||||
MyGUI::Widget* w;
|
||||
std::string valStr = boost::lexical_cast<std::string>(value.getCurrent()) + "/" + boost::lexical_cast<std::string>(value.getModified());
|
||||
if (i==0)
|
||||
{
|
||||
getWidget(w, "Health");
|
||||
w->setUserString("Caption_HealthDescription", "#{sHealthDesc}\n" + valStr);
|
||||
}
|
||||
else if (i==1)
|
||||
{
|
||||
getWidget(w, "Magicka");
|
||||
w->setUserString("Caption_HealthDescription", "#{sIntDesc}\n" + valStr);
|
||||
}
|
||||
else if (i==2)
|
||||
{
|
||||
getWidget(w, "Fatigue");
|
||||
w->setUserString("Caption_HealthDescription", "#{sFatDesc}\n" + valStr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::setValue (const std::string& id, const std::string& value)
|
||||
{
|
||||
if (id=="name")
|
||||
setPlayerName (value);
|
||||
else if (id=="race")
|
||||
setText ("RaceText", value);
|
||||
else if (id=="class")
|
||||
setText ("ClassText", value);
|
||||
}
|
||||
|
||||
void StatsWindow::setValue (const std::string& id, int value)
|
||||
{
|
||||
if (id=="level")
|
||||
{
|
||||
std::ostringstream text;
|
||||
text << value;
|
||||
setText("LevelText", text.str());
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value)
|
||||
{
|
||||
mSkillValues[parSkill] = value;
|
||||
MyGUI::TextBox* widget = mSkillWidgetMap[(int)parSkill];
|
||||
if (widget)
|
||||
{
|
||||
float modified = value.getModified(), base = value.getBase();
|
||||
std::string text = boost::lexical_cast<std::string>(std::floor(modified));
|
||||
std::string state = "normal";
|
||||
if (modified > base)
|
||||
state = "increased";
|
||||
else if (modified < base)
|
||||
state = "decreased";
|
||||
|
||||
widget->setCaption(text);
|
||||
widget->_setWidgetState(state);
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::configureSkills (const std::vector<int>& major, const std::vector<int>& minor)
|
||||
{
|
||||
mMajorSkills = major;
|
||||
mMinorSkills = minor;
|
||||
|
||||
// Update misc skills with the remaining skills not in major or minor
|
||||
std::set<int> skillSet;
|
||||
std::copy(major.begin(), major.end(), std::inserter(skillSet, skillSet.begin()));
|
||||
std::copy(minor.begin(), minor.end(), std::inserter(skillSet, skillSet.begin()));
|
||||
boost::array<ESM::Skill::SkillEnum, ESM::Skill::Length>::const_iterator end = ESM::Skill::sSkillIds.end();
|
||||
mMiscSkills.clear();
|
||||
for (boost::array<ESM::Skill::SkillEnum, ESM::Skill::Length>::const_iterator it = ESM::Skill::sSkillIds.begin(); it != end; ++it)
|
||||
{
|
||||
int skill = *it;
|
||||
if (skillSet.find(skill) == skillSet.end())
|
||||
mMiscSkills.push_back(skill);
|
||||
}
|
||||
|
||||
updateSkillArea();
|
||||
}
|
||||
|
||||
void StatsWindow::onFrame ()
|
||||
{
|
||||
if (!mMainWidget->getVisible())
|
||||
return;
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
MWMechanics::NpcStats PCstats = MWWorld::Class::get(player).getNpcStats(player);
|
||||
|
||||
// level progress
|
||||
MyGUI::Widget* levelWidget;
|
||||
for (int i=0; i<2; ++i)
|
||||
{
|
||||
getWidget(levelWidget, i==0 ? "Level_str" : "LevelText");
|
||||
levelWidget->setUserString("RangePosition_LevelProgress", boost::lexical_cast<std::string>(PCstats.getLevelProgress()));
|
||||
levelWidget->setUserString("Caption_LevelProgressText", boost::lexical_cast<std::string>(PCstats.getLevelProgress()) + "/10");
|
||||
}
|
||||
|
||||
setFactions(PCstats.getFactionRanks());
|
||||
setExpelled(PCstats.getExpelled ());
|
||||
|
||||
const std::string &signId =
|
||||
MWBase::Environment::get().getWorld()->getPlayer().getBirthSign();
|
||||
|
||||
setBirthSign(signId);
|
||||
setReputation (PCstats.getReputation ());
|
||||
setBounty (PCstats.getBounty ());
|
||||
|
||||
if (mChanged)
|
||||
updateSkillArea();
|
||||
}
|
||||
|
||||
void StatsWindow::setFactions (const FactionList& factions)
|
||||
{
|
||||
if (mFactions != factions)
|
||||
{
|
||||
mFactions = factions;
|
||||
mChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::setExpelled (const std::set<std::string>& expelled)
|
||||
{
|
||||
if (mExpelled != expelled)
|
||||
{
|
||||
mExpelled = expelled;
|
||||
mChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::setBirthSign (const std::string& signId)
|
||||
{
|
||||
if (signId != mBirthSignId)
|
||||
{
|
||||
mBirthSignId = signId;
|
||||
mChanged = true;
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||
{
|
||||
MyGUI::ImageBox* separator = mSkillView->createWidget<MyGUI::ImageBox>("MW_HLine",
|
||||
MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18),
|
||||
MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
|
||||
separator->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
mSkillWidgets.push_back(separator);
|
||||
|
||||
coord1.top += separator->getHeight();
|
||||
coord2.top += separator->getHeight();
|
||||
}
|
||||
|
||||
void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||
{
|
||||
MyGUI::TextBox* groupWidget = mSkillView->createWidget<MyGUI::TextBox>("SandBrightText",
|
||||
MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height),
|
||||
MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
|
||||
groupWidget->setCaption(label);
|
||||
groupWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
mSkillWidgets.push_back(groupWidget);
|
||||
|
||||
coord1.top += sLineHeight;
|
||||
coord2.top += sLineHeight;
|
||||
}
|
||||
|
||||
MyGUI::TextBox* StatsWindow::addValueItem(const std::string& text, const std::string &value, const std::string& state, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||
{
|
||||
MyGUI::TextBox *skillNameWidget, *skillValueWidget;
|
||||
|
||||
skillNameWidget = mSkillView->createWidget<MyGUI::TextBox>("SandText", coord1, MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
|
||||
skillNameWidget->setCaption(text);
|
||||
skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
|
||||
skillValueWidget = mSkillView->createWidget<MyGUI::TextBox>("SandTextRight", coord2, MyGUI::Align::Right | MyGUI::Align::Top);
|
||||
skillValueWidget->setCaption(value);
|
||||
skillValueWidget->_setWidgetState(state);
|
||||
skillValueWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
|
||||
mSkillWidgets.push_back(skillNameWidget);
|
||||
mSkillWidgets.push_back(skillValueWidget);
|
||||
|
||||
coord1.top += sLineHeight;
|
||||
coord2.top += sLineHeight;
|
||||
|
||||
return skillValueWidget;
|
||||
}
|
||||
|
||||
MyGUI::Widget* StatsWindow::addItem(const std::string& text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||
{
|
||||
MyGUI::TextBox* skillNameWidget;
|
||||
|
||||
skillNameWidget = mSkillView->createWidget<MyGUI::TextBox>("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
|
||||
skillNameWidget->setCaption(text);
|
||||
skillNameWidget->eventMouseWheel += MyGUI::newDelegate(this, &StatsWindow::onMouseWheel);
|
||||
|
||||
mSkillWidgets.push_back(skillNameWidget);
|
||||
|
||||
coord1.top += sLineHeight;
|
||||
coord2.top += sLineHeight;
|
||||
|
||||
return skillNameWidget;
|
||||
}
|
||||
|
||||
void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
|
||||
{
|
||||
// Add a line separator if there are items above
|
||||
if (!mSkillWidgets.empty())
|
||||
{
|
||||
addSeparator(coord1, coord2);
|
||||
}
|
||||
|
||||
addGroup(mWindowManager.getGameSettingString(titleId, titleDefault), coord1, coord2);
|
||||
|
||||
SkillList::const_iterator end = skills.end();
|
||||
for (SkillList::const_iterator it = skills.begin(); it != end; ++it)
|
||||
{
|
||||
int skillId = *it;
|
||||
if (skillId < 0 || skillId > ESM::Skill::Length) // Skip unknown skill indexes
|
||||
continue;
|
||||
assert(skillId >= 0 && skillId < ESM::Skill::Length);
|
||||
const std::string &skillNameId = ESM::Skill::sSkillNameIds[skillId];
|
||||
const MWMechanics::Stat<float> &stat = mSkillValues.find(skillId)->second;
|
||||
float base = stat.getBase();
|
||||
float modified = stat.getModified();
|
||||
int progressPercent = (modified - float(static_cast<int>(modified))) * 100;
|
||||
|
||||
const MWWorld::ESMStore &esmStore =
|
||||
MWBase::Environment::get().getWorld()->getStore();
|
||||
|
||||
const ESM::Skill* skill = esmStore.get<ESM::Skill>().find(skillId);
|
||||
assert(skill);
|
||||
|
||||
std::string icon = "icons\\k\\" + ESM::Skill::sIconNames[skillId];
|
||||
|
||||
const ESM::Attribute* attr =
|
||||
esmStore.get<ESM::Attribute>().find(skill->mData.mAttribute);
|
||||
assert(attr);
|
||||
|
||||
std::string state = "normal";
|
||||
if (modified > base)
|
||||
state = "increased";
|
||||
else if (modified < base)
|
||||
state = "decreased";
|
||||
MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId),
|
||||
boost::lexical_cast<std::string>(static_cast<int>(modified)), state, coord1, coord2);
|
||||
|
||||
for (int i=0; i<2; ++i)
|
||||
{
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ToolTipType", "Layout");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ToolTipLayout", "SkillToolTip");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillName", "#{"+skillNameId+"}");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillDescription", skill->mDescription);
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillAttribute", "#{sGoverningAttribute}: #{" + attr->mName + "}");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ImageTexture_SkillImage", icon);
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_SkillProgressText", boost::lexical_cast<std::string>(progressPercent)+"/100");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Range_SkillProgress", "100");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("RangePosition_SkillProgress", boost::lexical_cast<std::string>(progressPercent));
|
||||
}
|
||||
|
||||
mSkillWidgetMap[skillId] = widget;
|
||||
}
|
||||
}
|
||||
|
||||
void StatsWindow::updateSkillArea()
|
||||
{
|
||||
mChanged = false;
|
||||
|
||||
for (std::vector<MyGUI::Widget*>::iterator it = mSkillWidgets.begin(); it != mSkillWidgets.end(); ++it)
|
||||
{
|
||||
MyGUI::Gui::getInstance().destroyWidget(*it);
|
||||
}
|
||||
mSkillWidgets.clear();
|
||||
|
||||
mSkillView->setViewOffset (MyGUI::IntPoint(0,0));
|
||||
mClientHeight = 0;
|
||||
|
||||
const int valueSize = 40;
|
||||
MyGUI::IntCoord coord1(10, 0, mSkillView->getWidth() - (10 + valueSize) - 24, 18);
|
||||
MyGUI::IntCoord coord2(coord1.left + coord1.width, coord1.top, valueSize, coord1.height);
|
||||
|
||||
if (!mMajorSkills.empty())
|
||||
addSkills(mMajorSkills, "sSkillClassMajor", "Major Skills", coord1, coord2);
|
||||
|
||||
if (!mMinorSkills.empty())
|
||||
addSkills(mMinorSkills, "sSkillClassMinor", "Minor Skills", coord1, coord2);
|
||||
|
||||
if (!mMiscSkills.empty())
|
||||
addSkills(mMiscSkills, "sSkillClassMisc", "Misc Skills", coord1, coord2);
|
||||
|
||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||
const MWWorld::ESMStore &store = world->getStore();
|
||||
const ESM::NPC *player =
|
||||
world->getPlayer().getPlayer().get<ESM::NPC>()->mBase;
|
||||
|
||||
// race tooltip
|
||||
const ESM::Race* playerRace = store.get<ESM::Race>().find(player->mRace);
|
||||
|
||||
MyGUI::Widget* raceWidget;
|
||||
getWidget(raceWidget, "RaceText");
|
||||
ToolTips::createRaceToolTip(raceWidget, playerRace);
|
||||
getWidget(raceWidget, "Race_str");
|
||||
ToolTips::createRaceToolTip(raceWidget, playerRace);
|
||||
|
||||
// class tooltip
|
||||
MyGUI::Widget* classWidget;
|
||||
|
||||
const ESM::Class *playerClass =
|
||||
store.get<ESM::Class>().find(player->mClass);
|
||||
|
||||
getWidget(classWidget, "ClassText");
|
||||
ToolTips::createClassToolTip(classWidget, *playerClass);
|
||||
getWidget(classWidget, "Class_str");
|
||||
ToolTips::createClassToolTip(classWidget, *playerClass);
|
||||
|
||||
if (!mFactions.empty())
|
||||
{
|
||||
// Add a line separator if there are items above
|
||||
if (!mSkillWidgets.empty())
|
||||
addSeparator(coord1, coord2);
|
||||
|
||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||
MWMechanics::NpcStats PCstats = MWWorld::Class::get(player).getNpcStats(player);
|
||||
std::set<std::string>& expelled = PCstats.getExpelled ();
|
||||
|
||||
addGroup(mWindowManager.getGameSettingString("sFaction", "Faction"), coord1, coord2);
|
||||
FactionList::const_iterator end = mFactions.end();
|
||||
for (FactionList::const_iterator it = mFactions.begin(); it != end; ++it)
|
||||
{
|
||||
const ESM::Faction *faction =
|
||||
store.get<ESM::Faction>().find(it->first);
|
||||
MyGUI::Widget* w = addItem(faction->mName, coord1, coord2);
|
||||
|
||||
std::string text;
|
||||
|
||||
text += std::string("#DDC79E") + faction->mName;
|
||||
|
||||
if (expelled.find(it->first) != expelled.end())
|
||||
text += "\n#{sExpelled}";
|
||||
else
|
||||
{
|
||||
text += std::string("\n#BF9959") + faction->mRanks[it->second];
|
||||
|
||||
if (it->second < 9)
|
||||
{
|
||||
// player doesn't have max rank yet
|
||||
text += std::string("\n\n#DDC79E#{sNextRank} ") + faction->mRanks[it->second+1];
|
||||
|
||||
ESM::RankData rankData = faction->mData.mRankData[it->second+1];
|
||||
const ESM::Attribute* attr1 = store.get<ESM::Attribute>().find(faction->mData.mAttribute[0]);
|
||||
const ESM::Attribute* attr2 = store.get<ESM::Attribute>().find(faction->mData.mAttribute[1]);
|
||||
assert(attr1 && attr2);
|
||||
|
||||
text += "\n#BF9959#{" + attr1->mName + "}: " + boost::lexical_cast<std::string>(rankData.mAttribute1)
|
||||
+ ", #{" + attr2->mName + "}: " + boost::lexical_cast<std::string>(rankData.mAttribute2);
|
||||
|
||||
text += "\n\n#DDC79E#{sFavoriteSkills}";
|
||||
text += "\n#BF9959";
|
||||
for (int i=0; i<6; ++i)
|
||||
{
|
||||
text += "#{"+ESM::Skill::sSkillNameIds[faction->mData.mSkills[i]]+"}";
|
||||
if (i<5)
|
||||
text += ", ";
|
||||
}
|
||||
|
||||
text += "\n";
|
||||
|
||||
if (rankData.mSkill1 > 0)
|
||||
text += "\n#{sNeedOneSkill} " + boost::lexical_cast<std::string>(rankData.mSkill1);
|
||||
if (rankData.mSkill2 > 0)
|
||||
text += "\n#{sNeedTwoSkills} " + boost::lexical_cast<std::string>(rankData.mSkill2);
|
||||
}
|
||||
}
|
||||
|
||||
w->setUserString("ToolTipType", "Layout");
|
||||
w->setUserString("ToolTipLayout", "TextToolTip");
|
||||
w->setUserString("Caption_Text", text);
|
||||
}
|
||||
}
|
||||
|
||||
if (!mBirthSignId.empty())
|
||||
{
|
||||
// Add a line separator if there are items above
|
||||
if (!mSkillWidgets.empty())
|
||||
addSeparator(coord1, coord2);
|
||||
|
||||
addGroup(mWindowManager.getGameSettingString("sBirthSign", "Sign"), coord1, coord2);
|
||||
const ESM::BirthSign *sign =
|
||||
store.get<ESM::BirthSign>().find(mBirthSignId);
|
||||
MyGUI::Widget* w = addItem(sign->mName, coord1, coord2);
|
||||
|
||||
ToolTips::createBirthsignToolTip(w, mBirthSignId);
|
||||
}
|
||||
|
||||
// Add a line separator if there are items above
|
||||
if (!mSkillWidgets.empty())
|
||||
addSeparator(coord1, coord2);
|
||||
|
||||
addValueItem(mWindowManager.getGameSettingString("sReputation", "Reputation"),
|
||||
boost::lexical_cast<std::string>(static_cast<int>(mReputation)), "normal", coord1, coord2);
|
||||
|
||||
for (int i=0; i<2; ++i)
|
||||
{
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ToolTipType", "Layout");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ToolTipLayout", "TextToolTip");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_Text", "#{sSkillsMenuReputationHelp}");
|
||||
}
|
||||
|
||||
addValueItem(mWindowManager.getGameSettingString("sBounty", "Bounty"),
|
||||
boost::lexical_cast<std::string>(static_cast<int>(mBounty)), "normal", coord1, coord2);
|
||||
|
||||
for (int i=0; i<2; ++i)
|
||||
{
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ToolTipType", "Layout");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("ToolTipLayout", "TextToolTip");
|
||||
mSkillWidgets[mSkillWidgets.size()-1-i]->setUserString("Caption_Text", "#{sCrimeHelp}");
|
||||
}
|
||||
|
||||
mClientHeight = coord1.top;
|
||||
|
||||
mSkillView->setCanvasSize (mSkillView->getWidth(), std::max(mSkillView->getHeight(), mClientHeight));
|
||||
}
|
||||
|
||||
void StatsWindow::onPinToggled()
|
||||
{
|
||||
mWindowManager.setHMSVisibility(!mPinned);
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
#ifndef MWGUI_STATS_WINDOW_H
|
||||
#define MWGUI_STATS_WINDOW_H
|
||||
|
||||
#include "../mwworld/esmstore.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "../mwmechanics/stat.hpp"
|
||||
#include "window_pinnable_base.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class WindowManager;
|
||||
|
||||
class StatsWindow : public WindowPinnableBase
|
||||
{
|
||||
public:
|
||||
typedef std::map<std::string, int> FactionList;
|
||||
|
||||
typedef std::vector<int> SkillList;
|
||||
|
||||
StatsWindow(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
/// automatically updates all the data in the stats window, but only if it has changed.
|
||||
void onFrame();
|
||||
|
||||
void setBar(const std::string& name, const std::string& tname, int val, int max);
|
||||
void setPlayerName(const std::string& playerName);
|
||||
|
||||
/// Set value for the given ID.
|
||||
void setValue (const std::string& id, const MWMechanics::Stat<int>& value);
|
||||
void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value);
|
||||
void setValue (const std::string& id, const std::string& value);
|
||||
void setValue (const std::string& id, int value);
|
||||
void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value);
|
||||
|
||||
void configureSkills (const SkillList& major, const SkillList& minor);
|
||||
void setReputation (int reputation) { if (reputation != mReputation) mChanged = true; this->mReputation = reputation; }
|
||||
void setBounty (int bounty) { if (bounty != mBounty) mChanged = true; this->mBounty = bounty; }
|
||||
void updateSkillArea();
|
||||
|
||||
private:
|
||||
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||
MyGUI::TextBox* addValueItem(const std::string& text, const std::string &value, const std::string& state, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||
MyGUI::Widget* addItem(const std::string& text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
||||
|
||||
void setFactions (const FactionList& factions);
|
||||
void setExpelled (const std::set<std::string>& expelled);
|
||||
void setBirthSign (const std::string &signId);
|
||||
|
||||
void onWindowResize(MyGUI::Window* window);
|
||||
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
||||
|
||||
static const int sLineHeight;
|
||||
|
||||
MyGUI::Widget* mLeftPane;
|
||||
MyGUI::Widget* mRightPane;
|
||||
|
||||
MyGUI::ScrollView* mSkillView;
|
||||
int mLastPos, mClientHeight;
|
||||
|
||||
SkillList mMajorSkills, mMinorSkills, mMiscSkills;
|
||||
std::map<int, MWMechanics::Stat<float> > mSkillValues;
|
||||
std::map<int, MyGUI::TextBox*> mSkillWidgetMap;
|
||||
std::map<std::string, MyGUI::Widget*> mFactionWidgetMap;
|
||||
FactionList mFactions; ///< Stores a list of factions and the current rank
|
||||
std::string mBirthSignId;
|
||||
int mReputation, mBounty;
|
||||
std::vector<MyGUI::Widget*> mSkillWidgets; //< Skills and other information
|
||||
std::set<std::string> mExpelled;
|
||||
|
||||
bool mChanged;
|
||||
|
||||
protected:
|
||||
virtual void onPinToggled();
|
||||
};
|
||||
}
|
||||
#endif
|
|
@ -1,69 +0,0 @@
|
|||
#include "text_input.hpp"
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
using namespace MWGui;
|
||||
|
||||
TextInputDialog::TextInputDialog(MWBase::WindowManager& parWindowManager)
|
||||
: WindowModal("openmw_text_input.layout", parWindowManager)
|
||||
{
|
||||
// Centre dialog
|
||||
center();
|
||||
|
||||
getWidget(mTextEdit, "TextEdit");
|
||||
mTextEdit->eventEditSelectAccept += newDelegate(this, &TextInputDialog::onTextAccepted);
|
||||
|
||||
MyGUI::Button* okButton;
|
||||
getWidget(okButton, "OKButton");
|
||||
okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
|
||||
|
||||
// Make sure the edit box has focus
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||
}
|
||||
|
||||
void TextInputDialog::setNextButtonShow(bool shown)
|
||||
{
|
||||
MyGUI::Button* okButton;
|
||||
getWidget(okButton, "OKButton");
|
||||
|
||||
if (shown)
|
||||
okButton->setCaption(mWindowManager.getGameSettingString("sNext", ""));
|
||||
else
|
||||
okButton->setCaption(mWindowManager.getGameSettingString("sOK", ""));
|
||||
}
|
||||
|
||||
void TextInputDialog::setTextLabel(const std::string &label)
|
||||
{
|
||||
setText("LabelT", label);
|
||||
}
|
||||
|
||||
void TextInputDialog::open()
|
||||
{
|
||||
WindowModal::open();
|
||||
// Make sure the edit box has focus
|
||||
MyGUI::InputManager::getInstance().setKeyFocusWidget(mTextEdit);
|
||||
}
|
||||
|
||||
// widget controls
|
||||
|
||||
void TextInputDialog::onOkClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
if (mTextEdit->getCaption() == "")
|
||||
{
|
||||
mWindowManager.messageBox ("#{sNotifyMessage37}");
|
||||
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
|
||||
}
|
||||
else
|
||||
eventDone(this);
|
||||
}
|
||||
|
||||
void TextInputDialog::onTextAccepted(MyGUI::Edit* _sender)
|
||||
{
|
||||
if (mTextEdit->getCaption() == "")
|
||||
{
|
||||
mWindowManager.messageBox ("#{sNotifyMessage37}");
|
||||
MyGUI::InputManager::getInstance ().setKeyFocusWidget (mTextEdit);
|
||||
}
|
||||
else
|
||||
eventDone(this);
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#ifndef MWGUI_TEXT_INPUT_H
|
||||
#define MWGUI_TEXT_INPUT_H
|
||||
|
||||
#include "window_base.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class WindowManager;
|
||||
}
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class TextInputDialog : public WindowModal
|
||||
{
|
||||
public:
|
||||
TextInputDialog(MWBase::WindowManager& parWindowManager);
|
||||
|
||||
std::string getTextInput() const { return mTextEdit ? mTextEdit->getOnlyText() : ""; }
|
||||
void setTextInput(const std::string &text) { if (mTextEdit) mTextEdit->setOnlyText(text); }
|
||||
|
||||
void setNextButtonShow(bool shown);
|
||||
void setTextLabel(const std::string &label);
|
||||
virtual void open();
|
||||
|
||||
protected:
|
||||
void onOkClicked(MyGUI::Widget* _sender);
|
||||
void onTextAccepted(MyGUI::Edit* _sender);
|
||||
|
||||
private:
|
||||
MyGUI::EditBox* mTextEdit;
|
||||
};
|
||||
}
|
||||
#endif
|
|
@ -1,55 +0,0 @@
|
|||
#include "window_base.hpp"
|
||||
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
using namespace MWGui;
|
||||
|
||||
WindowBase::WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
|
||||
: Layout(parLayout)
|
||||
, mWindowManager(parWindowManager)
|
||||
{
|
||||
}
|
||||
|
||||
void WindowBase::setVisible(bool visible)
|
||||
{
|
||||
bool wasVisible = mMainWidget->getVisible();
|
||||
mMainWidget->setVisible(visible);
|
||||
|
||||
if (visible)
|
||||
open();
|
||||
else if (wasVisible && !visible)
|
||||
close();
|
||||
}
|
||||
|
||||
void WindowBase::center()
|
||||
{
|
||||
// Centre dialog
|
||||
|
||||
// MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||
// Note by scrawl: The following works more reliably in the case when the window was _just_
|
||||
// resized and MyGUI RenderManager doesn't know about the new size yet
|
||||
MyGUI::IntSize gameWindowSize = MyGUI::IntSize(Settings::Manager::getInt("resolution x", "Video"),
|
||||
Settings::Manager::getInt("resolution y", "Video"));
|
||||
|
||||
MyGUI::IntCoord coord = mMainWidget->getCoord();
|
||||
coord.left = (gameWindowSize.width - coord.width)/2;
|
||||
coord.top = (gameWindowSize.height - coord.height)/2;
|
||||
mMainWidget->setCoord(coord);
|
||||
}
|
||||
|
||||
WindowModal::WindowModal(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
|
||||
: WindowBase(parLayout, parWindowManager)
|
||||
{
|
||||
}
|
||||
|
||||
void WindowModal::open()
|
||||
{
|
||||
MyGUI::InputManager::getInstance ().addWidgetModal (mMainWidget);
|
||||
}
|
||||
|
||||
void WindowModal::close()
|
||||
{
|
||||
MyGUI::InputManager::getInstance ().removeWidgetModal (mMainWidget);
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
#ifndef MWGUI_WINDOW_BASE_H
|
||||
#define MWGUI_WINDOW_BASE_H
|
||||
|
||||
#include <openengine/gui/layout.hpp>
|
||||
|
||||
namespace MWBase
|
||||
{
|
||||
class WindowManager;
|
||||
}
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class WindowManager;
|
||||
|
||||
class WindowBase: public OEngine::GUI::Layout
|
||||
{
|
||||
public:
|
||||
WindowBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
|
||||
|
||||
// Events
|
||||
typedef MyGUI::delegates::CMultiDelegate1<WindowBase*> EventHandle_WindowBase;
|
||||
|
||||
virtual void open() {}
|
||||
virtual void close () {}
|
||||
virtual void setVisible(bool visible);
|
||||
void center();
|
||||
|
||||
/** Event : Dialog finished, OK button clicked.\n
|
||||
signature : void method()\n
|
||||
*/
|
||||
EventHandle_WindowBase eventDone;
|
||||
|
||||
protected:
|
||||
/// \todo remove
|
||||
MWBase::WindowManager& mWindowManager;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* "Modal" windows cause the rest of the interface to be unaccessible while they are visible
|
||||
*/
|
||||
class WindowModal : public WindowBase
|
||||
{
|
||||
public:
|
||||
WindowModal(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
|
||||
virtual void open();
|
||||
virtual void close();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,28 +0,0 @@
|
|||
#include "window_pinnable_base.hpp"
|
||||
|
||||
#include "../mwbase/windowmanager.hpp"
|
||||
|
||||
#include "exposedwindow.hpp"
|
||||
|
||||
using namespace MWGui;
|
||||
|
||||
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
|
||||
: WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false)
|
||||
{
|
||||
ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
|
||||
mPinButton = window->getSkinWidget ("Button");
|
||||
|
||||
mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked);
|
||||
}
|
||||
|
||||
void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
|
||||
{
|
||||
mPinned = !mPinned;
|
||||
|
||||
if (mPinned)
|
||||
mPinButton->changeWidgetSkin ("PinDown");
|
||||
else
|
||||
mPinButton->changeWidgetSkin ("PinUp");
|
||||
|
||||
onPinToggled();
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
#ifndef MWGUI_WINDOW_PINNABLE_BASE_H
|
||||
#define MWGUI_WINDOW_PINNABLE_BASE_H
|
||||
|
||||
#include "window_base.hpp"
|
||||
|
||||
namespace MWGui
|
||||
{
|
||||
class WindowManager;
|
||||
|
||||
class WindowPinnableBase: public WindowBase
|
||||
{
|
||||
public:
|
||||
WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
|
||||
bool pinned() { return mPinned; }
|
||||
|
||||
private:
|
||||
void onPinButtonClicked(MyGUI::Widget* _sender);
|
||||
|
||||
protected:
|
||||
virtual void onPinToggled() = 0;
|
||||
|
||||
MyGUI::Widget* mPinButton;
|
||||
bool mPinned;
|
||||
bool mVisible;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue