Ayyıldız2 | 2008 TR Yapısı • 1-99 Orta Emek Destan • Oto Avsız • 10 Temmuz 21:00 HEMEN TIKLA!
0325 09: 20: 04424 :: Traceback (most recent call last):
0325 09: 20: 04424 :: File "uiOfflineShopBuilder.py", line 153, in OnUpdate
0325 09: 20: 04425 :: TypeError
0325 09: 20: 04425 :::
0325 09:20: 04425 :: 'NoneType' object is not iterable
Help ..?
uiofflineshopbuilder.py
import uiu
import sndsnd
import shop
import mouseModule
import player
import chrchar
import net
import uiCommonthe uicommo
import localeInfo
import chat
import systemSettingsystemsetting
import item
import uiOfflineShop
import app
import constInfoconstınfo
if app.WJ_CHANGELOOK_SYSTEM:
import changelookchangelook
g_isBuildingOfflineShop = False
g_itemPriceDict = {}
g_offlineShopAdvertisementBoardDict = {}
def Clear ():
global g_itemPriceDict
global g_isBuildingOfflineShop
g_itemPriceDict = {}
g_isBuildingOfflineShop = False
def IsOfflineShopItemPriceList ():
global g_itemPriceDict
if g_itemPriceDict:
return True
else:
return False
def IsBuildingOfflineShop ():
global g_isBuildingOfflineShop
if (g_isBuildingOfflineShop):
return True
else:
return False
def SetOfflineShopItemPrice (itemVNum, itemPrice):
global g_itemPriceDict
g_itempricedict [int (itemvn I)] = itempri by
def GetOfflineShopItemPrice (itemVNum):
try:
global g_itemPriceDict
return g_itemPriceDict [itemVNum]
except KeyError:
return 0
def GetOfflineShopItemPrice (itemVnum):
try:
global g_itemPriceDict
return g_itemPriceDict [itemVnum]
except KeyError:
return 0
def UpdateADBoard ():
for key in g_offlineShopAdvertisementBoardDict.keys ():
g_offlineshopadvertisementboarddict [key] .Show ()
def DeleteADBoard ():
if (not g_offlineShopAdvertisementBoardDict.has_key (vid)):
return
del g_offlineShopAdvertisementBoardDict [vid]
class OfflineShopAdvertisementBoard (ui.ThinBoard):
def __init __ (self):
ui.ThinBoard .__ init __ (self, "UI_BOTTOM")
self.shopAdvertismentBoardSeen = []
self.vid = None
self.baslik = None
maketextl to self .__ ()
def __del __ (self):
ui.thinboard .__ del __ (self)
def __MakeTextLine (self):
self.textLine = ui.TextLine ()
self.textline.setparent (self)
self.textline.setwindowhorizontalaligncent is ()
self.textline.setwindowverticalaligncent is ()
self.textline.sethorizontalaligncent is ()
self.textline.setverticalaligncent is ()
self.textline.show ()
self.textLine_Bakildi = ui.TextLine_Alisveris ()
self.textline_bakildi.setparent (self)
self.textline_bakildi.setwindowhorizontalaligncent is ()
self.textline_bakildi.setwindowverticalaligncent is ()
self.textline_bakildi.sethorizontalaligncent is ()
self.textline_bakildi.setverticalaligncent is ()
self.textline_bakildi.show ()
def Open (self, vid, text):
self.vid = vid
self.baslik = text
name = chr.GetNameByVID (self.vid)
if str (name) in constInfo.PAZAR_BAKILDI:
self.textline_bakildi.settext (str (constınfo.renk on [ "YELLOW"]) + text)
self.textline_bakildi.show ()
self.textline_bakildi.updaterect ()
In self.textline.hi ()
else:
if str (text) .find ("^")! = 1:
self.textline.settext (text [1:])
else:
self.textline.settext (text)
self.textline.show ()
self.textline.updaterect ()
In self.textline_bakildi.hi ()
if vid in self.shopAdvertismentBoardSeen:
self.textLine.SetFontColor (10, 10, 0)
self.SetSize (len (text) * 6 + 10 * 2, 20)
self.show ()
g_offlineShopAdvertisementBoardDict [vid] = self
def OnMouseLeftButtonUp (self):
if (not self.vid):
return
if (uiOfflineShop.IsEditingOfflineShop ()):
return
name = chr.GetNameByVID (self.vid)
if name! = player.GetName () and not IsBuildingOfflineShop ():
if not str (name) in constInfo.PAZAR_BAKILDI:
constınfo.pazar_bakıldı.append (name)
net.sendonclickpacket (self.vid)
if self.vid! = player.GetMainCharacterIndex ():
self.textLine.SetFontColor (10, 10, 0)
self.shopadvertismentboardseen.append (self.vid)
return True
def OnUpdate (self):
if (not self.vid):
return
if (systemSetting.IsShowSalesText () and systemSetting.IsShowOfflineShop ()):
if systemSetting.GetShopNamesRange () == 1,000:
self.show ()
(x, y) = chr.GetProjectPosition (self.vid, 220)
self.SetPosition (x - self.GetWidth () / 2, y - self.GetHeight () / 2)
else:
LIMIT_RANGE = abs (constInfo.SHOPNAMES_RANGE * systemSetting.GetShopNamesRange ())
(to_x, to_y, to_z) = chr.GetPixelPosition (self.vid)
(my_x, my_y, my_z) = player.GetMainCharacterPosition ()
if abs (my_x - to_x) <= LIMIT_RANGE and abs (my_y - to_y) <= LIMIT_RANGE:
(x, y) = chr.GetProjectPosition (self.vid, 220)
self.SetPosition (x - self.GetWidth () / 2, y - self.GetHeight () / 2)
self.show ()
else:
In self.hi ()
self.SetPosition (-70, 0)
name = chr.GetNameByVID (self.vid)
if str (name) in constInfo.PAZAR_BAKILDI:
if str (self.baslik) .find ("^")! = -1:
self.textline_bakildi.settext (str (constınfo.renk on [ "YELLOW"]) + self.baslik [1:])
else:
self.textline_bakildi.settext (str (constınfo.renk on [ "YELLOW"]) + self.baslik)
self.textline_bakildi.show ()
In self.textline.hi ()
else:
if str (self.baslik) .find ("^")! = -1:
self.textline.settext (self.baslik [1:])
self.textline.show ()
In self.textline_bakildi.hi ()
else:
self.textline.settext (self.baslik)
self.textline.show ()
In self.textline_bakildi.hi ()
else:
for key in g_offlineShopAdvertisementBoardDict.keys ():
g_offlineshopadvertisementboarddict [key] In .Hi ()
class OfflineShopBuilder (ui.ScriptWindow):
def __init __ (self):
ui.scriptwindow .__ init __ (self)
self.loadwindow ()
self.itemStock = {}
self.tooltipItem = None
self.priceInputBoard = None
self.title = ""
self.style = -1
def __del __ (self):
ui.scriptwindow .__ del __ (self)
def LoadWindow (self):
try:
pyScrLoader = ui.PythonScriptLoader ()
pyScrLoader.LoadScriptFile (self, "UIScript / OfflineShopBuilder.py")
except:
import exception
exception.abort ( "offlineshopbuilderwindow.loadwindow.loadobject")
try:
self.nameLine = self.GetChild ("NameLine")
self.itemSlot = self.GetChild ("ItemSlot")
self.btnOk = self.GetChild ("OkButton")
self.btnClose = self.GetChild ("CloseButton")
self.board = self.GetChild ("Board")
except:
import exception
exception.abort ( "offlineshopbuilderwindow.loadwindow.bindobject")
self.btnok.setevent (uu mem_func .__ __ (self.onok))
self.btnclose.setevent (uu mem_func .__ __ (self.onclos a))
self.board.setcloseevent (uu mem_func .__ __ (self.onclos a))
self.itemslot.setselectemptyslotevent (uu mem_func .__ __ (self.onselectemptyslot))
self.itemslot.setselectıtemslotevent (uu mem_func .__ __ (self.onselectıtemslot))
self.itemslot.setoverınıtemevent (uu mem_func .__ __ (self.onoverınıte I))
self.itemslot.setoveroutıtemevent (uu mem_func .__ __ (self.onoveroutıte I))
def Destroy (self):
self.cleardictionary ()
self.nameLine = None
self.itemSlot = None
self.btnOk = None
self.btnClose = None
self.board = None
if self.priceInputBoard:
self.priceınputboard.clos A ()
self.priceInputBoard = None
def Open (self, title, style):
self.title = title
self.style = style
if (len (title)> 25):
self.title = title [: 22] + "..."
self.itemStock = {}
shop.clearofflineshopstock ()
self.nameline.settext (title)
self.setcenterpositio of ()
self.refresh ()
self.show ()
global g_isBuildingOfflineShop
g_isBuildingOfflineShop = True
def Close (self):
global g_isBuildingOfflineShop
g_isBuildingOfflineShop = False
self.title = ""
self.style = -1
shop.clearofflineshopstock ()
In self.hi ()
if self.priceInputBoard:
self.priceınputboard.clos A ()
self.priceInputBoard = None
def SetItemToolTip (self, tooltipItem):
self.tooltipItem = tooltipItem
def Refresh (self):
for i in xrange (shop.OFFLINE_SHOP_SLOT_COUNT):
if (not self.itemStock.has_key (i)):
self.itemslot.clearslot (i)
continua
pos = self.itemStock
itemCount = player.GetItemCount (* pos)
if (itemCount <= 1):
itemCount = 0
self.itemSlot.SetItemSlot (i, player.GetItemIndex (* pos), itemCount)
if app.WJ_CHANGELOOK_SYSTEM:
itemTransmutedVnum = player.GetItemTransmutation (* pos)
if itemTransmutedVnum:
self.itemslot.disablecoverbutto of (i)
else:
self.itemslot.enablecoverbutto of (i)
self.itemslot.refreshslot ()
def OnSelectEmptySlot (selected):
isAttached = mouseModule.mouseController.isAttached ()
if (isAttached):
attachedSlotType = mouseModule.mouseController.GetAttachedType ()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber ()
mousemodule.mousecontroller.deattachobject ()
if (player.slot_type_ınventory! = attachedslottyp and player.slot_type_dragon_soul_ınventory! = attachedslottyp and player.slot_type_skıll_book_ınventory! = attachedslottyp and player.slot_type_upgrade_ıtems_ınventory! = attachedslottyp and player.slot_type_stone_ınventory! = attachedslottyp and player.slot_type_gıft_box_ınventory! = attachedslottyp A):
return
attachedInvenType = player.SlotTypeToInvenType (attachedSlotType)
itemVNum = player.GetItemIndex (attachedInvenType, attachedSlotPos)
item.selectıte I (itemvn I)
if item.IsAntiFlag (item.ANTIFLAG_GIVE) or item.IsAntiFlag (item.ANTIFLAG_MYSHOP):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_CANNOT_SELL_ITEM)
return
priceInputBoard = uiCommon.MoneyInputDialog2 ()
priceınputboard.settitl A (localeınfo.offlıne_shop_ınput_prıce_dıalog_tıtl A)
priceınputboard.setacceptevent (uu mem_func .__ __ (self.acceptınputpri by))
priceınputboard.setcancelevent (uu mem_func .__ __ (self.cancelınputpri by))
priceınputboard.op the ()
itemPrice = GetOfflineShopItemPrice (itemVNum)
if (itemPrice> 0):
priceınputboard.setvalu A (itempri ACE)
self.priceInputBoard = priceInputBoard
self.priceInputBoard.itemVNum = itemVNum
self.priceInputBoard.sourceWindowType = attachedInvenType
self.priceInputBoard.sourceSlotPos = attachedSlotPos
self.priceInputBoard.targetSlotPlay
def OnSelectItemSlot (selected)
isAttached = mouseModule.mouseController.isAttached ()
if (isAttached):
snd.playsound ( "sound / ui / loginfail.wav")
mousemodule.mousecontroller.deattachobject ()
else:
: The selected version is selected from:
return
invenType, invenPos = self.it selected
shop.DelOfflineShopItemStock (invenType, invenPos)
del self.it selected
snd.playsound ( "sound / ui / drop.wav")
self.refresh ()
def AcceptInputPrice (self):
If (not self.priceInputBoard):
return True
Text = self.priceInputBoard.GetText ()
text2 = self.priceInputBoard.GetText2 ()
text2type = self.priceInputBoard.GetText2Type ()
if not text:
return True
if not text.isdigit ():
return True
if text2 and int (text2)> = 1000:
chat.AppendChat (1, localeInf
FFLINE_SHOP_MAXCOUNT_200)
return True
itvnm = self.priceInputBoard.itemVNum
item.selectıte I (itvnm)
itemname = item.GetItemName ()
if int (text2type) == 1:
if int (itvnm) == 80005:
I self.uy (itemName)
return True
elif int (text2type) == 2:
if int (itvnm) == 80006:
I self.uy (itemName)
return True
elif int (text2type) == 3:
if int (itvnm) == 80007:
I self.uy (itemName)
return True
elif int (text2type) == 4:
if int (itvnm) == 50513:
I self.uy (itemName)
return True
elif int (text2type) == 5:
if int (itvnm) == 71123:
I self.uy (itemName)
return True
elif int (text2type) == 6:
if int (itvnm) == 71129:
I self.uy (itemName)
return True
attachedInvenType = self.priceInputBoard.sourceWindowType
sourceSlotPos = self.priceInputBoard.sourceSlotPos
targetSlotPos = self.priceInputBoard.targetSlotPos
for privatePos, (itemWindowType, itemSlotIndex) in self.itemStock.items ():
if (itemWindowType == attachedInvenType and itemSlotIndex == sourceSlotPos):
shop.DelOfflineShopItemStock (itemWindowType, itemSlotIndex)
del self.itemStock [privatePos]
price = int (self.priceInputBoard.GetText ())
price2 = int (self.priceInputBoard.GetText2 ())
price2type = int (self.priceInputBoard.GetText2Type ())
if (IsOfflineShopItemPriceList ()):
SetOfflineShopItemPrice (self.priceInputBoard.itemVNum, price)
shop.AddOfflineShopItemStock (attachedInvenType, sourceSlotPos, targetSlotPos, price, price2, price2type)
self.itemStock [targetSlotPos] = (attachedInvenType, sourceSlotPos)
snd.playsound ( "sound / ui / drop.wav")
self.refresh ()
self.priceınputboard.clos A ()
self.priceInputBoard = None
return True
def CancelInputPrice (self):
if self.priceInputBoard:
self.priceınputboard.clos A ()
self.priceInputBoard = None
return 1
def warning (self, itemad):
# chat.AppendChat (1, translate.uyarim% (str (itemad), str (itemad)))
# self.priceInputBoard.Close ()
self.uyari2 = uiCommon.PopupDialog ()
self.uyari2.SetText (localeInfo.SHOP_WARNING_MULTI_PRICE% (str (itemad), str (itemad)))
self.uyari2.op the ()
def OnOk (self):
if (not self.title):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_NOT_TITLE)
return
if (len (self.itemStock) == 0):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_NOT_ITEM)
return
if (self.style <0):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_ERROT_STYLE)
return
shop.BuildOfflineShop (self.title, self.style)
self.clos A ()
def OnClose (self):
self.clos A ()
def OnPressEscapeKey (self):
self.clos A ()
return True
def OnOverInItem (self, slotIndex):
if (self.tooltipItem):
if (self.itemStock.has_key (slotIndex)):
self.tooltipItem.SetOfflineShopBuilderItem (* self.itemStock [slotIndex] + (slotIndex,))
def OnOverOutItem (self):
if (self.tooltipItem):
self.tooltipıtem.hidetooltip ()
0325 09: 20: 04424 :: File "uiOfflineShopBuilder.py", line 153, in OnUpdate
0325 09: 20: 04425 :: TypeError
0325 09: 20: 04425 :::
0325 09:20: 04425 :: 'NoneType' object is not iterable
Help ..?
uiofflineshopbuilder.py
import uiu
import sndsnd
import shop
import mouseModule
import player
import chrchar
import net
import uiCommonthe uicommo
import localeInfo
import chat
import systemSettingsystemsetting
import item
import uiOfflineShop
import app
import constInfoconstınfo
if app.WJ_CHANGELOOK_SYSTEM:
import changelookchangelook
g_isBuildingOfflineShop = False
g_itemPriceDict = {}
g_offlineShopAdvertisementBoardDict = {}
def Clear ():
global g_itemPriceDict
global g_isBuildingOfflineShop
g_itemPriceDict = {}
g_isBuildingOfflineShop = False
def IsOfflineShopItemPriceList ():
global g_itemPriceDict
if g_itemPriceDict:
return True
else:
return False
def IsBuildingOfflineShop ():
global g_isBuildingOfflineShop
if (g_isBuildingOfflineShop):
return True
else:
return False
def SetOfflineShopItemPrice (itemVNum, itemPrice):
global g_itemPriceDict
g_itempricedict [int (itemvn I)] = itempri by
def GetOfflineShopItemPrice (itemVNum):
try:
global g_itemPriceDict
return g_itemPriceDict [itemVNum]
except KeyError:
return 0
def GetOfflineShopItemPrice (itemVnum):
try:
global g_itemPriceDict
return g_itemPriceDict [itemVnum]
except KeyError:
return 0
def UpdateADBoard ():
for key in g_offlineShopAdvertisementBoardDict.keys ():
g_offlineshopadvertisementboarddict [key] .Show ()
def DeleteADBoard ():
if (not g_offlineShopAdvertisementBoardDict.has_key (vid)):
return
del g_offlineShopAdvertisementBoardDict [vid]
class OfflineShopAdvertisementBoard (ui.ThinBoard):
def __init __ (self):
ui.ThinBoard .__ init __ (self, "UI_BOTTOM")
self.shopAdvertismentBoardSeen = []
self.vid = None
self.baslik = None
maketextl to self .__ ()
def __del __ (self):
ui.thinboard .__ del __ (self)
def __MakeTextLine (self):
self.textLine = ui.TextLine ()
self.textline.setparent (self)
self.textline.setwindowhorizontalaligncent is ()
self.textline.setwindowverticalaligncent is ()
self.textline.sethorizontalaligncent is ()
self.textline.setverticalaligncent is ()
self.textline.show ()
self.textLine_Bakildi = ui.TextLine_Alisveris ()
self.textline_bakildi.setparent (self)
self.textline_bakildi.setwindowhorizontalaligncent is ()
self.textline_bakildi.setwindowverticalaligncent is ()
self.textline_bakildi.sethorizontalaligncent is ()
self.textline_bakildi.setverticalaligncent is ()
self.textline_bakildi.show ()
def Open (self, vid, text):
self.vid = vid
self.baslik = text
name = chr.GetNameByVID (self.vid)
if str (name) in constInfo.PAZAR_BAKILDI:
self.textline_bakildi.settext (str (constınfo.renk on [ "YELLOW"]) + text)
self.textline_bakildi.show ()
self.textline_bakildi.updaterect ()
In self.textline.hi ()
else:
if str (text) .find ("^")! = 1:
self.textline.settext (text [1:])
else:
self.textline.settext (text)
self.textline.show ()
self.textline.updaterect ()
In self.textline_bakildi.hi ()
if vid in self.shopAdvertismentBoardSeen:
self.textLine.SetFontColor (10, 10, 0)
self.SetSize (len (text) * 6 + 10 * 2, 20)
self.show ()
g_offlineShopAdvertisementBoardDict [vid] = self
def OnMouseLeftButtonUp (self):
if (not self.vid):
return
if (uiOfflineShop.IsEditingOfflineShop ()):
return
name = chr.GetNameByVID (self.vid)
if name! = player.GetName () and not IsBuildingOfflineShop ():
if not str (name) in constInfo.PAZAR_BAKILDI:
constınfo.pazar_bakıldı.append (name)
net.sendonclickpacket (self.vid)
if self.vid! = player.GetMainCharacterIndex ():
self.textLine.SetFontColor (10, 10, 0)
self.shopadvertismentboardseen.append (self.vid)
return True
def OnUpdate (self):
if (not self.vid):
return
if (systemSetting.IsShowSalesText () and systemSetting.IsShowOfflineShop ()):
if systemSetting.GetShopNamesRange () == 1,000:
self.show ()
(x, y) = chr.GetProjectPosition (self.vid, 220)
self.SetPosition (x - self.GetWidth () / 2, y - self.GetHeight () / 2)
else:
LIMIT_RANGE = abs (constInfo.SHOPNAMES_RANGE * systemSetting.GetShopNamesRange ())
(to_x, to_y, to_z) = chr.GetPixelPosition (self.vid)
(my_x, my_y, my_z) = player.GetMainCharacterPosition ()
if abs (my_x - to_x) <= LIMIT_RANGE and abs (my_y - to_y) <= LIMIT_RANGE:
(x, y) = chr.GetProjectPosition (self.vid, 220)
self.SetPosition (x - self.GetWidth () / 2, y - self.GetHeight () / 2)
self.show ()
else:
In self.hi ()
self.SetPosition (-70, 0)
name = chr.GetNameByVID (self.vid)
if str (name) in constInfo.PAZAR_BAKILDI:
if str (self.baslik) .find ("^")! = -1:
self.textline_bakildi.settext (str (constınfo.renk on [ "YELLOW"]) + self.baslik [1:])
else:
self.textline_bakildi.settext (str (constınfo.renk on [ "YELLOW"]) + self.baslik)
self.textline_bakildi.show ()
In self.textline.hi ()
else:
if str (self.baslik) .find ("^")! = -1:
self.textline.settext (self.baslik [1:])
self.textline.show ()
In self.textline_bakildi.hi ()
else:
self.textline.settext (self.baslik)
self.textline.show ()
In self.textline_bakildi.hi ()
else:
for key in g_offlineShopAdvertisementBoardDict.keys ():
g_offlineshopadvertisementboarddict [key] In .Hi ()
class OfflineShopBuilder (ui.ScriptWindow):
def __init __ (self):
ui.scriptwindow .__ init __ (self)
self.loadwindow ()
self.itemStock = {}
self.tooltipItem = None
self.priceInputBoard = None
self.title = ""
self.style = -1
def __del __ (self):
ui.scriptwindow .__ del __ (self)
def LoadWindow (self):
try:
pyScrLoader = ui.PythonScriptLoader ()
pyScrLoader.LoadScriptFile (self, "UIScript / OfflineShopBuilder.py")
except:
import exception
exception.abort ( "offlineshopbuilderwindow.loadwindow.loadobject")
try:
self.nameLine = self.GetChild ("NameLine")
self.itemSlot = self.GetChild ("ItemSlot")
self.btnOk = self.GetChild ("OkButton")
self.btnClose = self.GetChild ("CloseButton")
self.board = self.GetChild ("Board")
except:
import exception
exception.abort ( "offlineshopbuilderwindow.loadwindow.bindobject")
self.btnok.setevent (uu mem_func .__ __ (self.onok))
self.btnclose.setevent (uu mem_func .__ __ (self.onclos a))
self.board.setcloseevent (uu mem_func .__ __ (self.onclos a))
self.itemslot.setselectemptyslotevent (uu mem_func .__ __ (self.onselectemptyslot))
self.itemslot.setselectıtemslotevent (uu mem_func .__ __ (self.onselectıtemslot))
self.itemslot.setoverınıtemevent (uu mem_func .__ __ (self.onoverınıte I))
self.itemslot.setoveroutıtemevent (uu mem_func .__ __ (self.onoveroutıte I))
def Destroy (self):
self.cleardictionary ()
self.nameLine = None
self.itemSlot = None
self.btnOk = None
self.btnClose = None
self.board = None
if self.priceInputBoard:
self.priceınputboard.clos A ()
self.priceInputBoard = None
def Open (self, title, style):
self.title = title
self.style = style
if (len (title)> 25):
self.title = title [: 22] + "..."
self.itemStock = {}
shop.clearofflineshopstock ()
self.nameline.settext (title)
self.setcenterpositio of ()
self.refresh ()
self.show ()
global g_isBuildingOfflineShop
g_isBuildingOfflineShop = True
def Close (self):
global g_isBuildingOfflineShop
g_isBuildingOfflineShop = False
self.title = ""
self.style = -1
shop.clearofflineshopstock ()
In self.hi ()
if self.priceInputBoard:
self.priceınputboard.clos A ()
self.priceInputBoard = None
def SetItemToolTip (self, tooltipItem):
self.tooltipItem = tooltipItem
def Refresh (self):
for i in xrange (shop.OFFLINE_SHOP_SLOT_COUNT):
if (not self.itemStock.has_key (i)):
self.itemslot.clearslot (i)
continua
pos = self.itemStock
itemCount = player.GetItemCount (* pos)
if (itemCount <= 1):
itemCount = 0
self.itemSlot.SetItemSlot (i, player.GetItemIndex (* pos), itemCount)
if app.WJ_CHANGELOOK_SYSTEM:
itemTransmutedVnum = player.GetItemTransmutation (* pos)
if itemTransmutedVnum:
self.itemslot.disablecoverbutto of (i)
else:
self.itemslot.enablecoverbutto of (i)
self.itemslot.refreshslot ()
def OnSelectEmptySlot (selected):
isAttached = mouseModule.mouseController.isAttached ()
if (isAttached):
attachedSlotType = mouseModule.mouseController.GetAttachedType ()
attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber ()
mousemodule.mousecontroller.deattachobject ()
if (player.slot_type_ınventory! = attachedslottyp and player.slot_type_dragon_soul_ınventory! = attachedslottyp and player.slot_type_skıll_book_ınventory! = attachedslottyp and player.slot_type_upgrade_ıtems_ınventory! = attachedslottyp and player.slot_type_stone_ınventory! = attachedslottyp and player.slot_type_gıft_box_ınventory! = attachedslottyp A):
return
attachedInvenType = player.SlotTypeToInvenType (attachedSlotType)
itemVNum = player.GetItemIndex (attachedInvenType, attachedSlotPos)
item.selectıte I (itemvn I)
if item.IsAntiFlag (item.ANTIFLAG_GIVE) or item.IsAntiFlag (item.ANTIFLAG_MYSHOP):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_CANNOT_SELL_ITEM)return
priceInputBoard = uiCommon.MoneyInputDialog2 ()
priceınputboard.settitl A (localeınfo.offlıne_shop_ınput_prıce_dıalog_tıtl A)
priceınputboard.setacceptevent (uu mem_func .__ __ (self.acceptınputpri by))
priceınputboard.setcancelevent (uu mem_func .__ __ (self.cancelınputpri by))
priceınputboard.op the ()
itemPrice = GetOfflineShopItemPrice (itemVNum)
if (itemPrice> 0):
priceınputboard.setvalu A (itempri ACE)
self.priceInputBoard = priceInputBoard
self.priceInputBoard.itemVNum = itemVNum
self.priceInputBoard.sourceWindowType = attachedInvenType
self.priceInputBoard.sourceSlotPos = attachedSlotPos
self.priceInputBoard.targetSlotPlay
def OnSelectItemSlot (selected)
isAttached = mouseModule.mouseController.isAttached ()
if (isAttached):
snd.playsound ( "sound / ui / loginfail.wav")
mousemodule.mousecontroller.deattachobject ()
else:
: The selected version is selected from:
return
invenType, invenPos = self.it selected
shop.DelOfflineShopItemStock (invenType, invenPos)
del self.it selected
snd.playsound ( "sound / ui / drop.wav")
self.refresh ()
def AcceptInputPrice (self):
If (not self.priceInputBoard):
return True
Text = self.priceInputBoard.GetText ()
text2 = self.priceInputBoard.GetText2 ()
text2type = self.priceInputBoard.GetText2Type ()
if not text:
return True
if not text.isdigit ():
return True
if text2 and int (text2)> = 1000:
chat.AppendChat (1, localeInf
FFLINE_SHOP_MAXCOUNT_200)return True
itvnm = self.priceInputBoard.itemVNum
item.selectıte I (itvnm)
itemname = item.GetItemName ()
if int (text2type) == 1:
if int (itvnm) == 80005:
I self.uy (itemName)
return True
elif int (text2type) == 2:
if int (itvnm) == 80006:
I self.uy (itemName)
return True
elif int (text2type) == 3:
if int (itvnm) == 80007:
I self.uy (itemName)
return True
elif int (text2type) == 4:
if int (itvnm) == 50513:
I self.uy (itemName)
return True
elif int (text2type) == 5:
if int (itvnm) == 71123:
I self.uy (itemName)
return True
elif int (text2type) == 6:
if int (itvnm) == 71129:
I self.uy (itemName)
return True
attachedInvenType = self.priceInputBoard.sourceWindowType
sourceSlotPos = self.priceInputBoard.sourceSlotPos
targetSlotPos = self.priceInputBoard.targetSlotPos
for privatePos, (itemWindowType, itemSlotIndex) in self.itemStock.items ():
if (itemWindowType == attachedInvenType and itemSlotIndex == sourceSlotPos):
shop.DelOfflineShopItemStock (itemWindowType, itemSlotIndex)
del self.itemStock [privatePos]
price = int (self.priceInputBoard.GetText ())
price2 = int (self.priceInputBoard.GetText2 ())
price2type = int (self.priceInputBoard.GetText2Type ())
if (IsOfflineShopItemPriceList ()):
SetOfflineShopItemPrice (self.priceInputBoard.itemVNum, price)
shop.AddOfflineShopItemStock (attachedInvenType, sourceSlotPos, targetSlotPos, price, price2, price2type)
self.itemStock [targetSlotPos] = (attachedInvenType, sourceSlotPos)
snd.playsound ( "sound / ui / drop.wav")
self.refresh ()
self.priceınputboard.clos A ()
self.priceInputBoard = None
return True
def CancelInputPrice (self):
if self.priceInputBoard:
self.priceınputboard.clos A ()
self.priceInputBoard = None
return 1
def warning (self, itemad):
# chat.AppendChat (1, translate.uyarim% (str (itemad), str (itemad)))
# self.priceInputBoard.Close ()
self.uyari2 = uiCommon.PopupDialog ()
self.uyari2.SetText (localeInfo.SHOP_WARNING_MULTI_PRICE% (str (itemad), str (itemad)))
self.uyari2.op the ()
def OnOk (self):
if (not self.title):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_NOT_TITLE)return
if (len (self.itemStock) == 0):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_NOT_ITEM)return
if (self.style <0):
chat.AppendChat (chat.CHAT_TYPE_INFO, localeInf
FFLINE_SHOP_ERROT_STYLE)return
shop.BuildOfflineShop (self.title, self.style)
self.clos A ()
def OnClose (self):
self.clos A ()
def OnPressEscapeKey (self):
self.clos A ()
return True
def OnOverInItem (self, slotIndex):
if (self.tooltipItem):
if (self.itemStock.has_key (slotIndex)):
self.tooltipItem.SetOfflineShopBuilderItem (* self.itemStock [slotIndex] + (slotIndex,))
def OnOverOutItem (self):
if (self.tooltipItem):
self.tooltipıtem.hidetooltip ()
Son düzenleme: