def validate(window,w,namevar,passvar): print("here") if namevar=='admin' and passvar=='root': print("logged in") w.destroy() Dashboard.Dashboard() else: messagebox.showerror("Warning","Incorrect Username or Password") window.destroy() login(w)
def main(): ''' print('Testing car class ...') make = 'Chevy' model = 'Malibu' year = '2005' port_number = 283944390 my_car = Car.Car(make, model, port_number, year) my_car.getSpeed() my_car.read_dtc_trace() ''' Dashboard.Dashboard()
def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.timer = QTimer(self) self.interval = 200 self.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose, True) self.dashboard = Dashboard.Dashboard(self) self.setCentralWidget(self.dashboard) self.startButton.clicked.connect(self.startTimer) self.stopButton.clicked.connect(self.stopTimer) self.timer.timeout.connect(self.marquee)
from tkinter import * from Constants import * from Dashboard import * from Window import * root = Tk() window = Dashboard(root) root.title(APP_TITLE) root.resizable(False, False) #disabling window resize root.configure(background=PRIMARY) root.geometry('{}x{}'.format(WINDOW_WIDTH, WINDOW_HEIGHT)) root.grid_rowconfigure(1, weight=1) root.grid_columnconfigure(0, weight=1) root.mainloop()
def __init__(self): self.login = "******" base.setFrameRateMeter(True) #input states inputState.watchWithModifiers('forward', 'w') inputState.watchWithModifiers('left', 'a') inputState.watchWithModifiers('brake', 's') inputState.watchWithModifiers('right', 'd') inputState.watchWithModifiers('turnLeft', 'q') inputState.watchWithModifiers('turnRight', 'e') self.keyMap = { "hello": 0, "left": 0, "right": 0, "forward": 0, "backward": 0, "cam-left": 0, "cam-right": 0, "chat0": 0, "powerup": 0, "reset": 0 } base.win.setClearColor(Vec4(0, 0, 0, 1)) # Network Setup self.cManager = ConnectionManager(self) self.startConnection() #self.cManager.sendRequest(Constants.CMSG_LOGIN, ["username", "password"]) # chat box # self.chatbox = Chat(self.cManager, self) # Set up the environment # self.initializeBulletWorld(False) #self.createEnvironment() Track(self.bulletWorld) # Create the main character, Ralph self.mainCharRef = Vehicle(self.bulletWorld, (100, 10, 5, 0, 0, 0), self.login) #self.mainCharRef = Character(self, self.bulletWorld, 0, "Me") self.mainChar = self.mainCharRef.chassisNP #self.mainChar.setPos(0, 25, 16) # self.characters.append(self.mainCharRef) # self.TestChar = Character(self, self.bulletWorld, 0, "test") # self.TestChar.actor.setPos(0, 0, 0) self.previousPos = self.mainChar.getPos() taskMgr.doMethodLater(.1, self.updateMove, 'updateMove') # Set Dashboard self.dashboard = Dashboard(self.mainCharRef, taskMgr) self.floater = NodePath(PandaNode("floater")) self.floater.reparentTo(render) # Accept the control keys for movement and rotation self.accept("escape", self.doExit) self.accept("a", self.setKey, ["left", 1]) self.accept("d", self.setKey, ["right", 1]) self.accept("w", self.setKey, ["forward", 1]) self.accept("s", self.setKey, ["backward", 1]) self.accept("arrow_left", self.setKey, ["cam-left", 1]) self.accept("arrow_right", self.setKey, ["cam-right", 1]) self.accept("a-up", self.setKey, ["left", 0]) self.accept("d-up", self.setKey, ["right", 0]) self.accept("w-up", self.setKey, ["forward", 0]) self.accept("s-up", self.setKey, ["backward", 0]) self.accept("arrow_left-up", self.setKey, ["cam-left", 0]) self.accept("arrow_right-up", self.setKey, ["cam-right", 0]) self.accept("h", self.setKey, ["hello", 1]) self.accept("h-up", self.setKey, ["hello", 0]) self.accept("0", self.setKey, ["chat0", 1]) self.accept("0-up", self.setKey, ["chat0", 0]) self.accept("1", self.setKey, ["powerup", 1]) self.accept("1-up", self.setKey, ["powerup", 0]) self.accept("2", self.setKey, ["powerup", 2]) self.accept("2-up", self.setKey, ["powerup", 0]) self.accept("3", self.setKey, ["powerup", 3]) self.accept("3-up", self.setKey, ["powerup", 0]) self.accept("r", self.doReset) self.accept("p", self.setTime) #taskMgr.add(self.move, "moveTask") # Game state variables self.isMoving = False # Sky Dome self.sky = SkyDome() # Set up the camera self.camera = Camera(self.mainChar) #base.disableMouse() #base.camera.setPos(self.mainChar.getX(), self.mainChar.getY() + 10, self.mainChar.getZ() + 2) # Create some lighting ambientLight = AmbientLight("ambientLight") ambientLight.setColor(Vec4(.3, .3, .3, 1)) directionalLight = DirectionalLight("directionalLight") directionalLight.setDirection(Vec3(-5, -5, -5)) directionalLight.setColor(Vec4(1, 1, 1, 1)) directionalLight.setSpecularColor(Vec4(1, 1, 1, 1)) directionalLight2 = DirectionalLight("directionalLight2") directionalLight2.setDirection(Vec3(5, 5, -5)) directionalLight2.setColor(Vec4(1, 1, 1, 1)) directionalLight2.setSpecularColor(Vec4(1, 1, 1, 1)) render.setLight(render.attachNewNode(ambientLight)) render.setLight(render.attachNewNode(directionalLight)) render.setLight(render.attachNewNode(directionalLight2)) # Game initialisation self.gameState = self.gameStateDict["Login"] self.responseValue = -1 self.cManager.sendRequest(Constants.CMSG_LOGIN, [self.login, "1234"]) taskMgr.add(self.enterGame, "EnterGame") # Create Powerups self.createPowerups() taskMgr.add(self.powerups.checkPowerPickup, "checkPowerupTask") taskMgr.add(self.usePowerup, "usePowerUp")