Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _GetInfoCont(self):
p = self.infoContPad
infoCont = self._DrawAlignTopCont(70, 'infoCont', padding=(p,
p,
p,
p))
self.storageGauge = uicls.Gauge(parent=infoCont, value=0.0, color=planetCommon.PLANET_COLOR_STORAGE, label=localization.GetByLabel('UI/PI/Common/Storage'))
self.cooldownTimer = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/NextTransferAvailable'), top=40)
left = self.infoContRightColAt
self.itemsTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/StoredItems'), left=left, state=uiconst.UI_DISABLED)
self.iconCont = uicls.Container(parent=infoCont, pos=(left,
12,
120,
60), align=uiconst.TOPLEFT, state=uiconst.UI_PICKCHILDREN)
self._DrawStoredCommoditiesIcons()
return infoCont
def _GetInfoCont(self):
p = self.infoContPad
infoCont = self._DrawAlignTopCont(70, 'infoCont', padding=(p,
p,
p,
p))
self.currDepositTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/Extracting'), top=0)
self.timeToDeplTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/TimeToDepletion'), top=40)
left = self.infoContRightColAt
self.currCycleGauge = uicls.Gauge(parent=infoCont, value=0.0, color=planetCommon.PLANET_COLOR_CYCLE, label=localization.GetByLabel('UI/PI/Common/CurrentCycle'), cyclic=True)
self.currCycleGauge.left = left
self.currCycleOutputTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/CurrentCycleOutput'), top=40, left=left)
return infoCont
def CreateEditModeContainer(self):
uicls.EveHeaderLarge(parent=self.editModeContent, text=localization.GetByLabel('UI/PI/Common/EditsPending'), align=uiconst.RELATIVE)
self.powerGauge = uicls.Gauge(parent=self.editModeContent, pos=(0, 22, 125, 34), color=planetCommon.PLANET_COLOR_POWER, label=localization.GetByLabel('UI/PI/Common/PowerUsage'))
self.cpuGauge = uicls.Gauge(parent=self.editModeContent, pos=(140, 22, 125, 34), color=planetCommon.PLANET_COLOR_CPU, label=localization.GetByLabel('UI/PI/Common/CpuUsage'))
self.UpdatePowerAndCPUGauges()
btns = [[localization.GetByLabel('UI/Common/Submit'), self.Submit, ()], [localization.GetByLabel('UI/Common/Cancel'), self.Cancel, ()]]
bottom = uicls.Container(parent=self.editModeContent, align=uiconst.TOBOTTOM, pos=(0, 0, 0, 40))
btns = uicls.ButtonGroup(btns=btns, subalign=uiconst.CENTERRIGHT, parent=bottom, line=False, alwaysLite=True)
self.costText = planet.ui.CaptionAndSubtext(parent=bottom, align=uiconst.TOPLEFT, top=13, caption=localization.GetByLabel('UI/Common/Cost'), subtext='')
def _GetInfoCont(self):
p = self.infoContPad
infoCont = self._DrawAlignTopCont(70, 'infoCont', padding=(p,
p,
p,
p))
self.currDepositTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/Extracting'), top=0)
self.timeToDeplTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/TimeToDepletion'), top=40)
left = self.infoContRightColAt
self.currCycleGauge = uicls.Gauge(parent=infoCont, value=0.0, color=planetCommon.PLANET_COLOR_CYCLE, label=localization.GetByLabel('UI/PI/Common/CurrentCycle'), cyclic=True)
self.currCycleGauge.left = left
self.currCycleOutputTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/CurrentCycleOutput'), top=40, left=left)
return infoCont
def _GetInfoCont(self):
p = self.infoContPad
infoCont = self._DrawAlignTopCont(95, 'infoCont', padding=(p,
p,
p,
p))
self.currDepositTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/Extracting'), top=0)
self.depositsLeftTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/TotalAmountLeft'), top=40)
self.timeToDeplTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/TimeToDepletion'), top=70)
left = self.infoContRightColAt
self.currCycleGauge = uicls.Gauge(parent=infoCont, value=0.0, color=planetCommon.PLANET_COLOR_CYCLE, label=localization.GetByLabel('UI/PI/Common/CurrentCycle'), cyclic=True)
self.currCycleGauge.left = left
self.amountPerCycleTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/OutputPerCycle'), top=40, left=left)
self.amountPerHourTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/OutputPerHour'), top=70, left=left)
return infoCont
def _GetInfoCont(self):
p = self.infoContPad
infoCont = self._DrawAlignTopCont(70, 'infoCont', padding=(p,
p,
p,
p))
self.storageGauge = uicls.Gauge(parent=infoCont, value=0.0, color=planetCommon.PLANET_COLOR_STORAGE, label=localization.GetByLabel('UI/PI/Common/Storage'))
self.cooldownTimer = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/NextTransferAvailable'), top=40)
left = self.infoContRightColAt
self.itemsTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/StoredItems'), left=left, state=uiconst.UI_DISABLED)
self.iconCont = uicls.Container(parent=infoCont, pos=(left,
12,
120,
60), align=uiconst.TOPLEFT, state=uiconst.UI_PICKCHILDREN)
self._DrawStoredCommoditiesIcons()
return infoCont
def SubPanelSelectedSchematic(self, parent, schematic):
cont = uicls.Container(parent=parent, pos=(0, 0, 0, 140), align=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN)
left = self.infoContRightColAt
output = schematic.outputs[0]
schematicTxt = localization.GetByLabel('UI/PI/Common/ItemAmount', amount=int(output.quantity), itemName=output.name)
planet.ui.CaptionAndSubtext(parent=cont, caption=localization.GetByLabel('UI/PI/Common/OutputProduct'), subtext=schematicTxt, iconTypeID=output.typeID, left=5, top=0)
planet.ui.CaptionAndSubtext(parent=cont, caption=localization.GetByLabel('UI/PI/Common/CycleTime'), subtext=localization.GetByLabel('UI/PI/Common/TimeHourMinSec', time=schematic.cycleTime * SEC), left=5, top=40)
outputVolumeTxt = localization.GetByLabel('UI/PI/Common/CapacityAmount', amount=schematic.outputVolume)
planet.ui.CaptionAndSubtext(parent=cont, caption=localization.GetByLabel('UI/PI/Common/OutputPerHour'), subtext=outputVolumeTxt, left=5, top=80)
for (i, input,) in enumerate(schematic.inputs):
topPos = i * 40
caption = localization.GetByLabel('UI/PI/Common/InputNumberX', inputNum=i + 1)
subtext = localization.GetByLabel('UI/PI/Common/ItemAmount', amount=int(input.quantity), itemName=cfg.invtypes.Get(input.typeID).name)
planet.ui.CaptionAndSubtext(parent=cont, caption=caption, subtext=subtext, iconTypeID=input.typeID, left=left, top=topPos)
btns = [[localization.GetByLabel('UI/PI/Common/InstallSchematic'), self.InstallSchematic, ()]]
self.buttons = uicls.ButtonGroup(btns=btns, parent=cont, line=False, alwaysLite=True)
return cont
def _GetInfoCont(self):
p = self.infoContPad
infoCont = self._DrawAlignTopCont(70, 'infoCont', padding=(p,
p,
p,
p))
self.currDepositTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/Extracting'), top=0)
self.timeToDeplTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/TimeToDepletion'), top=40)
left = self.infoContRightColAt
self.currCycleGauge = uicls.Gauge(parent=infoCont, value=0.0, color=planetCommon.PLANET_COLOR_CYCLE, label=localization.GetByLabel('UI/PI/Common/CurrentCycle'), cyclic=True)
self.currCycleGauge.left = left
self.currCycleOutputTxt = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/CurrentCycleOutput'), top=40, left=left)
return infoCont
def SubPanelSelectedSchematic(self, parent, schematic):
cont = uicls.Container(parent=parent, pos=(0, 0, 0, 140), align=uiconst.TOTOP, state=uiconst.UI_PICKCHILDREN)
left = self.infoContRightColAt
output = schematic.outputs[0]
schematicTxt = localization.GetByLabel('UI/PI/Common/ItemAmount', amount=int(output.quantity), itemName=output.name)
planet.ui.CaptionAndSubtext(parent=cont, caption=localization.GetByLabel('UI/PI/Common/OutputProduct'), subtext=schematicTxt, iconTypeID=output.typeID, left=5, top=0)
planet.ui.CaptionAndSubtext(parent=cont, caption=localization.GetByLabel('UI/PI/Common/CycleTime'), subtext=localization.GetByLabel('UI/PI/Common/TimeHourMinSec', time=schematic.cycleTime * SEC), left=5, top=40)
outputVolumeTxt = localization.GetByLabel('UI/PI/Common/CapacityAmount', amount=schematic.outputVolume)
planet.ui.CaptionAndSubtext(parent=cont, caption=localization.GetByLabel('UI/PI/Common/OutputPerHour'), subtext=outputVolumeTxt, left=5, top=80)
for (i, input,) in enumerate(schematic.inputs):
topPos = i * 40
caption = localization.GetByLabel('UI/PI/Common/InputNumberX', inputNum=i + 1)
subtext = localization.GetByLabel('UI/PI/Common/ItemAmount', amount=int(input.quantity), itemName=cfg.invtypes.Get(input.typeID).name)
planet.ui.CaptionAndSubtext(parent=cont, caption=caption, subtext=subtext, iconTypeID=input.typeID, left=left, top=topPos)
btns = [[localization.GetByLabel('UI/PI/Common/InstallSchematic'), self.InstallSchematic, ()]]
self.buttons = uicls.ButtonGroup(btns=btns, parent=cont, line=False, alwaysLite=True)
return cont
def _GetInfoCont(self):
p = self.infoContPad
infoCont = self._DrawAlignTopCont(55, 'infoCont', padding=(p,
p,
p,
p))
link = self.pin.link
totalBandwidth = localization.GetByLabel('UI/PI/Common/CapacityAmount', amount=link.GetTotalBandwidth())
bandwidthUsed = localization.GetByLabel('UI/PI/Common/CapacityAmount', amount=link.GetBandwidthUsage())
self.totalBandwidth = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/LinkMaxCapacity'), subtext=totalBandwidth)
self.bandwidthUsed = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/CapacityUsed'), subtext=bandwidthUsed, top=30)
left = self.infoContRightColAt
self.bandwidthGauge = uicls.Gauge(parent=infoCont, value=link.GetBandwidthUsage() / link.GetTotalBandwidth(), color=planetCommon.PLANET_COLOR_BANDWIDTH, label=localization.GetByLabel('UI/PI/Common/CapacityUsed'), left=left)
levelStr = localization.GetByLabel('UI/PI/Common/LinkUpgradeLevelAndName', upgradeLevel=uiutil.IntToRoman(link.level), upgradeLevelName=self.GetCaptionForUpgradeLevel(link.level))
self.upgradeLevel = planet.ui.CaptionAndSubtext(parent=infoCont, caption=localization.GetByLabel('UI/PI/Common/UpgradeLevel'), subtext=levelStr, top=30, left=left)
return infoCont