Example #1
0
    def SendMobileMessage(self, name):
        if not uiGameOption.MOBILE:
            return

        if not self.hasMobilePhoneNumber:
            questionDialog = uiCommon.QuestionDialog2()
            questionDialog.SetText1(
                localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_1)
            questionDialog.SetText2(
                localeInfo.MESSENGER_INPUT_MOBILE_PHONE_NUMBER_2)
            questionDialog.SetAcceptEvent(
                ui.__mem_func__(self.OnAcceptInputMobilePhoneNumber))
            questionDialog.SetCancelEvent(
                ui.__mem_func__(self.OnCancelInputMobilePhoneNumber))
            questionDialog.SetWidth(400)
            questionDialog.Open()
            self.questionDialog = questionDialog
            return

        ## Input Sending Mobile Message
        inputDialog = uiCommon.InputDialog()
        inputDialog.SetTitle(localeInfo.MESSENGER_SEND_MOBILE_MESSAGE_TITLE)
        inputDialog.SetMaxLength(50)
        inputDialog.SetAcceptEvent(ui.__mem_func__(self.OnInputMobileMessage))
        inputDialog.SetCancelEvent(ui.__mem_func__(self.OnCloseInputDialog))
        inputDialog.name = name
        inputDialog.Open()
        self.inputDialog = inputDialog
Example #2
0
    def OpenQuestionDialog(self):

        if 100 == self.percentage:
            self.Accept()
            return

        if 5 == self.type:  ## 무신의 축복서
            self.Accept()
            return

        dlgQuestion = uiCommon.QuestionDialog2()
        dlgQuestion.SetText2(localeInfo.REFINE_WARNING2)
        dlgQuestion.SetAcceptEvent(ui.__mem_func__(self.Accept))
        dlgQuestion.SetCancelEvent(ui.__mem_func__(dlgQuestion.Close))

        if 3 == self.type:  ## 현철
            dlgQuestion.SetText1(
                localeInfo.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_1)
            dlgQuestion.SetText2(
                localeInfo.REFINE_DESTROY_WARNING_WITH_BONUS_PERCENT_2)
        elif 2 == self.type:  ## 축복서
            dlgQuestion.SetText1(localeInfo.REFINE_DOWN_GRADE_WARNING)
        else:
            dlgQuestion.SetText1(localeInfo.REFINE_DESTROY_WARNING)

        dlgQuestion.Open()
        self.dlgQuestion = dlgQuestion
Example #3
0
    def AskBuyItem(self, slotPos):
        if not app.ENABLE_OFFLINE_SHOP:
            slotPos = self.__GetRealIndex(slotPos)

        itemIndex = shop.GetItemID(slotPos)
        itemPrice = shop.GetItemPrice(slotPos)
        if app.ENABLE_OFFLINE_SHOP:
            itemPriceTwo = shop.GetItemPrice2(slotPos)
            itemPriceThree = shop.GetItemPrice3(slotPos)
            itemPriceFour = shop.GetItemPrice4(slotPos)
        itemCount = shop.GetItemCount(slotPos)

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

        if app.ENABLE_OFFLINE_SHOP:
            if not itemPriceTwo and not itemPriceThree and not itemPriceFour:
                itemBuyQuestionDialog = uiCommon.QuestionDialog()
                itemBuyQuestionDialog.SetText(
                    localeInfo.DO_YOU_BUY_ITEM(itemName, itemCount, itemPrice))
            else:
                itemBuyQuestionDialog = uiCommon.QuestionDialog2()
                itemBuyQuestionDialog.SetText1(
                    localeInfo.DO_YOU_BUY_ITEM_NEW(
                        itemName, itemCount,
                        localeInfo.NumberToMoneyString(itemPrice),
                        localeInfo.NumberToPriceString(itemPriceTwo, "Coin"),
                        localeInfo.NumberToPriceString(itemPriceThree,
                                                       "Goldbar"),
                        localeInfo.NumberToPriceString(itemPriceFour,
                                                       "Won"))[0])
                itemBuyQuestionDialog.SetText2(
                    localeInfo.DO_YOU_BUY_ITEM_NEW(
                        itemName, itemCount,
                        localeInfo.NumberToMoneyString(itemPrice),
                        localeInfo.NumberToPriceString(itemPriceTwo, "Coin"),
                        localeInfo.NumberToPriceString(itemPriceThree,
                                                       "Goldbar"),
                        localeInfo.NumberToPriceString(itemPriceFour,
                                                       "Won"))[1])
        else:
            itemBuyQuestionDialog = uiCommon.QuestionDialog()
            itemBuyQuestionDialog.SetText(
                localeInfo.DO_YOU_BUY_ITEM(
                    itemName, itemCount,
                    localeInfo.NumberToMoneyString(itemPrice)))

        itemBuyQuestionDialog.SetAcceptEvent(
            lambda arg=True: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.SetCancelEvent(
            lambda arg=False: self.AnswerBuyItem(arg))
        if app.ENABLE_OFFLINE_SHOP:
            if itemPriceTwo or itemPriceThree or itemPriceFour:
                itemBuyQuestionDialog.SetWidth(550)
        itemBuyQuestionDialog.Open()
        itemBuyQuestionDialog.pos = slotPos
        self.itemBuyQuestionDialog = itemBuyQuestionDialog

        constInfo.SET_ITEM_QUESTION_DIALOG_STATUS(1)
 def __EndGame(self):
     questionDialog = uiCommon.QuestionDialog2()
     questionDialog.SetText1(localeInfo.MINI_GAME_RUMI_EXIT_QUESTION)
     questionDialog.SetText2(localeInfo.MINI_GAME_RUMI_EXIT_QUESTION2)
     questionDialog.SetAcceptEvent(ui.__mem_func__(self.OnEndGame))
     questionDialog.SetCancelEvent(
         ui.__mem_func__(self.OnCloseQuestionDialog))
     questionDialog.Open()
     self.questionDialog = questionDialog
	def SlotAddQuestion(self, slotIndex, needCount, needName):
		questionDialog = uiCommon.QuestionDialog2()
		questionDialog.SetText1((localeInfo.GEM_SYSTEM_ADD_SLOT_0 % str(needName)), True)
		questionDialog.SetText2((localeInfo.GEM_SYSTEM_ADD_SLOT_1 % int(needCount)), True)
		questionDialog.SetAcceptEvent(lambda arg = int(slotIndex): ui.__mem_func__(self.SlotAddQuestionAccept)(arg))
		questionDialog.SetCancelEvent(ui.__mem_func__(self.SlotAddQuestionCancel))
		questionDialog.AutoResize()
		questionDialog.Open()
		self.questionDialog = questionDialog
 def __OnStartQuestion(self):
     questionDialog = uiCommon.QuestionDialog2()
     questionDialog.SetText1(localeInfo.MINI_GAME_RUMI_START_QUESTION %
                             (5000000, 1))
     questionDialog.SetText2(localeInfo.MINI_GAME_RUMI_START_QUESTION2)
     questionDialog.SetAcceptEvent(ui.__mem_func__(self.__OnStart))
     questionDialog.SetCancelEvent(
         ui.__mem_func__(self.OnCloseQuestionDialog))
     questionDialog.Open()
     self.questionDialog = questionDialog
Example #7
0
	def Question2(self, text, text2, width, acceptevent, cancelevent):
		tmpQuestion2 = uiCommon.QuestionDialog2()
		
		tmpQuestion2.SetText1(str(text))
		tmpQuestion2.SetText2(str(text2))
		
		if width: tmpQuestion2.SetWidth(width)
		
		if acceptevent: tmpQuestion2.SAFE_SetAcceptEvent(acceptevent)
		if cancelevent: tmpQuestion2.SAFE_SetCancelEvent(cancelevent)
		
		tmpQuestion2.Open()
		return tmpQuestion2
Example #8
0
    def AcceptExchange(self):
        if app.ENABLE_NEW_EXCHANGE_WINDOW:
            atLeastOneItem = 0
            atLeastOneYang = 0
            for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
                itemCount = exchange.GetItemCountFromTarget(i)
                if itemCount >= 1:
                    atLeastOneYang = 1
                    break

            if exchange.GetElkFromTarget() >= 1:
                atLeastOneYang = 1

            if atLeastOneItem or atLeastOneYang:
                GFHhg54GHGhh45GHGH.SendExchangeAcceptPacket()
                self.AcceptButton.Disable()
            else:
                atLeastOneItem = 0
                atLeastOneYang = 0
                for i in xrange(exchange.EXCHANGE_ITEM_MAX_NUM):
                    itemCount = exchange.GetItemCountFromSelf(i)
                    if itemCount >= 1:
                        atLeastOneYang = 1
                        break

                if exchange.GetElkFromSelf() >= 1:
                    atLeastOneYang = 1

                if atLeastOneItem or atLeastOneYang:
                    self.questionDialog = uiCommon.QuestionDialog2()
                    self.questionDialog.SetText1(
                        localeInfo.NEW_EXCHANGE_ALERT1)
                    self.questionDialog.SetText2(
                        localeInfo.NEW_EXCHANGE_ALERT2)
                    self.questionDialog.SetAcceptEvent(
                        ui.__mem_func__(self.AcceptQuestion))
                    self.questionDialog.SetCancelEvent(
                        ui.__mem_func__(self.OnCloseQuestionDialog))
                    self.questionDialog.Open()
                else:
                    GFHhg54GHGhh45GHGH.SendExchangeAcceptPacket()
                    self.AcceptButton.Disable()
        else:
            GFHhg54GHGhh45GHGH.SendExchangeAcceptPacket()
            self.AcceptButton.Disable()
	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()