forked from teamnwah/openmw-tes3coop
Finished merging.
This commit is contained in:
parent
8e8f80807e
commit
9dd65dce30
9 changed files with 22 additions and 25 deletions
|
@ -5,7 +5,7 @@
|
||||||
#include "window_manager.hpp"
|
#include "window_manager.hpp"
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
|
|
||||||
#include "../mwworld/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwworld/manualref.hpp"
|
#include "../mwworld/manualref.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -25,9 +25,8 @@ using namespace MWGui;
|
||||||
using namespace Widgets;
|
using namespace Widgets;
|
||||||
|
|
||||||
|
|
||||||
ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,DragAndDrop* dragAndDrop)
|
ContainerWindow::ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop)
|
||||||
: WindowBase("openmw_container_window_layout.xml", parWindowManager),
|
: WindowBase("openmw_container_window_layout.xml", parWindowManager),
|
||||||
mEnvironment(environment),
|
|
||||||
mDragAndDrop(dragAndDrop),
|
mDragAndDrop(dragAndDrop),
|
||||||
mContainer()
|
mContainer()
|
||||||
{
|
{
|
||||||
|
@ -51,9 +50,8 @@ ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Enviro
|
||||||
//mContainerWidget->eventMouseItemActivate += MyGUI::newDelegate(this,&ContainerWindow::onSelectedItem);
|
//mContainerWidget->eventMouseItemActivate += MyGUI::newDelegate(this,&ContainerWindow::onSelectedItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,DragAndDrop* dragAndDrop,std::string guiFile)
|
ContainerWindow::ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop,std::string guiFile)
|
||||||
: WindowBase(guiFile, parWindowManager),
|
: WindowBase(guiFile, parWindowManager),
|
||||||
mEnvironment(environment),
|
|
||||||
mDragAndDrop(dragAndDrop),
|
mDragAndDrop(dragAndDrop),
|
||||||
mContainer()
|
mContainer()
|
||||||
{
|
{
|
||||||
|
@ -183,7 +181,7 @@ void ContainerWindow::onByeClicked(MyGUI::Widget* _sender)
|
||||||
{
|
{
|
||||||
if(!mDragAndDrop->mIsOnDragAndDrop)
|
if(!mDragAndDrop->mIsOnDragAndDrop)
|
||||||
{
|
{
|
||||||
mEnvironment.mWindowManager->setGuiMode(GM_Game);
|
MWBase::Environment::get().getWindowManager()->setGuiMode(GM_Game);
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,8 @@ namespace MWGui
|
||||||
class ContainerWindow : public WindowBase
|
class ContainerWindow : public WindowBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,DragAndDrop* dragAndDrop);
|
ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
|
||||||
ContainerWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,DragAndDrop* dragAndDrop,
|
ContainerWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop,
|
||||||
std::string guiFile);
|
std::string guiFile);
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,7 +58,6 @@ namespace MWGui
|
||||||
virtual ~ContainerWindow();
|
virtual ~ContainerWindow();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MWWorld::Environment& mEnvironment;
|
|
||||||
std::vector<MyGUI::WidgetPtr> mContainerWidgets;
|
std::vector<MyGUI::WidgetPtr> mContainerWidgets;
|
||||||
MyGUI::ItemBoxPtr mContainerWidget;
|
MyGUI::ItemBoxPtr mContainerWidget;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#include "window_manager.hpp"
|
#include "window_manager.hpp"
|
||||||
#include "widgets.hpp"
|
#include "widgets.hpp"
|
||||||
|
|
||||||
#include "../mwworld/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwworld/manualref.hpp"
|
#include "../mwworld/manualref.hpp"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -21,14 +21,14 @@
|
||||||
namespace MWGui
|
namespace MWGui
|
||||||
{
|
{
|
||||||
|
|
||||||
InventoryWindow::InventoryWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,DragAndDrop* dragAndDrop)
|
InventoryWindow::InventoryWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop)
|
||||||
:ContainerWindow(parWindowManager,environment,dragAndDrop,"openmw_inventory_window_layout.xml")
|
:ContainerWindow(parWindowManager,dragAndDrop,"openmw_inventory_window_layout.xml")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void InventoryWindow::openInventory()
|
void InventoryWindow::openInventory()
|
||||||
{
|
{
|
||||||
open(mEnvironment.mWorld->getPlayer().getPlayer());
|
open(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -24,7 +24,7 @@ namespace MWGui
|
||||||
class InventoryWindow : public MWGui::ContainerWindow
|
class InventoryWindow : public MWGui::ContainerWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
InventoryWindow(WindowManager& parWindowManager,MWWorld::Environment& environment,DragAndDrop* dragAndDrop);
|
InventoryWindow(WindowManager& parWindowManager,DragAndDrop* dragAndDrop);
|
||||||
|
|
||||||
void openInventory();
|
void openInventory();
|
||||||
};
|
};
|
||||||
|
|
|
@ -165,7 +165,7 @@ void ToolTips::findImageExtension(std::string& image)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
{
|
{
|
||||||
std::string caption = info.caption;
|
std::string caption = info.caption;
|
||||||
std::string image = info.icon;
|
std::string image = info.icon;
|
||||||
|
|
|
@ -95,9 +95,9 @@ WindowManager::WindowManager(
|
||||||
console = new Console(w,h, extensions);
|
console = new Console(w,h, extensions);
|
||||||
mJournal = new JournalWindow(*this);
|
mJournal = new JournalWindow(*this);
|
||||||
mMessageBoxManager = new MessageBoxManager(this);
|
mMessageBoxManager = new MessageBoxManager(this);
|
||||||
mDialogueWindow = new DialogueWindow(*this,environment);
|
mDialogueWindow = new DialogueWindow(*this);
|
||||||
mContainerWindow = new ContainerWindow(*this,environment,mDragAndDrop);
|
mContainerWindow = new ContainerWindow(*this,mDragAndDrop);
|
||||||
mInventoryWindow = new InventoryWindow(*this,environment,mDragAndDrop);
|
mInventoryWindow = new InventoryWindow(*this,mDragAndDrop);
|
||||||
mToolTips = new ToolTips(this);
|
mToolTips = new ToolTips(this);
|
||||||
|
|
||||||
// The HUD is always on
|
// The HUD is always on
|
||||||
|
|
|
@ -219,7 +219,7 @@ void Objects::insertLight (const MWWorld::Ptr& ptr, float r, float g, float b, f
|
||||||
info.type = LT_Normal;
|
info.type = LT_Normal;
|
||||||
|
|
||||||
// random starting phase for the animation
|
// random starting phase for the animation
|
||||||
info.time = Ogre::Math::RangeRandom(0, 2 * M_PI);
|
info.time = Ogre::Math::RangeRandom(0, 2 * Ogre::Math::PI);
|
||||||
|
|
||||||
// adjust the lights depending if we're in an interior or exterior cell
|
// adjust the lights depending if we're in an interior or exterior cell
|
||||||
// quadratic means the light intensity falls off quite fast, resulting in a
|
// quadratic means the light intensity falls off quite fast, resulting in a
|
||||||
|
@ -367,7 +367,7 @@ void Objects::update(const float dt)
|
||||||
|
|
||||||
// Light animation (pulse & flicker)
|
// Light animation (pulse & flicker)
|
||||||
it->time += dt;
|
it->time += dt;
|
||||||
const float phase = std::fmod(static_cast<double> (it->time), (32 * 2 * M_PI)) * 20;
|
const float phase = std::fmod(static_cast<double> (it->time), static_cast<double>(32 * 2 * Ogre::Math::PI)) * 20;
|
||||||
float pulseConstant;
|
float pulseConstant;
|
||||||
|
|
||||||
// These formulas are just guesswork, but they work pretty well
|
// These formulas are just guesswork, but they work pretty well
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "actionopen.hpp"
|
#include "actionopen.hpp"
|
||||||
|
|
||||||
#include "environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "class.hpp"
|
#include "class.hpp"
|
||||||
#include "world.hpp"
|
#include "world.hpp"
|
||||||
#include "containerstore.hpp"
|
#include "containerstore.hpp"
|
||||||
|
@ -14,9 +14,9 @@ namespace MWWorld
|
||||||
mContainer = container;
|
mContainer = container;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ActionOpen::execute (Environment& environment)
|
void ActionOpen::execute ()
|
||||||
{
|
{
|
||||||
environment.mWindowManager->setGuiMode(MWGui::GM_Container);
|
MWBase::Environment::get().getWindowManager()->setGuiMode(MWGui::GM_Container);
|
||||||
environment.mWindowManager->getContainerWindow()->open(mContainer);
|
MWBase::Environment::get().getWindowManager()->getContainerWindow()->open(mContainer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace MWWorld
|
||||||
public:
|
public:
|
||||||
ActionOpen (const Ptr& container);
|
ActionOpen (const Ptr& container);
|
||||||
///< \param The Container the Player has activated.
|
///< \param The Container the Player has activated.
|
||||||
virtual void execute (Environment& environment);
|
virtual void execute ();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue