Example #1
0
    def __SellItem(self, itemSlotPos):
        if not player.IsEquipmentSlot(itemSlotPos):
            self.sellingSlotNumber = itemSlotPos
            itemIndex = player.GetItemIndex(itemSlotPos)
            itemCount = player.GetItemCount(itemSlotPos)

            self.sellingSlotitemIndex = itemIndex
            self.sellingSlotitemCount = itemCount

            item.SelectItem(itemIndex)
            ## 안티 플레그 검사 빠져서 추가
            ## 20140220
            if item.IsAntiFlag(item.ANTIFLAG_SELL):
                popup = uiCommon.PopupDialog()
                popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
                popup.SetAcceptEvent(self.__OnClosePopupDialog)
                popup.Open()
                self.popup = popup
                return

            itemPrice = player.GetISellItemPrice(itemSlotPos)

            item.GetItemName(itemIndex)
            itemName = item.GetItemName()

            self.questionDialog = uiCommon.QuestionDialog()
            self.questionDialog.SetText(
                localeInfo.DO_YOU_SELL_ITEM(itemName, itemCount, itemPrice))
            self.questionDialog.SetAcceptEvent(ui.__mem_func__(self.SellItem))
            self.questionDialog.SetCancelEvent(
                ui.__mem_func__(self.OnCloseQuestionDialog))
            self.questionDialog.Open()
            self.questionDialog.count = itemCount

            constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
Example #2
0
 def PopupMessage(self, text):
     pop = uiCommon.PopupDialog()
     pop.SetText(text)
     pop.SetAcceptEvent(self.__OnClosePopupDialog)
     pop.Open()
     self.pop = pop
     self.pop.SetTop()
Example #3
0
	def Popup(self, text, width, acceptevent):
		tmpPopup = uiCommon.PopupDialog()
		
		tmpPopup.SetText(str(text))
		if width: tmpPopup.SetWidth(width)
		if acceptevent: tmpPopup.SetAcceptEvent(acceptevent)
		
		tmpPopup.Open()
		return tmpPopup
Example #4
0
    def SellAttachedItem(self):

        if shop.IsPrivateShop():
            mouseModule.mouseController.DeattachObject()
            return

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()
        if player.SLOT_TYPE_INVENTORY == attachedSlotType:

            itemIndex = player.GetItemIndex(attachedSlotPos)
            item.SelectItem(itemIndex)

            if item.IsAntiFlag(item.ANTIFLAG_SELL):
                popup = uiCommon.PopupDialog()
                popup.SetText(locale.SHOP_CANNOT_SELL_ITEM)
                popup.SetAcceptEvent(self.__OnClosePopupDialog)
                popup.Open()
                self.popup = popup

            elif player.IsValuableItem(attachedSlotPos):

                itemPrice = item.GetISellItemPrice()

                if item.Is1GoldItem():
                    itemPrice = attachedCount / itemPrice / 5
                else:
                    itemPrice = itemPrice * max(1, attachedCount) / 5

                itemName = item.GetItemName()

                questionDialog = uiCommon.QuestionDialog()
                questionDialog.SetText(
                    locale.DO_YOU_SELL_ITEM(itemName, attachedCount,
                                            itemPrice))

                questionDialog.SetAcceptEvent(
                    lambda arg1=attachedSlotPos, arg2=attachedCount: self.
                    OnSellItem(arg1, arg2))
                questionDialog.SetCancelEvent(
                    ui.__mem_func__(self.OnCloseQuestionDialog))
                questionDialog.Open()
                self.questionDialog = questionDialog

            else:
                self.OnSellItem(attachedSlotPos, attachedCount)

        else:
            snd.PlaySound("sound/ui/loginfail.wav")

        mouseModule.mouseController.DeattachObject()
Example #5
0
    def SellAttachedItem(self):

        if shop.IsPrivateShop():
            mouseModule.mouseController.DeattachObject()
            return

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()

        if player.SLOT_TYPE_INVENTORY == attachedSlotType or player.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:

            item.SelectItem(attachedItemIndex)

            if item.IsAntiFlag(item.ANTIFLAG_SELL):
                popup = uiCommon.PopupDialog()
                popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
                popup.SetAcceptEvent(self.__OnClosePopupDialog)
                popup.Open()
                self.popup = popup
                return

            itemtype = player.INVENTORY

            if player.IsValuableItem(itemtype, attachedSlotPos):

                itemPrice = player.GetISellItemPrice(attachedSlotPos)

                itemName = item.GetItemName()

                questionDialog = uiCommon.QuestionDialog()
                questionDialog.SetText(
                    localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount,
                                                itemPrice))

                questionDialog.SetAcceptEvent(
                    lambda arg1=attachedSlotPos, arg2=attachedCount, arg3=
                    itemtype: self.OnSellItem(arg1, arg2, arg3))
                questionDialog.SetCancelEvent(
                    ui.__mem_func__(self.OnCloseQuestionDialog))
                questionDialog.Open()
                self.questionDialog = questionDialog

                constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

            else:
                self.OnSellItem(attachedSlotPos, attachedCount, itemtype)

        else:
            snd.PlaySound("sound/ui/loginfail.wav")

        mouseModule.mouseController.DeattachObject()
Example #6
0
	def ToggleDragonSoulWindow(self):
		if False == player.IsObserverMode():
			if app.ENABLE_DRAGON_SOUL_SYSTEM:
				if False == self.wndDragonSoul.IsShow():
					if self.DRAGON_SOUL_IS_QUALIFIED:
						self.wndDragonSoul.Show()
					else:
						try:
							self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED)
							self.wndPopupDialog.Open()
						except:
							self.wndPopupDialog = uiCommon.PopupDialog()
							self.wndPopupDialog.SetText(localeInfo.DRAGON_SOUL_UNQUALIFIED)
							self.wndPopupDialog.Open()
				else:
					self.wndDragonSoul.Close()
    def __LoadWindow(self):
        if self.isLoaded:
            return
        self.isLoaded = True
        try:
            self.__LoadScript("UIScript/minigameroulettewindow.py")
        except:
            import exception
            exception.Abort("RouletteWindow.LoadWindow.__LoadScript")
        try:
            self.spin_button = self.GetChild("spin_button")
            self.slot_edge_effect = self.GetChild("slot_edge_effect")
            self.items_slot = self.GetChild("item_slot")
            self.slot_edge_effect = self.GetChild("slot_edge_effect")
            self.Soul = self.GetChild("spin_button_text2")
            self.Soul.Hide()  # 50 Soul Text Hide
            self.Price = self.GetChild("spin_button_text3")

        except:
            import exception
            exception.Abort("RouletteWindow.LoadWindow.__BindObject")

        try:
            self.GetChild("board").SetCloseEvent(ui.__mem_func__(self.Close))
            if self.items_slot:
                self.items_slot.SetOverInItemEvent(
                    ui.__mem_func__(self.__SlotOverInItem))
                self.items_slot.SetOverOutItemEvent(
                    ui.__mem_func__(self.__SlotOverOutItem))
            if self.spin_button:
                self.spin_button.SetEvent(ui.__mem_func__(self.TurnPacket))

            self.PopupDialog = uiCommon.PopupDialog()
            self.PopupDialog.SetText(localeInfo.ROULETTE_REWARD_TEXT)

        except:
            import exception
            exception.Abort("RouletteWindow.LoadWindow.__BindEvent")
	def __LoadWindow(self):
		if self.isLoaded == 1:
			return
		self.isLoaded = 1
		try:
			pyScrLoader = ui.PythonScriptLoader()			
			pyScrLoader.LoadScriptFile(self, "uiscript/dragonsoulrefinewindow.py")

		except:
			import exception
			exception.Abort("dragonsoulrefinewindow.LoadWindow.LoadObject")
		try:
			wndRefineSlot = self.GetChild("RefineSlot")
			wndResultSlot = self.GetChild("ResultSlot")
			self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))			
			self.refineChoiceButtonDict = {
				self.REFINE_TYPE_GRADE	: self.GetChild("GradeButton"),
				self.REFINE_TYPE_STEP: self.GetChild("StepButton"),
				self.REFINE_TYPE_STRENGTH	: self.GetChild("StrengthButton"),
			}
			self.doRefineButton = self.GetChild("DoRefineButton")
			self.wndMoney = self.GetChild("Money_Slot")
		
		except:
			import exception
			exception.Abort("DragonSoulRefineWindow.LoadWindow.BindObject")
		
	
		## Item Slots
		wndRefineSlot.SetOverInItemEvent(ui.__mem_func__(self.__OverInRefineItem))
		wndRefineSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutItem))
		wndRefineSlot.SetSelectEmptySlotEvent(ui.__mem_func__(self.__SelectRefineEmptySlot))
		wndRefineSlot.SetSelectItemSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot))
		wndRefineSlot.SetUseSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot))
		wndRefineSlot.SetUnselectItemSlotEvent(ui.__mem_func__(self.__SelectRefineItemSlot))
		
		wndResultSlot.SetOverInItemEvent(ui.__mem_func__(self.__OverInResultItem))
		wndResultSlot.SetOverOutItemEvent(ui.__mem_func__(self.__OverOutItem))
		self.wndRefineSlot = wndRefineSlot
		self.wndResultSlot = wndResultSlot
		
		## Button
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].SetToggleDownEvent(self.__ToggleDownGradeButton)
		self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetToggleDownEvent(self.__ToggleDownStepButton)
		self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetToggleDownEvent(self.__ToggleDownStrengthButton)
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_GRADE))
		self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_STEP))
		self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetToggleUpEvent(lambda : self.__ToggleUpButton(self.REFINE_TYPE_STRENGTH))
		self.doRefineButton.SetEvent(self.__PressDoRefineButton)
		
		## Dialog
		self.wndPopupDialog = uiCommon.PopupDialog()
		
		self.currentRefineType = self.REFINE_TYPE_GRADE
		self.refineItemInfo = {}
		self.resultItemInfo = {}
		self.currentRecipe = {}
		
		self.wndMoney.SetText(localeInfo.NumberToMoneyString(0))
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].Down()
		
		self.__Initialize()
	def __LoadWindow(self):
		if self.isLoaded == 1:
			return
		self.isLoaded = 1
		try:
			pyScrLoader = ui.PythonScriptLoader()			
			pyScrLoader.LoadScriptFile(self, "uiscript/dragonsoulwindow.py")
		
		except:
			import exception
			exception.Abort("dragonsoulwindow.LoadWindow.LoadObject")
		try:
			wndItem = self.GetChild("ItemSlot")
			wndEquip = self.GetChild("EquipmentSlot")
			self.activateButton = self.GetChild("activate")
			self.deckTab = []
			self.deckTab.append(self.GetChild("deck1"))
			self.deckTab.append(self.GetChild("deck2"))
			self.GetChild("TitleBar").SetCloseEvent(ui.__mem_func__(self.Close))			
			self.inventoryTab = []
			self.inventoryTab.append(self.GetChild("Inventory_Tab_01"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_02"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_03"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_04"))
			self.inventoryTab.append(self.GetChild("Inventory_Tab_05"))
			self.tabDict = {
				0	: self.GetChild("Tab_01"),
				1	: self.GetChild("Tab_02"),
				2	: self.GetChild("Tab_03"),
				3	: self.GetChild("Tab_04"),
				4	: self.GetChild("Tab_05"),
				5	: self.GetChild("Tab_06"),
			}
			self.tabButtonDict = {
				0	: self.GetChild("Tab_Button_01"),
				1	: self.GetChild("Tab_Button_02"),
				2	: self.GetChild("Tab_Button_03"),
				3	: self.GetChild("Tab_Button_04"),
				4	: self.GetChild("Tab_Button_05"),
				5	: self.GetChild("Tab_Button_06"),
			}
			self.tabText = self.GetChild("tab_text_area")
		except:
			import exception
			exception.Abort("InventoryWindow.LoadWindow.BindObject")
		## DragonSoul Kind Tap
		for (tabKey, tabButton) in self.tabButtonDict.items():
			tabButton.SetEvent(ui.__mem_func__(self.SetDSKindIndex), tabKey)
		## Item
		wndItem.SetOverInItemEvent(ui.__mem_func__(self.OverInItem))
		wndItem.SetOverOutItemEvent(ui.__mem_func__(self.OverOutItem))
		wndItem.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectItemSlot))
		wndItem.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptySlot))
		wndItem.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseItemSlot))
		wndItem.SetUseSlotEvent(ui.__mem_func__(self.UseItemSlot))
		
		## Equipment
		wndEquip.SetSelectEmptySlotEvent(ui.__mem_func__(self.SelectEmptyEquipSlot))
		wndEquip.SetSelectItemSlotEvent(ui.__mem_func__(self.SelectEquipItemSlot))
		wndEquip.SetUnselectItemSlotEvent(ui.__mem_func__(self.UseEquipItemSlot))
		wndEquip.SetUseSlotEvent(ui.__mem_func__(self.UseEquipItemSlot))
		wndEquip.SetOverInItemEvent(ui.__mem_func__(self.OverInEquipItem))
		wndEquip.SetOverOutItemEvent(ui.__mem_func__(self.OverOutEquipItem))
		
		## Deck
		self.deckTab[0].SetToggleDownEvent(lambda arg=0: self.SetDeckPage(arg))
		self.deckTab[1].SetToggleDownEvent(lambda arg=1: self.SetDeckPage(arg))
		self.deckTab[0].SetToggleUpEvent(lambda arg=0: self.__DeckButtonDown(arg))
		self.deckTab[1].SetToggleUpEvent(lambda arg=1: self.__DeckButtonDown(arg))
		self.deckTab[0].Down()
		## Grade button
		self.inventoryTab[0].SetEvent(lambda arg=0: self.SetInventoryPage(arg))
		self.inventoryTab[1].SetEvent(lambda arg=1: self.SetInventoryPage(arg))
		self.inventoryTab[2].SetEvent(lambda arg=2: self.SetInventoryPage(arg))
		self.inventoryTab[3].SetEvent(lambda arg=3: self.SetInventoryPage(arg))
		self.inventoryTab[4].SetEvent(lambda arg=4: self.SetInventoryPage(arg))
		self.inventoryTab[0].Down()
		## Etc
		self.wndItem = wndItem
		self.wndEquip = wndEquip
		
		self.dlgQuestion = uiCommon.QuestionDialog2()
		self.dlgQuestion.Close()
		
		self.activateButton.SetToggleDownEvent(ui.__mem_func__(self.ActivateButtonClick))
		self.activateButton.SetToggleUpEvent(ui.__mem_func__(self.ActivateButtonClick))
		self.wndPopupDialog = uiCommon.PopupDialog()
		
		## 
		self.listHighlightedSlot = []
		
		## Refresh
		self.SetInventoryPage(0)
		self.RefreshItemSlot()
		self.RefreshEquipSlotWindow()
		self.RefreshBagSlotWindow()
		self.SetDSKindIndex(0)
		self.activateButton.Enable()
		self.deckTab[self.deckPageIndex].Down()
		self.activateButton.SetUp()
Example #10
0
 def PopupMsg(self, msg):
     self.popup = uiCommon.PopupDialog()
     self.popup.SetText(msg)
     self.popup.Open()
Example #11
0
 def PopupMessage(self, msg):
     self.wndPopupDialog = uiCommon.PopupDialog()
     self.wndPopupDialog.SetText(msg)
     self.wndPopupDialog.Open()
Example #12
0
    def SellAttachedItem(self):
        import constInfo, chat
        if constInfo.BlockItemsSystem["Block"] == 1:
            chat.AppendChat(1, "Sicherheitssystem Aktiviert.")
            return

        if shop.IsPrivateShop():
            mouseModule.mouseController.DeattachObject()
            return

        attachedSlotType = mouseModule.mouseController.GetAttachedType()
        attachedSlotPos = mouseModule.mouseController.GetAttachedSlotNumber()
        attachedCount = mouseModule.mouseController.GetAttachedItemCount()
        if localeInfo.IsBRAZIL() == 0:
            attachedItemIndex = mouseModule.mouseController.GetAttachedItemIndex(
            )

        if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_INVENTORY == attachedSlotType or fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:

            if localeInfo.IsBRAZIL():
                itemIndex = fgGHGjjFHJghjfFG1545gGG.GetItemIndex(
                    attachedSlotPos)
                item.SelectItem(itemIndex)
            else:
                item.SelectItem(attachedItemIndex)

            if item.IsAntiFlag(item.ANTIFLAG_SELL):
                popup = uiCommon.PopupDialog()
                popup.SetText(localeInfo.SHOP_CANNOT_SELL_ITEM)
                popup.SetAcceptEvent(self.__OnClosePopupDialog)
                popup.Open()
                self.popup = popup
                return

            itemtype = fgGHGjjFHJghjfFG1545gGG.INVENTORY

            if localeInfo.IsBRAZIL() == 0:
                if fgGHGjjFHJghjfFG1545gGG.SLOT_TYPE_DRAGON_SOUL_INVENTORY == attachedSlotType:
                    itemtype = fgGHGjjFHJghjfFG1545gGG.DRAGON_SOUL_INVENTORY

            if fgGHGjjFHJghjfFG1545gGG.IsValuableItem(itemtype,
                                                      attachedSlotPos):

                itemPrice = item.GetISellItemPrice()

                if item.Is1GoldItem():
                    itemPrice = attachedCount / itemPrice / 5
                else:
                    itemPrice = itemPrice * max(1, attachedCount) / 5

                itemName = item.GetItemName()

                questionDialog = uiCommon.QuestionDialog()
                questionDialog.SetText(
                    localeInfo.DO_YOU_SELL_ITEM(itemName, attachedCount,
                                                itemPrice))

                questionDialog.SetAcceptEvent(
                    lambda arg1=attachedSlotPos, arg2=attachedCount, arg3=
                    itemtype: self.OnSellItem(arg1, arg2, arg3))
                questionDialog.SetCancelEvent(
                    ui.__mem_func__(self.OnCloseQuestionDialog))
                questionDialog.Open()
                self.questionDialog = questionDialog

                constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)

            else:
                self.OnSellItem(attachedSlotPos, attachedCount, itemtype)

        else:
            snd.PlaySound("sound/ui/loginfail.wav")

        mouseModule.mouseController.DeattachObject()
Example #13
0
    def __BindEvent(self):
        if self.bgColorPickerButton:
            self.bgColorPickerButton.SetEvent(
                ui.__mem_func__(self.OnClickColorPicker))

        if self.confirmButton:
            self.confirmButton.SetEvent(
                ui.__mem_func__(self.OnClickConfirmButton))

        if self.cancelButton:
            self.cancelButton.SetEvent(
                ui.__mem_func__(self.OnClickCancelButton))

        if self.defaultButton:
            self.defaultButton.SetEvent(
                ui.__mem_func__(self.OnClickDefaultButton))

        if self.prevPageButton:
            self.prevPageButton.SetEvent(
                ui.__mem_func__(self.OnClickPrevButton))

        if self.nextPageButton:
            self.nextPageButton.SetEvent(
                ui.__mem_func__(self.OnClickNextButton))

        if self.bg2CustomColorEditLine:
            self.bg2CustomColorEditLine.OnIMEUpdate = ui.__mem_func__(
                self.OnUpdateHex)

        ## Color Preset List
        if self.bg2ColorPresetEditLine and self.bg2ColorPresetButton:
            self.bg2ColorPresetEditLine.SetEvent(
                ui.__mem_func__(self.OnClickColorPresetButton))
            self.bg2ColorPresetButton.SetEvent(
                ui.__mem_func__(self.OnClickColorPresetButton))
            self.bg2ColorPresetEditLine.SetTextAlignLeft(
                self.bg2ColorPresetEditLine.GetText(), 2)

        if self.bg2ColorPresetSaveButton:
            self.bg2ColorPresetSaveButton.SetEvent(
                ui.__mem_func__(self.OnClickSaveColorButton))
            self.bg2ColorPresetSaveButton.Disable()
            self.bg2ColorPresetSaveButton.Down()

        if self.bg2ColorPresetClearButton:
            self.bg2ColorPresetClearButton.SetEvent(
                ui.__mem_func__(self.OnClickClearColorButton))
            self.bg2ColorPresetClearButton.Disable()
            self.bg2ColorPresetClearButton.Down()

        ## ToolTips
        if self.bg2ColorPresetToolTip:
            self.colorPresetToolTip = self.__CreateGameTypeToolTip(
                localeInfo.SKILL_COLOR_PRESET_TOOLTIP_TITLE,
                COLOR_PRESET_TOOLTIP_LIST)

        if self.bg2CustomColorToolTip:
            self.customColorToolTip = self.__CreateGameTypeToolTip(
                localeInfo.SKILL_COLOR_CUSTOM_HEX_CODE_TOOLTIP_TITLE,
                CUSTOM_COLOR_HEX_CODE_TOOLTIP_LIST)

        i = 0
        for btn in self.bgColorLayerButton:
            btn.SetEvent(ui.__mem_func__(self.OnClickColorTab), i)
            i = i + 1

        self.toolTip = uiToolTip.ToolTip()
        self.toolTip.ClearToolTip()

        self.popup = uiCommon.PopupDialog()

        self.currentSkillColor = []
        tmpSkillColor = player.GetSkillColor(self.skillSlot)
        for tmpColor in tmpSkillColor:
            self.currentSkillColor.append(tmpColor)
            self.skillColors.append(tmpColor)

        self.GetCurrentColor(self.skillSlot)
        self.ReloadSavedColorPreset(self.skillSlot)
        self.ReloadPage()
        self.OnClickColorTab(0)