def __init__(self, skin, idx): ui.ScriptWindow.__init__(self) self.SetWindowName("quest dialog") self.focusIndex = 0 self.board = None self.sx = 0 self.sy = 0 self.skin = skin if skin == 3: event.SetRestrictedCount(idx, 36) else: event.SetRestrictedCount(idx, 60) QuestCurtain.BarHeight = (wndMgr.GetScreenHeight() - wndMgr.GetScreenWidth() * 9 / 16) / 2 if QuestCurtain.BarHeight < 0: QuestCurtain.BarHeight = 50 if not ('QuestCurtain' in QuestDialog.__dict__): QuestDialog.QuestCurtain = QuestCurtain() QuestDialog.QuestCurtain.Show() QuestDialog.QuestCurtain.CurtainMode = 1 self.nextCurtainMode = 0 if self.skin: QuestDialog.QuestCurtain.CurtainMode = 1 self.nextCurtainMode = 0 self.LoadDialog(self.skin) else: QuestDialog.QuestCurtain.CurtainMode = -1 self.nextCurtainMode = -1 self.descIndex = idx self.descWindow = DescriptionWindow(idx) self.descWindow.Show() self.eventCurtain = EventCurtain(idx) event.SetEventHandler(idx, self) self.OnCloseEvent = None self.btnAnswer = None self.btnNext = None self.imgLeft = None self.imgTop = None self.imgBackground = None self.imgTitle = None self.titleState = self.TITLE_STATE_NONE self.titleShowTime = 0 self.images = [] self.prevbutton = None self.nextbutton = None # QUEST_INPUT self.needInputString = False self.editSlot = None self.editLine = None
def OnSelectEmpire(self, arg): for key in self.empireArea.keys(): self.empireAreaDestAlpha[key] = 0.0 self.empireAreaFlagDestAlpha[key] = 0.0 self.empireFlagDestAlpha[key] = 0.0 self.empireAreaDestAlpha[arg] = 1.0 self.empireAreaFlagDestAlpha[arg] = 1.0 self.empireFlagDestAlpha[arg] = 1.0 self.empireID = arg self.empireName.SetText(self.EMPIRE_NAME.get(self.empireID, "")) rgb = self.EMPIRE_NAME_COLOR[self.empireID] self.empireName.SetFontColor(rgb[0], rgb[1], rgb[2]) snd.PlaySound("sound/ui/click.wav") event.ClearEventSet(self.descIndex) if self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME.has_key(arg): self.descIndex = event.RegisterEventSet( self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME[arg]) #event.SetFontColor(self.descIndex, 0.7843, 0.7843, 0.7843) if localeInfo.IsARABIC(): event.SetEventSetWidth(self.descIndex, 170) else: event.SetRestrictedCount(self.descIndex, 35) if event.BOX_VISIBLE_LINE_COUNT >= event.GetTotalLineCount( self.descIndex): self.btnPrev.Hide() self.btnNext.Hide() else: self.btnPrev.Show() self.btnNext.Show()
def OnSelectEmpire(self, arg): for key in self.empireArea.keys(): self.empireAreaDestAlpha[key] = 0.0 self.empireAreaFlagDestAlpha[key] = 0.0 self.empireFlagDestAlpha[key] = 0.0 self.empireAreaDestAlpha[arg] = 1.0 self.empireAreaFlagDestAlpha[arg] = 1.0 self.empireFlagDestAlpha[arg] = 1.0 self.empireID = arg event.ClearEventSet(self.descIndex) if self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME.has_key(arg): self.descIndex = event.RegisterEventSet(self.EMPIRE_DESCRIPTION_TEXT_FILE_NAME[arg]) if localeInfo.IsARABIC(): event.SetEventSetWidth(self.descIndex, 170) else: event.SetRestrictedCount(self.descIndex, 35)
def SelectJob(self, job_id): if self.MotionStart : self.JobList[job_id].SetUp() return for button in self.JobList: button.SetUp() ##Default Setting## self.job_id = job_id self.JobList[self.job_id].Down() self.SelectGender(self.JobSex[job_id]) ##Job Descirption## event.ClearEventSet(self.descIndex) self.descIndex = event.RegisterEventSet(self.DESCRIPTION_FILE_NAME[self.job_id]) #event.SetFontColor(self.descIndex, 0.7843, 0.7843, 0.7843) total_line = event.GetTotalLineCount(self.descIndex) self.raceNameText.SetText(self.M2JOBLIST[job_id]) if localeInfo.IsARABIC(): event.SetEventSetWidth(self.descIndex, 170) else: event.SetRestrictedCount(self.descIndex, 35) if event.BOX_VISIBLE_LINE_COUNT >= total_line : self.btnPrev.Hide() self.btnNext.Hide() else : self.btnPrev.Show() self.btnNext.Show() ##Stat Point## self.ResetStat() if self.M2_CONST_ID[self.job_id][MAN] == playerSettingModule.RACE_WOLFMAN_M : self.genderButtonList[WOMAN].Hide() else: self.genderButtonList[WOMAN].Show()
def __SetDescriptionEvent(self): event.ClearEventSet(self.descIndex) self.descIndex = event.RegisterEventSet(uiScriptLocale.CARDS_DESC) event.SetRestrictedCount(self.descIndex, 100) event.SetVisibleLineCount(self.descIndex, 18)
def SelectButton(self, slot): #print "self.RealSlot = %s" % self.RealSlot #slot 0 ~ 4 if slot >= self.mycharacters.GetMyCharacterCount( ) or slot == self.SelectSlot: return if self.Not_SelectMotion or self.MotionTime != 0.0: self.CharacterButtonList[slot].SetUp() self.CharacterButtonList[slot].Over() return for button in self.CharacterButtonList: button.SetUp() self.SelectSlot = slot self.CharacterButtonList[self.SelectSlot].Down() self.stream.SetCharacterSlot(self.RealSlot[self.SelectSlot]) self.select_job = self.mycharacters.GetJob(self.SelectSlot) ##Job Descirption## event.ClearEventSet(self.descIndex) self.descIndex = event.RegisterEventSet( self.DESCRIPTION_FILE_NAME[self.select_job]) #event.SetFontColor(self.descIndex, 0.7843, 0.7843, 0.7843) if localeInfo.IsARABIC(): event.SetEventSetWidth(self.descIndex, 170) else: event.SetRestrictedCount(self.descIndex, 35) if event.BOX_VISIBLE_LINE_COUNT >= event.GetTotalLineCount( self.descIndex): self.btnPrev.Hide() self.btnNext.Hide() else: self.btnPrev.Show() self.btnNext.Show() self.ResetStat() ## 한문 Setting ## for i in xrange(len(self.NameList)): if self.select_job == i: self.NameList[i].SetAlpha(1) else: self.NameList[i].SetAlpha(0) ## Face Setting & Font Color Setting ## self.select_race = self.mycharacters.GetRace(self.SelectSlot) #print "self.mycharacters.GetMyCharacterCount() = %s" % self.mycharacters.GetMyCharacterCount() for i in xrange(self.mycharacters.GetMyCharacterCount()): if slot == i: self.FaceImage[slot].LoadImage( self.RACE_FACE_PATH[self.select_race] + "1.sub") self.CharacterButtonList[slot].SetAppendTextColor( 0, self.Name_FontColor) else: self.FaceImage[i].LoadImage( self.RACE_FACE_PATH[self.mycharacters.GetRace(i)] + "2.sub") self.CharacterButtonList[i].SetAppendTextColor( 0, self.Name_FontColor_Def) ## Desc Face & raceText Setting ## self.discFace.LoadImage(self.DISC_FACE_PATH[self.select_race]) self.raceNameText.SetText(self.JOB_LIST[self.select_job]) chr.Hide() chr.SelectInstance(self.SelectSlot) chr.Show()