class WeaponCautionClueView(QFrame): # Prolly could use a better name """ Represents a Weapon Caution Clue View """ def __init__(self, weaponCautionClue, parent=None): """ Initialize the Weapon Caution Clue View """ QFrame.__init__(self, parent) self.weaponCautionClue = weaponCautionClue self.resize(16, 15) self.loadImage() self.setVisible(False) def loadImage(self): """ Load the Warning Image """ self.image = LoadImageLabel("warning.gif", parent=self) self.image.move(0, 0) def updateView(self): """ Update the View """ self.setVisible(self.weaponCautionClue.nearWeapons)
def loadArrow(self, filename, xPosition, yPosition): """ Load Arrow Image """ arrowLabel = LoadImageLabel(filename, parent=self) arrowLabel.setVisible(False) arrowLabel.move(xPosition, yPosition) return arrowLabel
def loadGridSquareSizedImage(self, filename, visible=True): """ Load a Grid Square Sized Image from the filename given """ image = LoadImageLabel(filename, scaledXSize=self.GRID_SQUARE_SIZE, scaledYSize=self.GRID_SQUARE_SIZE, parent=self) image.move(0, 0) image.setVisible(visible) return image