def GetWindowWidth(self): width = GetBaseShapeSize() + 16 if self.IsLeftPanelExpanded(): width += PANEL_WIDTH if self.IsRightPanelExpanded(): width += PANEL_WIDTH return width
def __init__(self, controller, slotClass = None): self.controller = controller scaleFactor = GetScaleFactor() self.width = int(round(44.0 * scaleFactor)) self.height = int(round(54.0 * scaleFactor)) self.rad = int(239 * scaleFactor) self.center = GetBaseShapeSize() / 2 if slotClass: self.slotClass = slotClass else: self.slotClass = FittingSlot
def GetOverlayWidthHeightAndAlignment(controller): fixedHeight = GetFixedWndHeight(controller) baseSize = GetBaseShapeSize() if controller.ControllerForCategory() == const.categoryStructure: width = baseSize height = min(fixedHeight - 12, baseSize) overlayAlignment = uiconst.CENTERTOP else: height = 0 width = 0 overlayAlignment = uiconst.TOALL return (width, height, overlayAlignment)
def AddTurretAndLauncherMarkers(self): cX = cY = GetBaseShapeSize() / 2 turretAdder = HardpointAdder(const.attributeTurretSlotsLeft, cX, cY, isleftSide=True) turretAdder.AddIcon(self, 'ui_26_64_1', self.LoadTooltipPanelForTurret) turretAdder.AddMarkers(self) self.turretSlots = turretAdder.slots launcherAdder = HardpointAdder(const.attributeLauncherSlotsLeft, cX, cY) launcherAdder.AddIcon(self, 'ui_81_64_16', self.LoadTooltipPanelForLauncher) launcherAdder.AddMarkers(self) self.launcherSlots = launcherAdder.slots
def ApplyAttributes(self, attributes): uiprimitives.Container.ApplyAttributes(self, attributes) self.scaleFactor = GetScaleFactor() self.baseShapeSize = GetBaseShapeSize() self.width = self.baseShapeSize self.height = self.baseShapeSize overlay = uiprimitives.Sprite( parent=self, name='overlay', align=uiconst.TOALL, state=uiconst.UI_DISABLED, texturePath= 'res:/UI/Texture/classes/Fitting/fittingbase_overlay.png', color=(1.0, 1.0, 1.0, 0.39)) radius = int(self.baseShapeSize * 0.885 / 2) self.calibrationGauge = CalibrationGauge(parent=self, radius=radius) self.powerGauge = PowergridGauge(parent=self, radius=radius) self.cpuGauge = CPUGauge(parent=self, radius=radius) baseDOT = uiprimitives.Sprite( parent=self, name='baseDOT', align=uiconst.TOALL, state=uiconst.UI_DISABLED, texturePath= 'res:/UI/Texture/classes/Fitting/fittingbase_dotproduct.png', spriteEffect=trinity.TR2_SFX_DOT, blendMode=trinity.TR2_SBM_ADD) self.sr.baseColor = SpriteThemeColored( parent=self, name='baseColor', align=uiconst.TOALL, state=uiconst.UI_DISABLED, texturePath= 'res:/UI/Texture/classes/Fitting/fittingbase_basecircle.png', colorType=uiconst.COLORTYPE_UIBASE) self.sr.baseShape = uiprimitives.Sprite( parent=self, name='baseShape', align=uiconst.TOALL, state=uiconst.UI_DISABLED, texturePath='res:/UI/Texture/classes/Fitting/fittingbase.png', color=(0.0, 0.0, 0.0, 0.86))
def SetSizeVariables(self): baseShapeSize = GetBaseShapeSize() self.width = baseShapeSize self.height = baseShapeSize
def GetFixedWndHeight(controller): baseSize = GetBaseShapeSize() if controller.ControllerForCategory() == const.categoryStructure: return max(baseSize + 70, WND_NORMAL_HEIGHT) return WND_NORMAL_HEIGHT