mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 00:45:32 +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 getPlayerSleeping() = 0;
|
||||
virtual void wakeUpPlayer() = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -406,16 +406,15 @@ void MapWindow::globalMapUpdatePlayer ()
|
|||
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);
|
||||
// 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 ()
|
||||
{
|
||||
if (mGlobal)
|
||||
globalMapUpdatePlayer ();
|
||||
globalMapUpdatePlayer ();
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ namespace MWGui
|
|||
{
|
||||
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.2);
|
||||
mProgressBar.setVisible (false);
|
||||
mWindowManager.popGuiMode ();
|
||||
mWindowManager.removeGuiMode (GM_Rest);
|
||||
mWaiting = false;
|
||||
|
||||
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); }
|
||||
|
||||
bool getSleeping() { return mWaiting && mSleeping; }
|
||||
void wakeUp();
|
||||
|
||||
protected:
|
||||
MyGUI::TextBox* mDateTimeText;
|
||||
|
|
|
@ -956,6 +956,11 @@ bool WindowManager::getPlayerSleeping ()
|
|||
return mWaitDialog->getSleeping();
|
||||
}
|
||||
|
||||
void WindowManager::wakeUpPlayer()
|
||||
{
|
||||
mWaitDialog->wakeUp();
|
||||
}
|
||||
|
||||
void WindowManager::addVisitedLocation(const std::string& name, int x, int y)
|
||||
{
|
||||
mMap->addVisitedLocation (name, x, y);
|
||||
|
|
|
@ -209,6 +209,7 @@ namespace MWGui
|
|||
virtual bool getRestEnabled() { return mRestAllowed; }
|
||||
|
||||
virtual bool getPlayerSleeping();
|
||||
virtual void wakeUpPlayer();
|
||||
|
||||
private:
|
||||
OEngine::GUI::MyGUIManager *mGuiManager;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "../mwworld/ptr.hpp"
|
||||
|
||||
#include "player.hpp"
|
||||
#include "renderconst.hpp"
|
||||
|
||||
using namespace Ogre;
|
||||
|
||||
|
@ -86,6 +87,8 @@ ManualObject *Debugging::createPathgridLines(const ESM::Pathgrid *pathgrid)
|
|||
}
|
||||
result->end();
|
||||
|
||||
result->setVisibilityFlags (RV_Debug);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -140,6 +143,8 @@ ManualObject *Debugging::createPathgridPoints(const ESM::Pathgrid *pathgrid)
|
|||
|
||||
result->end();
|
||||
|
||||
result->setVisibilityFlags (RV_Debug);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,9 +56,9 @@ enum VisibilityFlags
|
|||
|
||||
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 0x20001a0: ShowMap
|
||||
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
|
||||
{
|
||||
public:
|
||||
|
@ -261,6 +271,7 @@ namespace MWScript
|
|||
const int opcodeDontSaveObject = 0x2000153;
|
||||
const int opcodeToggleVanityMode = 0x2000174;
|
||||
const int opcodeGetPcSleep = 0x200019f;
|
||||
const int opcodeWakeUpPc = 0x20001a2;
|
||||
|
||||
void registerExtensions (Compiler::Extensions& extensions)
|
||||
{
|
||||
|
@ -286,6 +297,7 @@ namespace MWScript
|
|||
extensions.registerInstruction ("togglevanitymode", "", opcodeToggleVanityMode);
|
||||
extensions.registerInstruction ("tvm", "", opcodeToggleVanityMode);
|
||||
extensions.registerFunction ("getpcsleep", 'l', "", opcodeGetPcSleep);
|
||||
extensions.registerInstruction ("wakeuppc", "", opcodeWakeUpPc);
|
||||
}
|
||||
|
||||
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||
|
@ -307,6 +319,7 @@ namespace MWScript
|
|||
interpreter.installSegment5 (opcodeDontSaveObject, new OpDontSaveObject);
|
||||
interpreter.installSegment5 (opcodeToggleVanityMode, new OpToggleVanityMode);
|
||||
interpreter.installSegment5 (opcodeGetPcSleep, new OpGetPcSleep);
|
||||
interpreter.installSegment5 (opcodeWakeUpPc, new OpWakeUpPc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -206,6 +206,8 @@ public:
|
|||
}
|
||||
|
||||
mLineDrawer->setMaterial("BtOgre/DebugLines");
|
||||
|
||||
mLineDrawer->setVisibilityFlags (1024);
|
||||
}
|
||||
|
||||
~DebugDrawer()
|
||||
|
|
Loading…
Reference in a new issue