def IWriteHoodName(self): fontcolor = ptColor(dyna_fontcolorr.value, dyna_fontcolorg.value, dyna_fontcolorb.value, dyna_fontcolora.value) clearcolor = ptColor(0, 0, 0, 0) ageVault = ptAgeVault() try: ageInfoNode = ageVault.getAgeInfo() hoodName = "%s %s" % (ageInfoNode.getAgeUserDefinedName(), ageInfoNode.getAgeInstanceName()) PtDebugPrint("nb01Easel:\tinscribing %s" % hoodName) except: PtDebugPrint("nb01Easel:\tERROR age vault or hood node failure") return hoodName = xLocTools.LocalizeAgeName(hoodName) text = PtGetLocalizedString("Neighborhood.Messages.Welcome", [hoodName]) dyna_map.textmap.netPropagate( false ) # we don't want our text appearing on other machines, since we are going to be localized dyna_map.textmap.clearToColor(clearcolor) dyna_map.textmap.setTextColor(fontcolor, true) dyna_map.textmap.setWrapping(dyna_map.textmap.getWidth(), dyna_map.textmap.getHeight()) dyna_map.textmap.setFont(dyna_fontname.value, dyna_fontsize.value) dyna_map.textmap.setJustify(PtJustify.kCenter) dyna_map.textmap.setLineSpacing(dyna_fontspacing.value) dyna_map.textmap.drawTextW(0, 0, text) dyna_map.textmap.flush()
def GetAgeName(ageInfo=None): if not ageInfo: ageLink = ptNetLinkingMgr().getCurrAgeLink() if not ageLink: return "?UNKNOWN?" ageInfo = ageLink.getAgeInfo() if not ageInfo: return "?UNKNOWN?" if ageInfo.getAgeFilename() == "BahroCave": sdl = xPsnlVaultSDL() if sdl["TeledahnPoleState"][0] > 5 or sdl["KadishPoleState"][0] > 5 or sdl["GardenPoleState"][0] > 5 or sdl["GarrisonPoleState"][0] > 5: return "D'ni-Rudenna" if ageInfo.getAgeFilename() in kAges.Hide: return "Unknown" if ageInfo.getAgeFilename() in kAges.Display: return kAges.Display[ageInfo.getAgeFilename()] localizeName = ageInfo.getDisplayName() return FilterAgeName(xLocTools.LocalizeAgeName(localizeName))