mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-25 16:43:33 +00:00
player arrow
This commit is contained in:
parent
8e299bd25b
commit
9c3e1f48f0
@ -73,6 +73,7 @@ namespace MWGui
|
|||||||
setCellName("No Cell Loaded");
|
setCellName("No Cell Loaded");
|
||||||
|
|
||||||
getWidget(mMap, "Map");
|
getWidget(mMap, "Map");
|
||||||
|
getWidget(mPlayerArrow, "Compass");
|
||||||
|
|
||||||
MyGUI::Button* button;
|
MyGUI::Button* button;
|
||||||
getWidget(button, "WorldButton");
|
getWidget(button, "WorldButton");
|
||||||
@ -137,10 +138,16 @@ namespace MWGui
|
|||||||
{
|
{
|
||||||
if (mVisible) return;
|
if (mVisible) return;
|
||||||
MyGUI::IntSize size = mMap->getCanvasSize();
|
MyGUI::IntSize size = mMap->getCanvasSize();
|
||||||
MyGUI::IntPoint middle = MyGUI::IntPoint(x*size.width,y*size.height);
|
MyGUI::IntPoint middle = MyGUI::IntPoint((1/3.f + x/3.f)*size.width,(1/3.f + y/3.f)*size.height);
|
||||||
MyGUI::IntCoord viewsize = mMap->getCoord();
|
MyGUI::IntCoord viewsize = mMap->getCoord();
|
||||||
MyGUI::IntPoint pos(0.5*viewsize.width - middle.left, 0.5*viewsize.height - middle.top);
|
MyGUI::IntPoint pos(0.5*viewsize.width - middle.left, 0.5*viewsize.height - middle.top);
|
||||||
mMap->setViewOffset(pos);
|
mMap->setViewOffset(pos);
|
||||||
|
|
||||||
|
mPlayerArrow->setPosition(MyGUI::IntPoint(x*512-16, y*512-16));
|
||||||
|
|
||||||
|
MyGUI::ISubWidget* main = mPlayerArrow->getSubWidgetMain();
|
||||||
|
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
|
||||||
|
rotatingSubskin->setAngle(3.141 * 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
|
void onDragStart(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
|
||||||
@ -167,6 +174,7 @@ namespace MWGui
|
|||||||
private:
|
private:
|
||||||
std::string mPrefix;
|
std::string mPrefix;
|
||||||
MyGUI::ScrollView* mMap;
|
MyGUI::ScrollView* mMap;
|
||||||
|
MyGUI::ImageBox* mPlayerArrow;
|
||||||
MyGUI::IntPoint mLastDragPos;
|
MyGUI::IntPoint mLastDragPos;
|
||||||
int mCurX, mCurY;
|
int mCurX, mCurY;
|
||||||
bool mInterior;
|
bool mInterior;
|
||||||
|
@ -275,7 +275,7 @@ void LocalMap::setPlayerPosition (const Ogre::Vector3& position)
|
|||||||
|
|
||||||
texName = mInteriorName + "_" + coordStr(x,y);
|
texName = mInteriorName + "_" + coordStr(x,y);
|
||||||
}
|
}
|
||||||
mEnvironment->mWindowManager->setPlayerPos(1/3.f + u/3.f, 1/3.f + v/3.f);
|
mEnvironment->mWindowManager->setPlayerPos(u, v);
|
||||||
|
|
||||||
// explore radius (squared)
|
// explore radius (squared)
|
||||||
const float sqrExploreRadius = 0.01 * sFogOfWarResolution*sFogOfWarResolution;
|
const float sqrExploreRadius = 0.01 * sFogOfWarResolution*sFogOfWarResolution;
|
||||||
|
@ -14,4 +14,7 @@
|
|||||||
<BasisSkin type="MainSkin" offset = "0 0 16 16"/>
|
<BasisSkin type="MainSkin" offset = "0 0 16 16"/>
|
||||||
</Skin>
|
</Skin>
|
||||||
|
|
||||||
|
<Skin name = "RotatingSkin" size = "16 16">
|
||||||
|
<BasisSkin type="RotatingSkin" offset="0 0 16 16" align="Stretch"/>
|
||||||
|
</Skin>
|
||||||
</MyGUI>
|
</MyGUI>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<Widget type="Window" skin="MW_Window" layer="Windows" position="0 0 300 300" name="_Main">
|
<Widget type="Window" skin="MW_Window" layer="Windows" position="0 0 300 300" name="_Main">
|
||||||
<Widget type="ScrollView" skin="MW_MapView" position="0 0 284 264" align="ALIGN_STRETCH" name="Map">
|
<Widget type="ScrollView" skin="MW_MapView" position="0 0 284 264" align="ALIGN_STRETCH" name="Map">
|
||||||
<Property key="CanvasSize" value="1536 1536"/>
|
<Property key="CanvasSize" value="1536 1536"/>
|
||||||
|
|
||||||
<!-- 3x3 maps, 1024x1024 each, but we will downsample to 512 to antialias them -->
|
<!-- 3x3 maps, 1024x1024 each, but we will downsample to 512 to antialias them -->
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_0_0">
|
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_0_0">
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_0_0_fog"/>
|
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_0_0_fog"/>
|
||||||
@ -23,7 +23,10 @@
|
|||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="512 512 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_1_1">
|
<Widget type="ImageBox" skin="ImageBox" position="512 512 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_1_1">
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_1_1_fog"/>
|
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_1_1_fog">
|
||||||
|
<!-- Player arrow -->
|
||||||
|
<Widget type="ImageBox" skin="RotatingSkin" position="0 0 32 32" align="ALIGN_TOP ALIGN_LEFT" name="Compass"/>
|
||||||
|
</Widget>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="1024 512 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_2_1">
|
<Widget type="ImageBox" skin="ImageBox" position="1024 512 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_2_1">
|
||||||
@ -42,11 +45,8 @@
|
|||||||
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_2_2_fog"/>
|
<Widget type="ImageBox" skin="ImageBox" position="0 0 512 512" align="ALIGN_TOP ALIGN_LEFT" name="Map_2_2_fog"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
|
|
||||||
<!-- positioned and rotated in code -->
|
|
||||||
<Widget type="ImageBox" skin="ImageBox" position="0 0 32 32" align="ALIGN_TOP ALIGN_LEFT" name="Compass"/>
|
|
||||||
|
|
||||||
<Widget type="Button" skin="" position="0 0 1536 1536" name="EventBox" align="ALIGN_STRETCH"/>
|
<Widget type="Button" skin="" position="0 0 1536 1536" name="EventBox" align="ALIGN_STRETCH"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
<Widget type="Button" skin="MW_Button" position="213 233 61 22" align="ALIGN_BOTTOM ALIGN_RIGHT" name="WorldButton"/>
|
<Widget type="Button" skin="MW_Button" position="213 233 61 22" align="ALIGN_BOTTOM ALIGN_RIGHT" name="WorldButton"/>
|
||||||
</Widget>
|
</Widget>
|
||||||
</MyGUI>
|
</MyGUI>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user