mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 10:39:42 +00:00
Merge remote-tracking branch 'scrawl/next'
This commit is contained in:
commit
2ab96d0108
11 changed files with 46 additions and 11 deletions
|
@ -226,6 +226,7 @@ namespace MWBase
|
||||||
virtual bool getRestEnabled() = 0;
|
virtual bool getRestEnabled() = 0;
|
||||||
|
|
||||||
virtual bool getPlayerSleeping() = 0;
|
virtual bool getPlayerSleeping() = 0;
|
||||||
|
virtual void wakeUpPlayer() = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -406,16 +406,15 @@ void MapWindow::globalMapUpdatePlayer ()
|
||||||
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
|
rotatingSubskin->setCenter(MyGUI::IntPoint(16,16));
|
||||||
float angle = std::atan2(dir.x, dir.y);
|
float angle = std::atan2(dir.x, dir.y);
|
||||||
rotatingSubskin->setAngle(angle);
|
rotatingSubskin->setAngle(angle);
|
||||||
}
|
|
||||||
|
|
||||||
// set the view offset so that player is in the center
|
// set the view offset so that player is in the center
|
||||||
MyGUI::IntSize viewsize = mGlobalMap->getSize();
|
MyGUI::IntSize viewsize = mGlobalMap->getSize();
|
||||||
MyGUI::IntPoint viewoffs(0.5*viewsize.width - worldX, 0.5*viewsize.height - worldY);
|
MyGUI::IntPoint viewoffs(0.5*viewsize.width - worldX, 0.5*viewsize.height - worldY);
|
||||||
mGlobalMap->setViewOffset(viewoffs);
|
mGlobalMap->setViewOffset(viewoffs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapWindow::notifyPlayerUpdate ()
|
void MapWindow::notifyPlayerUpdate ()
|
||||||
{
|
{
|
||||||
if (mGlobal)
|
|
||||||
globalMapUpdatePlayer ();
|
globalMapUpdatePlayer ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,7 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.2);
|
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.2);
|
||||||
mProgressBar.setVisible (false);
|
mProgressBar.setVisible (false);
|
||||||
mWindowManager.popGuiMode ();
|
mWindowManager.removeGuiMode (GM_Rest);
|
||||||
mWaiting = false;
|
mWaiting = false;
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
|
@ -215,4 +215,11 @@ namespace MWGui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WaitDialog::wakeUp ()
|
||||||
|
{
|
||||||
|
mSleeping = false;
|
||||||
|
mWaiting = false;
|
||||||
|
stopWaiting();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace MWGui
|
||||||
void bedActivated() { setCanRest(true); }
|
void bedActivated() { setCanRest(true); }
|
||||||
|
|
||||||
bool getSleeping() { return mWaiting && mSleeping; }
|
bool getSleeping() { return mWaiting && mSleeping; }
|
||||||
|
void wakeUp();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
MyGUI::TextBox* mDateTimeText;
|
MyGUI::TextBox* mDateTimeText;
|
||||||
|
|
|
@ -956,6 +956,11 @@ bool WindowManager::getPlayerSleeping ()
|
||||||
return mWaitDialog->getSleeping();
|
return mWaitDialog->getSleeping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WindowManager::wakeUpPlayer()
|
||||||
|
{
|
||||||
|
mWaitDialog->wakeUp();
|
||||||
|
}
|
||||||
|
|
||||||
void WindowManager::addVisitedLocation(const std::string& name, int x, int y)
|
void WindowManager::addVisitedLocation(const std::string& name, int x, int y)
|
||||||
{
|
{
|
||||||
mMap->addVisitedLocation (name, x, y);
|
mMap->addVisitedLocation (name, x, y);
|
||||||
|
|
|
@ -209,6 +209,7 @@ namespace MWGui
|
||||||
virtual bool getRestEnabled() { return mRestAllowed; }
|
virtual bool getRestEnabled() { return mRestAllowed; }
|
||||||
|
|
||||||
virtual bool getPlayerSleeping();
|
virtual bool getPlayerSleeping();
|
||||||
|
virtual void wakeUpPlayer();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OEngine::GUI::MyGUIManager *mGuiManager;
|
OEngine::GUI::MyGUIManager *mGuiManager;
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "../mwworld/ptr.hpp"
|
#include "../mwworld/ptr.hpp"
|
||||||
|
|
||||||
#include "player.hpp"
|
#include "player.hpp"
|
||||||
|
#include "renderconst.hpp"
|
||||||
|
|
||||||
using namespace Ogre;
|
using namespace Ogre;
|
||||||
|
|
||||||
|
@ -86,6 +87,8 @@ ManualObject *Debugging::createPathgridLines(const ESM::Pathgrid *pathgrid)
|
||||||
}
|
}
|
||||||
result->end();
|
result->end();
|
||||||
|
|
||||||
|
result->setVisibilityFlags (RV_Debug);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,6 +143,8 @@ ManualObject *Debugging::createPathgridPoints(const ESM::Pathgrid *pathgrid)
|
||||||
|
|
||||||
result->end();
|
result->end();
|
||||||
|
|
||||||
|
result->setVisibilityFlags (RV_Debug);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,9 +56,9 @@ enum VisibilityFlags
|
||||||
|
|
||||||
RV_PlayerPreview = 512,
|
RV_PlayerPreview = 512,
|
||||||
|
|
||||||
RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water
|
RV_Debug = 1024,
|
||||||
|
|
||||||
/// \todo markers (normally hidden)
|
RV_Map = RV_Terrain + RV_Statics + RV_StaticsSmall + RV_Misc + RV_Water
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,5 +205,6 @@ op 0x200019e: PlaceAtMe Explicit
|
||||||
op 0x200019f: GetPcSleep
|
op 0x200019f: GetPcSleep
|
||||||
op 0x20001a0: ShowMap
|
op 0x20001a0: ShowMap
|
||||||
op 0x20001a1: FillMap
|
op 0x20001a1: FillMap
|
||||||
opcodes 0x20001a2-0x3ffffff unused
|
op 0x20001a2: WakeUpPc
|
||||||
|
opcodes 0x20001a3-0x3ffffff unused
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,16 @@ namespace MWScript
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class OpWakeUpPc : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
MWBase::Environment::get().getWindowManager ()->wakeUpPlayer();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
class OpXBox : public Interpreter::Opcode0
|
class OpXBox : public Interpreter::Opcode0
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -261,6 +271,7 @@ namespace MWScript
|
||||||
const int opcodeDontSaveObject = 0x2000153;
|
const int opcodeDontSaveObject = 0x2000153;
|
||||||
const int opcodeToggleVanityMode = 0x2000174;
|
const int opcodeToggleVanityMode = 0x2000174;
|
||||||
const int opcodeGetPcSleep = 0x200019f;
|
const int opcodeGetPcSleep = 0x200019f;
|
||||||
|
const int opcodeWakeUpPc = 0x20001a2;
|
||||||
|
|
||||||
void registerExtensions (Compiler::Extensions& extensions)
|
void registerExtensions (Compiler::Extensions& extensions)
|
||||||
{
|
{
|
||||||
|
@ -286,6 +297,7 @@ namespace MWScript
|
||||||
extensions.registerInstruction ("togglevanitymode", "", opcodeToggleVanityMode);
|
extensions.registerInstruction ("togglevanitymode", "", opcodeToggleVanityMode);
|
||||||
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
|
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
|
||||||
extensions.registerFunction ("getpcsleep", 'l', "", opcodeGetPcSleep);
|
extensions.registerFunction ("getpcsleep", 'l', "", opcodeGetPcSleep);
|
||||||
|
extensions.registerInstruction ("wakeuppc", "", opcodeWakeUpPc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
|
@ -307,6 +319,7 @@ namespace MWScript
|
||||||
interpreter.installSegment5 (opcodeDontSaveObject, new OpDontSaveObject);
|
interpreter.installSegment5 (opcodeDontSaveObject, new OpDontSaveObject);
|
||||||
interpreter.installSegment5 (opcodeToggleVanityMode, new OpToggleVanityMode);
|
interpreter.installSegment5 (opcodeToggleVanityMode, new OpToggleVanityMode);
|
||||||
interpreter.installSegment5 (opcodeGetPcSleep, new OpGetPcSleep);
|
interpreter.installSegment5 (opcodeGetPcSleep, new OpGetPcSleep);
|
||||||
|
interpreter.installSegment5 (opcodeWakeUpPc, new OpWakeUpPc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,6 +206,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
mLineDrawer->setMaterial("BtOgre/DebugLines");
|
mLineDrawer->setMaterial("BtOgre/DebugLines");
|
||||||
|
|
||||||
|
mLineDrawer->setVisibilityFlags (1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
~DebugDrawer()
|
~DebugDrawer()
|
||||||
|
|
Loading…
Reference in a new issue