def OnOk(self): if not self.title: return if 0 == len(self.itemStock): return if app.ENABLE_OFFLINE_SHOP: shop.BuildPrivateShop(self.title, self.type, self.size, self.color) else: shop.BuildPrivateShop(self.title) self.Close()
def CreateShop(self): if OpenLib.GetItemByID(SHOP_PACKET_ID) == -1: chat.AppendChat(3, "[Shop-Creator] You need to buy a packet first.") return self.iniItems = [] self.initItems = list(self.items_ui.keys()) blocked_slots = set() #Avoid selecting the same item twice for i in range(0, self.MAX_NUM_SLOT): idx = player.GetItemIndex(i) if idx == SHOP_PACKET_ID or idx == PREMIUM_SHOP_PACKET_ID or idx == 0: continue if i in blocked_slots: continue item.SelectItem(idx) size = item.GetItemSize() if size > 1: for ii in range(1, size): blocked_slots.add(i + ii * 5) #if ItemValue == 50300: # ItemValue = 100000 + player.GetItemMetinSocket(i, 0) #if ItemValue != 0: self.SetItemPrice(i) shop.BuildPrivateShop(self.ShopNameEditline.GetText())
def OnOk(self): if not self.title: return if 0 == len(self.itemStock): return shop.BuildPrivateShop(self.title) self.Close()