0817 01:09:39872 :: Traceback (most recent call last):
0817 01:09:39872 :: File "game.py", line 1420, in OnMouseLeftButtonUp
0817 01:09:39873 :: File "interfaceModule.py", line 353, in MakeHyperlinkTooltip
0817 01:09:39873 :: File "uiToolTip.py", line 1851, in SetHyperlinkItem
0817 01:09:39873 :: File "uiToolTip.py", line 926, in AddItemData
0817 01:09:39873 :: File "uiToolTip.py", line 1645, in __AppendMetinSlotInfo
0817 01:09:39873 :: IndexError
0817 01:09:39873 :: :
0817 01:09:39873 :: list index out of range
0817 01:09:39873 ::
__AppendMetinSlotInfo
fonksiyonun tamamını kod bloğuna ekler misiniz? def __AppendMetinSlotInfo(self, metinSlot):
if self.__AppendMetinSlotInfo_IsEmptySlotList(metinSlot):
return
for i in xrange(player.METIN_SOCKET_MAX_NUM):
self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i]) (1645. satır burası )
def __AppendMetinSlotInfo_IsEmptySlotList(self, metinSlot):
if 0 == metinSlot:
return 1
for i in xrange(player.METIN_SOCKET_MAX_NUM):
metinSlotData=metinSlot[i]
if 0 != self.GetMetinSocketType(metinSlotData):
if 0 != self.GetMetinItemIndex(metinSlotData):
return 0
return 1
def __AppendMetinSlotInfo_AppendMetinSocketData(self, index, metinSlotData, custumAffectString="", custumAffectString2="", leftTime=0):
slotType = self.GetMetinSocketType(metinSlotData)
itemIndex = self.GetMetinItemIndex(metinSlotData)
if 0 == slotType:
return
self.AppendSpace(5)
slotImage = ui.ImageBox()
slotImage.SetParent(self)
slotImage.Show()
## Name
nameTextLine = ui.TextLine()
nameTextLine.SetParent(self)
nameTextLine.SetFontName(self.defFontName)
nameTextLine.SetPackedFontColor(self.NORMAL_COLOR)
nameTextLine.SetOutline()
nameTextLine.SetFeather()
nameTextLine.Show()
self.childrenList.append(nameTextLine)
if player.METIN_SOCKET_TYPE_SILVER == slotType:
slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_silver.sub")
elif player.METIN_SOCKET_TYPE_GOLD == slotType:
slotImage.LoadImage("d:/ymir work/ui/game/windows/metin_slot_gold.sub")
self.childrenList.append(slotImage)
if localeInfo.IsARABIC():
slotImage.SetPosition(self.toolTipWidth - slotImage.GetWidth() - 9, self.toolTipHeight-1)
nameTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 2)
else:
slotImage.SetPosition(9, self.toolTipHeight-1)
nameTextLine.SetPosition(50, self.toolTipHeight + 2)
metinImage = ui.ImageBox()
metinImage.SetParent(self)
metinImage.Show()
self.childrenList.append(metinImage)
if itemIndex:
item.SelectItem(itemIndex)
## Image
try:
metinImage.LoadImage(item.GetIconImageFileName())
except:
dbg.TraceError("ItemToolTip.__AppendMetinSocketData() - Failed to find image file %d:%s" %
(itemIndex, item.GetIconImageFileName())
)
nameTextLine.SetText(item.GetItemName())
## Affect
affectTextLine = ui.TextLine()
affectTextLine.SetParent(self)
affectTextLine.SetFontName(self.defFontName)
affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
affectTextLine.SetOutline()
affectTextLine.SetFeather()
affectTextLine.Show()
if localeInfo.IsARABIC():
metinImage.SetPosition(self.toolTipWidth - metinImage.GetWidth() - 10, self.toolTipHeight)
affectTextLine.SetPosition(self.toolTipWidth - 50, self.toolTipHeight + 16 + 2)
else:
metinImage.SetPosition(10, self.toolTipHeight)
affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2)
if custumAffectString:
affectTextLine.SetText(custumAffectString)
elif itemIndex!=constInfo.ERROR_METIN_STONE:
for i in xrange(item.ITEM_APPLY_MAX_NUM):
(affectType, affectValue) = item.GetAffect(i)
affectString = self.__GetAffectString(affectType, affectValue)
if affectString:
self.AppendSpace(20)
self.EricBloodaxeAppendTextLine(affectString, self.GetChangeTextLineColor(affectValue))
else:
affectTextLine.SetText(localeInfo.TOOLTIP_APPLY_NOAFFECT)
self.childrenList.append(affectTextLine)
if custumAffectString2:
affectTextLine = ui.TextLine()
affectTextLine.SetParent(self)
affectTextLine.SetFontName(self.defFontName)
affectTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
affectTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
affectTextLine.SetOutline()
affectTextLine.SetFeather()
affectTextLine.Show()
affectTextLine.SetText(custumAffectString2)
self.childrenList.append(affectTextLine)
self.toolTipHeight += 16 + 2
if 0 != leftTime:
timeText = (localeInfo.LEFT_TIME + " : " + localeInfo.SecondToDHM(leftTime))
timeTextLine = ui.TextLine()
timeTextLine.SetParent(self)
timeTextLine.SetFontName(self.defFontName)
timeTextLine.SetPackedFontColor(self.POSITIVE_COLOR)
timeTextLine.SetPosition(50, self.toolTipHeight + 16 + 2 + 16 + 2)
timeTextLine.SetOutline()
timeTextLine.SetFeather()
timeTextLine.Show()
timeTextLine.SetText(timeText)
self.childrenList.append(timeTextLine)
self.toolTipHeight += 16 + 2
else:
nameTextLine.SetText(localeInfo.TOOLTIP_SOCKET_EMPTY)
self.toolTipHeight += 35
self.ResizeToolTip()
for i in xrange(player.METIN_SOCKET_MAX_NUM):
self.__AppendMetinSlotInfo_AppendMetinSocketData(i, metinSlot[i])
PyObject * chatGetLinkFromHyperlink(PyObject * poSelf, PyObject * poArgs)
PyObject * playerGetItemLink(PyObject * poSelf, PyObject * poArgs)
// item:vnum:flag:socket0:socket1:socket2
sadece bu kısmı bu şekilde // item:vnum:flag:socket0:socket1:socket2:socket3
ayarladım yeterli midir kod blogunda başka değişiklik yapmama gerek varmıdırPyObject * chatGetLinkFromHyperlink(PyObject * poSelf, PyObject * poArgs)
{
char * szHyperlink;
if (!PyTuple_GetString(poArgs, 0, &szHyperlink))
return Py_BuildException();
std::string stHyperlink(szHyperlink);
std::vector<std::string> results;
split_string(stHyperlink, ":", results, false);
// item:vnum:flag:socket0:socket1:socket2:socket3
if (0 == results[0].compare("item"))
{
if (results.size() < 6)
return Py_BuildValue("s", "");
CItemData * pItemData = NULL;
if (CItemManager::Instance().GetItemDataPointer(htoi(results[1].c_str()), &pItemData))
{
char buf[1024] = { 0 };
char itemlink[256];
int len;
bool isAttr = false;
len = snprintf(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x",
htoi(results[1].c_str()),
htoi(results[2].c_str()),
htoi(results[3].c_str()),
htoi(results[4].c_str()),
htoi(results[5].c_str()));
if (results.size() >= 8)
{
for (int i = 6; i < results.size(); i += 2)
{
len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d",
htoi(results[i].c_str()),
atoi(results[i+1].c_str()));
isAttr = true;
}
}
if (isAttr)
//"item:锅龋:敲贰弊:家南0:家南1:家南2"
snprintf(buf, sizeof(buf), "|cffffc700|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
else
snprintf(buf, sizeof(buf), "|cfff1e6c0|H%s|h[%s]|h|r", itemlink, pItemData->GetName());
return Py_BuildValue("s", buf);
}
}
return Py_BuildValue("s", "");
}
Error 1 error C2059: syntax error : ')' C:\eskivslik src li başlangıç\Eric Bloodaxe - Altyapı S.F\Client Source\source\UserInterface\PythonPlayerModule.cpp 1056 1 UserInterface
const TItemData * pPlayerItem = CPythonPlayer::Instance().GetItemData(Cell);
CItemData * pItemData = NULL;
char buf[1024];
if (pPlayerItem && CItemManager::Instance().GetItemDataPointer(pPlayerItem->vnum, &pItemData))
{
char itemlink[256];
int len;
bool isAttr = false;
len = snprintf(itemlink, sizeof(itemlink), "item:%x:%x:%x:%x:%x",
pPlayerItem->vnum, pPlayerItem->flags,
pPlayerItem->alSockets[0], pPlayerItem->alSockets[1], pPlayerItem->alSockets[2]), pPlayerItem->alSockets[3]); (1056). satır
for (int i = 0; i < ITEM_ATTRIBUTE_SLOT_MAX_NUM; ++i)
if (pPlayerItem->aAttr[i].bType != 0)
{
len += snprintf(itemlink + len, sizeof(itemlink) - len, ":%x:%d",
pPlayerItem->aAttr[i].bType, pPlayerItem->aAttr[i].sValue);
isAttr = true;
}
pPlayerItem->alSockets[0], pPlayerItem->alSockets[1], pPlayerItem->alSockets[2]), pPlayerItem->alSockets[3]);
pPlayerItem->alSockets[0], pPlayerItem->alSockets[1], pPlayerItem->alSockets[2], pPlayerItem->alSockets[3]);
0817 03:50:17857 :: Traceback (most recent call last):
0817 03:50:17857 :: File "game.py", line 1420, in OnMouseLeftButtonUp
0817 03:50:17858 :: File "interfaceModule.py", line 353, in MakeHyperlinkTooltip
0817 03:50:17858 :: File "uiToolTip.py", line 1851, in SetHyperlinkItem
0817 03:50:17858 :: File "uiToolTip.py", line 926, in AddItemData
0817 03:50:17858 :: File "uiToolTip.py", line 1645, in __AppendMetinSlotInfo
0817 03:50:17858 :: IndexError
0817 03:50:17858 :: :
0817 03:50:17858 :: list index out of range
0817 03:50:17858 ::
0822 00:11:54964 :: Traceback (most recent call last):
0822 00:11:54964 :: File "game.py", line 1420, in OnMouseLeftButtonUp
0822 00:11:55015 :: File "interfaceModule.py", line 353, in MakeHyperlinkTooltip
0822 00:11:55015 :: File "uiToolTip.py", line 1851, in SetHyperlinkItem
0822 00:11:55016 :: File "uiToolTip.py", line 926, in AddItemData
0822 00:11:55016 :: File "uiToolTip.py", line 1645, in __AppendMetinSlotInfo
0822 00:11:55016 :: IndexError
0822 00:11:55016 :: :
0822 00:11:55016 :: list index out of range
0822 00:11:55016 ::