Example #1
0
	def __CanRefineStrength (self, vnum):
		# 용혼석인 경우, 더 이상 strength 강화를 할 수 없는지 체크해야함.
		if self.__IsDragonSoul(vnum):
			ds_type, grade, step, strength = self.__GetDragonSoulTypeInfo(vnum)
			
			import dragon_soul_refine_settings
			if strength >= dragon_soul_refine_settings.dragon_soul_refine_info[ds_type]["strength_max_table"][grade][step]:
				self.__PopUp(locale.DRAGON_SOUL_CANNOT_REFINE_MORE)
				return FALSE

			else:
				return TRUE
		
		# strength 강화의 경우, refine_recipe가 용혼석의 종류가 아닌, 강화석의 종류에 따라 달라진다.
		# 따라서 용혼석이 아니라면, 
		# 이미 레시피가 있는 경우는, 강화석이 강화창에 있다는 것이므로, return FALSE
		# 레시피가 없는 경우는, 강화석인지 확인하고, 레시피를 셋팅한다.
		else:
			if self.currentRecipe:
				self.__PopUp(locale.DRAGON_SOUL_IS_NOT_DRAGON_SOUL)
				return FALSE
			else:
				refineRecipe = self.__GetRefineStrengthInfo(vnum)
				if refineRecipe:
					self.currentRecipe = refineRecipe
					self.wndMoney.SetText(locale.NumberToMoneyString(self.currentRecipe["fee"]))
					return TRUE
				else:
				# 레시피를 셋팅할 수 없는 경우
					self.__PopUp(locale.DRAGON_SOUL_NOT_DRAGON_SOUL_REFINE_STONE)
					return FALSE
Example #2
0
	def __CanRefineStep (self, vnum):
		ds_info = self.__GetDragonSoulTypeInfo(vnum)
		
		if DragonSoulRefineWindow.INVALID_DRAGON_SOUL_INFO == ds_info:
			self.__PopUp(locale.DRAGON_SOUL_IS_NOT_DRAGON_SOUL)
			return FALSE
		
		if self.currentRecipe:
			ds_type, grade, step, strength = ds_info
			cur_refine_ds_type, cur_refine_grade, cur_refine_step, cur_refine_strength = self.currentRecipe["ds_info"]
			if not (cur_refine_ds_type == ds_type and cur_refine_grade == grade and cur_refine_step == step):
				self.__PopUp(locale.DRAGON_SOUL_INVALID_DRAGON_SOUL)
				return FALSE
		# 강화 창에 처음 아이템을 올리는 경우, 재료에 관한 정보가 없다.
		# 용혼석 강화가, 레시피를 가지고 시작하는 것이 아니라, 강화창에 처음 올리는 아이템이 무엇이냐에 따라,
		# 무엇을 강화하고, 재료가 무엇인지(이하 레시피)가 정해진다.
		# 레시피가 없다면, 처음 올린 아이템이라 생각하고, vnum을 바탕으로 레시피를 셋팅.
		else:
			self.currentRecipe = self.__GetRefineStepRecipe(vnum)

			if self.currentRecipe:
				self.refineSlotLockStartIndex = self.currentRecipe["need_count"]
				self.wndMoney.SetText(locale.NumberToMoneyString(self.currentRecipe["fee"]))				
				return TRUE

			else:
			# 강화 정보 셋팅에 실패하면 올릴 수 없는 아이템으로 판단.
				self.__PopUp(locale.DRAGON_SOUL_CANNOT_REFINE)
				return FALSE
Example #3
0
 	def Show(self):
 		self.currentRefineType = self.REFINE_TYPE_GRADE
		self.wndMoney.SetText(locale.NumberToMoneyString(0))
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].Down()
		self.refineChoiceButtonDict[self.REFINE_TYPE_STEP].SetUp()
		self.refineChoiceButtonDict[self.REFINE_TYPE_STRENGTH].SetUp()
		
		self.Refresh()
 		
		ui.ScriptWindow.Show(self)
Example #4
0
	def __Initialize(self):
		self.currentRecipe = {}
		self.refineItemInfo = {}
		self.resultItemInfo = {}
		
		if self.REFINE_TYPE_STRENGTH == self.currentRefineType:
			self.refineSlotLockStartIndex = 2
		else:
			self.refineSlotLockStartIndex = 1

		for i in xrange(self.refineSlotLockStartIndex):
			self.wndRefineSlot.HideSlotBaseImage(i)

		self.wndMoney.SetText(locale.NumberToMoneyString(0))
Example #5
0
    def __OnValueUpdate(self):
        ui.EditLine.OnIMEUpdate(self.inputValue)

        text = self.inputValue.GetText()

        money = 0
        if text and text.isdigit():
            try:
                money = int(text)
            except ValueError:
                money = 199999999

        self.moneyText.SetText(self.moneyHeaderText +
                               locale.NumberToMoneyString(money))
Example #6
0
    def AskBuyItem(self, slotPos):
        slotPos = self.__GetRealIndex(slotPos)

        itemIndex = shop.GetItemID(slotPos)
        itemPrice = shop.GetItemPrice(slotPos)
        itemCount = shop.GetItemCount(slotPos)

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

        itemBuyQuestionDialog = uiCommon.QuestionDialog()
        itemBuyQuestionDialog.SetText(
            locale.DO_YOU_BUY_ITEM(itemName, itemCount,
                                   locale.NumberToMoneyString(itemPrice)))
        itemBuyQuestionDialog.SetAcceptEvent(
            lambda arg=TRUE: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.SetCancelEvent(
            lambda arg=FALSE: self.AnswerBuyItem(arg))
        itemBuyQuestionDialog.Open()
        itemBuyQuestionDialog.pos = slotPos
        self.itemBuyQuestionDialog = itemBuyQuestionDialog
Example #7
0
                    "x_count": 8,
                    "y_count": 3,
                    "x_step": 32,
                    "y_step": 32,
                    "image": "d:/ymir work/ui/public/Slot_Base.sub"
                },
                ## Print
                {
                    "name": "NeedMoney",
                    "type": "text",
                    "x": 20,
                    "y": 468,
                    "width": 200,
                    "horizontal_align": "right",
                    "text_horizontal_align": "right",
                    "text": locale.NumberToMoneyString(0),
                },
                {
                    "name": "contentScrollbar",
                    "type": "thin_scrollbar",
                    "x": 253,
                    "y": 38,
                    "size": 315,
                },

                # Cube Result List. 1 ~ 3
                {
                    "name":
                    "result1board",
                    "type":
                    "window",
Example #8
0
	def RefreshStatus(self):
		money = player.GetElk()
		self.wndMoney.SetText(locale.NumberToMoneyString(money))
Example #9
0
	def __LoadWindow(self):
		if self.isLoaded == 1:
			return
		self.isLoaded = 1
		try:
			pyScrLoader = ui.PythonScriptLoader()			
			pyScrLoader.LoadScriptFile(self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "dragonsoulrefinewindow.py")

		except:
			import exception
			exception.Abort("dragonsoulrefinewindow.LoadWindow.LoadObject")
		try:
			if locale.IsARABIC():
				self.board = self.GetChild("DragonSoulRefineWindowBaseImage")
				self.board.SetScale(-1.0, 1.0)
				self.board.SetRenderingRect(-1.0, 0.0, 1.0, 0.0)
				
			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(locale.NumberToMoneyString(0))
		self.refineChoiceButtonDict[self.REFINE_TYPE_GRADE].Down()
		
		self.__Initialize()
Example #10
0
    def UpdateInfo(self, gold, itemVnum, count):
        if self.needMoney:
            self.needMoney.SetText(locale.NumberToMoneyString(gold))

        self.Refresh()