def updateWidget(self): self.selectionsID = [] text = player.currentText.replace("\r\n", "\n") if player.questCompleted: text = text + "\n\n\\c008000" + _("Quest completed!", "Planet.NotCivil.QuestPlay.MsgSuccess") + "\\cR" elif player.questFailed: text = text + "\n\n\\c800000" + _("Quest failed!", "Planet.NotCivil.QuestPlay.MsgFail") + "\\cR" if player.death: text = text + "\n\n\\c800000" + _("You're dead!", "Planet.NotCivil.QuestPlay.MsgDeath") + "\\cR" self.interact.text = text trans = player.visibleTransitions selections = [] for t in trans: self.selectionsID.append(t[0]) selections.append((t[1], t[2])) self.interact.selections = selections self.paramLabel.text = "\n".join(player.visibleParameters) newImage = getCacheDATPath(self.images[player.currentImage]) if newImage != "": if self.image: self.removeChild(self.image) self.image = Sprite(newImage) self.image.layer = -1 self.image.position = (656, 32) self.addChild(self.image)
def loadQuests(self): dat = resources.datRoot() self.rangerName = dat['FormLoadQuest']['PRanger'].value self.toPlanet = dat['FormLoadQuest']['PToPlanet'].value self.toStar = dat['FormLoadQuest']['PToStar'].value self.fromPlanet = dat['FormLoadQuest']['PFromPlanet'].value self.fromStar = dat['FormLoadQuest']['PFromStar'].value self.quests = [] for q in dat['PlanetQuest']['List']: info = QuestInfo() info.id = q.name info.name = q['Name'].value info.genre = q['Genre'].value info.group = int(q['Group'].value) info.access = int(q['Access'].value) info.length = int(q['Length'].value) info.image = getCacheDATPath(q['Image'].value) info.difficulty = int(q['Dif'].value) self.quests.append(info)
def updateWidget(self): self.selectionsID = [] text = player.currentText.replace("\r\n", "\n") if player.questCompleted: text = text + "\n\n\\c008000" + _( "Quest completed!", "Planet.NotCivil.QuestPlay.MsgSuccess") + "\\cR" elif player.questFailed: text = text + "\n\n\\c800000" + _( "Quest failed!", "Planet.NotCivil.QuestPlay.MsgFail") + "\\cR" if player.death: text = text + "\n\n\\c800000" + _( "You're dead!", "Planet.NotCivil.QuestPlay.MsgDeath") + "\\cR" self.interact.text = text trans = player.visibleTransitions selections = [] for t in trans: self.selectionsID.append(t[0]) selections.append((t[1], t[2])) self.interact.selections = selections self.paramLabel.text = "\n".join(player.visibleParameters) newImage = getCacheDATPath(self.images[player.currentImage]) if newImage != "": if self.image: self.removeChild(self.image) self.image = Sprite(newImage) self.image.layer = -1 self.image.position = (656, 32) self.addChild(self.image)