Untitled
unknown
plain_text
a year ago
4.3 kB
14
Indexable
diff --git a/s3ll_client/Srcs/Client/UserInterface/PythonBackgroundModule.cpp b/s3ll_client/Srcs/Client/UserInterface/PythonBackgroundModule.cpp
index dec01b43..dcfdb652 100644
--- a/s3ll_client/Srcs/Client/UserInterface/PythonBackgroundModule.cpp
+++ b/s3ll_client/Srcs/Client/UserInterface/PythonBackgroundModule.cpp
@@ -475,6 +475,25 @@ PyObject * backgroundGlobalPositionToMapInfo(PyObject * poSelf, PyObject * poArg
return Py_BuildValue("sii", "", 0, 0);
}
+PyObject * backgroundGlobalPositionToSizeInfo(PyObject * poSelf, PyObject * poArgs)
+{
+ int iX;
+ if (!PyTuple_GetInteger(poArgs, 0, &iX))
+ return Py_BadArgument();
+
+ int iY;
+ if (!PyTuple_GetInteger(poArgs, 1, &iY))
+ return Py_BadArgument();
+
+ CPythonBackground& rkBG=CPythonBackground::Instance();
+ CPythonBackground::TMapInfo* pkMapInfo=rkBG.GlobalPositionToMapInfo(iX, iY);
+
+ if (pkMapInfo)
+ return Py_BuildValue("sii", pkMapInfo->m_strName.c_str(), pkMapInfo->m_dwSizeX, pkMapInfo->m_dwSizeY);
+ else
+ return Py_BuildValue("sii", "", 0, 0);
+}
+
PyObject * backgroundWarpTest(PyObject * poSelf, PyObject * poArgs)
{
int iX;
@@ -530,6 +549,7 @@ void initBackground()
{ "EnableSnow", backgroundEnableSnow, METH_VARARGS },
{ "GlobalPositionToLocalPosition", backgroundGlobalPositionToLocalPosition, METH_VARARGS },
{ "GlobalPositionToMapInfo", backgroundGlobalPositionToMapInfo, METH_VARARGS },
+ { "GlobalPositionToSizeInfo", backgroundGlobalPositionToSizeInfo, METH_VARARGS },
{ "GetRenderShadowTime", backgroundGetRenderShadowTime, METH_VARARGS },
{ "LoadMap", backgroundLoadMap, METH_VARARGS },
{ "Destroy", backgroundDestroy, METH_VARARGS },
diff --git a/s3ll_pack/pack/root/uitooltip.py b/s3ll_pack/pack/root/uitooltip.py
index 93dd309b..af4409d9 100644
--- a/s3ll_pack/pack/root/uitooltip.py
+++ b/s3ll_pack/pack/root/uitooltip.py
@@ -1432,6 +1432,7 @@ class ItemToolTip(ToolTip):
if localeMapName!="":
self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION % (localeMapName, int(xPos-xBase)/100, int(yPos-yBase)/100), self.NORMAL_COLOR)
+ self.AppendMapImage(mapName, (xPos, yPos), (xBase, yBase))
else:
self.AppendTextLine(localeInfo.TOOLTIP_MEMORIZED_POSITION_ERROR % (int(xPos)/100, int(yPos)/100), self.NORMAL_COLOR)
dbg.TraceError("NOT_EXIST_IN_MINIMAP_ZONE_NAME_DICT: %s" % mapName)
@@ -1508,6 +1509,45 @@ class ItemToolTip(ToolTip):
self.AppendSpace(3)
self.AppendTextLine("SOCKET: {}".format(','.join([str(i) for i in metinSlot])), 0xFF00b6d6)
+ def AppendMapImage(self, mapName, pos, base):
+ xPos, yPos = pos
+ xBase, yBase = base
+ xLocalPos, yLocalPos = (int(xPos-xBase)/100, int(yPos-yBase)/100)
+ (mapName, xSize, ySize) = background.GlobalPositionToSizeInfo(xPos, yPos)
+
+ # create the image
+ mapImage = ui.ExpandedImageBox()
+ mapImage.SetParent(self)
+ mapImage.LoadImage("d:/ymir work/ui/atlas/%s/atlas.sub" % (mapName))
+ # set image scale
+ imageScale = 1.0
+ if mapImage.GetWidth() > self.toolTipWidth:
+ imageScale = float(self.toolTipWidth) / float(mapImage.GetWidth())
+ mapImage.SetScale(imageScale, imageScale)
+ # set image position
+ mapImage.SetWindowHorizontalAlignCenter()
+ mapImage.SetPosition(0, self.toolTipHeight)
+ mapImage.Show()
+
+ # create the blinking point
+ waypointHalfSize = 30/2 #"d:/ymir work/ui/minimap/mini_waypoint01.sub"
+ pointImageX = (xLocalPos / float(imageScale * xSize * 256 * 100) * float(imageScale * mapImage.GetWidth())) * 100 - waypointHalfSize
+ pointImageY = (yLocalPos / float(imageScale * ySize * 256 * 100) * float(imageScale * mapImage.GetHeight())) * 100 - waypointHalfSize
+
+ pointImage = ui.AniImageBox()
+ pointImage.SetParent(mapImage)
+ pointImage.SetDelay(6)
+ for i in xrange(1, 8):
+ pointImage.AppendImage("d:/ymir work/ui/minimap/mini_waypoint%02d.sub" % i)
+ pointImage.SetPosition(pointImageX, pointImageY)
+ pointImage.Show()
+
+ # append to the tooltip
+ self.toolTipHeight += mapImage.GetHeight()
+ self.childrenList.append(mapImage)
+ self.childrenList.append(pointImage)
+ self.ResizeToolTip()
+
def __DragonSoulInfoString (self, dwVnum):
step = (dwVnum / 100) % 10
refine = (dwVnum / 10) % 10Editor is loading...
Leave a Comment