def GetCurrentChannel(): """ Returns the current channel based on the string under the minimap. Returns: [int]: Returns the channel, or 0 in case of an exception raised. """ try: return int(net.GetServerInfo().split(',')[1][3:]) except: OpenLog.DebugPrint( "Exception raised when trying to obtain current channel.") return 0
def LoadLocaleData(): if IsYMIR(): import net SERVER = "�赵 ����" if SERVER == net.GetServerInfo()[:len(SERVER)]: app.SetCHEONMA(0) app.LoadLocaleData("locale/we_korea") constInfo.ADD_DEF_BONUS_ENABLE = 0 else: app.SetCHEONMA(1) app.LoadLocaleData("locale/ymir") constInfo.ADD_DEF_BONUS_ENABLE = 1 else: app.LoadLocaleData(app.GetLocalePath())
def __LoadWindow(self): if self.isLoaded == 1: return self.isLoaded = 1 try: pyScrLoader = ui.PythonScriptLoader() if localeInfo.IsARABIC(): pyScrLoader.LoadScriptFile( self, uiScriptLocale.LOCALE_UISCRIPT_PATH + "Minimap.py") else: pyScrLoader.LoadScriptFile(self, "UIScript/MiniMap.py") except: import exception exception.Abort("MiniMap.LoadWindow.LoadScript") try: self.OpenWindow = self.GetChild("OpenWindow") self.MiniMapWindow = self.GetChild("MiniMapWindow") self.ScaleUpButton = self.GetChild("ScaleUpButton") self.ScaleDownButton = self.GetChild("ScaleDownButton") self.MiniMapHideButton = self.GetChild("MiniMapHideButton") self.AtlasShowButton = self.GetChild("AtlasShowButton") self.CloseWindow = self.GetChild("CloseWindow") self.MiniMapShowButton = self.GetChild("MiniMapShowButton") self.positionInfo = self.GetChild("PositionInfo") self.observerCount = self.GetChild("ObserverCount") self.serverInfo = self.GetChild("ServerInfo") except: import exception exception.Abort("MiniMap.LoadWindow.Bind") if constInfo.MINIMAP_POSITIONINFO_ENABLE == 0: self.positionInfo.Hide() self.serverInfo.SetText(net.GetServerInfo()) self.ScaleUpButton.SetEvent(ui.__mem_func__(self.ScaleUp)) self.ScaleDownButton.SetEvent(ui.__mem_func__(self.ScaleDown)) self.MiniMapHideButton.SetEvent(ui.__mem_func__(self.HideMiniMap)) self.MiniMapShowButton.SetEvent(ui.__mem_func__(self.ShowMiniMap)) if miniMap.IsAtlas(): self.AtlasShowButton.SetEvent(ui.__mem_func__(self.ShowAtlas)) (ButtonPosX, ButtonPosY) = self.MiniMapShowButton.GetGlobalPosition() self.tooltipMiniMapOpen.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.MiniMapHideButton.GetGlobalPosition() self.tooltipMiniMapClose.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.ScaleUpButton.GetGlobalPosition() self.tooltipScaleUp.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.ScaleDownButton.GetGlobalPosition() self.tooltipScaleDown.SetTooltipPosition(ButtonPosX, ButtonPosY) (ButtonPosX, ButtonPosY) = self.AtlasShowButton.GetGlobalPosition() self.tooltipAtlasOpen.SetTooltipPosition(ButtonPosX, ButtonPosY) self.ShowMiniMap()