def draw(self): """ Draws the item parts on screen. """ self.window = guiobjects.OcempPanel(150, 300, [GG.utils.SCREEN_SZ[0] - 151, 129], GG.utils.ADMIN_ACTIONS_BACKGROUND) titleLabel = guiobjects.OcempLabel(self.title, guiobjects.STYLES["teleportLabel"]) titleLabel.topleft = 4, 0 self.window.add_child(titleLabel) self.listItems = guiobjects.OcempImageObjectList( 110, 205, self.listItems) self.listItems.topleft = 20, 40 self.window.add_child(self.listItems) okButton = guiobjects.createButton( GG.utils.TINY_OK_IMAGE, [10, 262], [self.tooltipLabel, self.showTooltip, self.removeTooltip], self.accept) self.window.add_child(okButton) cancelButton = guiobjects.createButton( GG.utils.TINY_CANCEL_IMAGE, [80, 262], ["Cerrar menu", self.showTooltip, self.removeTooltip], self.showOrHide) self.window.add_child(cancelButton) self.window.zOrder = 10000
def updateListItem(self): """ Updates the players list. """ self.window.remove_child(self.listItems) self.listItems.destroy() self.listItems = self.hud.getModel().getPlayersList() self.listItems = guiobjects.OcempImageObjectList( 110, 205, self.listItems) self.listItems.topleft = 20, 40 self.window.add_child(self.listItems)
def __paintRoomList(self): """ Paints the room list on screen. """ labelShift = [10, -15] self.listRooms = guiobjects.OcempImageObjectList( 110, 170, self.listItems) self.listRooms.topleft = 275 + labelShift[0], 58 + labelShift[1] self.listRooms.connect_signal( ocempgui.widgets.Constants.SIG_SELECTCHANGED, self.__selectionChange) self.container.add_child(self.listRooms)
def __paintObjectsList(self): """ Paints the item list. """ objectsLabels = self.__objectsDict.keys() objectsLabels.sort() self.__objectsArea = guiobjects.OcempImageObjectList( 130, 270, objectsLabels) self.__objectsArea.topleft = 20, 50 self.__objectsArea.connect_signal( ocempgui.widgets.Constants.SIG_SELECTCHANGED, self.__selectionChange) self.container.add_child(self.__objectsArea)