def process_request(self, request): if not interprocess.comp_globals(IP_KEY_MENU): # Нужно обновить меню init_menu() globals.request = request globals.page = get_page(request.path) globals.breadcrumbs = get_breadcrumbs(globals.page)
def start(): for action, bindings in KEYMAP.items(): root.event_add(action, *bindings) for event, callback in _registered_functions.items(): root.bind(event, callback) menu.init_menu(root) for func in _startup_functions: func() for timeout, func in _loop_functions: root.after(timeout, func) root.mainloop()
def LoadPlayer(player, resetPos=False, battleStepCount=[2, 20]): global npcManager, pEventList, runningNpcEvent, pManager, uMe, uMenu, uBackpack, uBattle, uPokedex npcManager = base.NPCManager() for i in base.npcs: base.npcs[i].setPlayer(player) base.npcs[i].setPos(i) npcManager.new(i[0], i[1], base.npcs[i]) pEventList = [] runningNpcEvent = base.NPC(None, None) pManager = base.PlayerManager(player, terrain, base.playerEvent, npcManager) if resetPos: pManager.getPlayer().setPos(212, 122) menu.inst[1].setPlayer(pManager.getPlayer()) uMe = menu.inst[1] uPokedex = menu.inst[5] uMenu = menu.init_menu(menu.buttons, menu.inst) uBackpack = backpack.Backpack(wm, pManager.getPlayer()) uBattle = battle.Battle(uBackpack, wm) menu.inst[2].setBackpack(uBackpack) uPokedex.setPlayer(pManager.getPlayer()) LoadMap(pManager.getPlayer().getPos()) pManager.setBattleStepCount(battleStepCount) setBattle(uBattleNPCs)
def start(): for action, bindings in KEYMAP.items(): root.event_add(action, *bindings) for event, callback in _registered_functions.items(): root.bind(event, callback) menu.init_menu(root) for func in _startup_functions: func() for timeout, func in _loop_functions: root.after(timeout, func) root.mainloop()
mapManager.add(maps.Map(terrain, (4, 4))) pManager = base.PlayerManager(libpkmon.player, terrain, base.playerEvent, base.npcs) pManager.getPlayer().setPos(5 + 4, 10 + 4) LoadMap(pManager.getPlayer().getPos()) npcManager = base.NPCManager() for i in base.npcs: npcManager.new(i[0], i[1], base.npcs[i]) pEventList = [] runningNpcEvent = base.NPC(None, None) uMenu = menu.init_menu(menu.buttons, menu.inst) uBackpack = backpack.Backpack(wm, pManager.getPlayer()) uBattle = battle.Battle(uBackpack, wm) menu.inst[2].setBackpack(uBackpack) import time fps = 0 t = time.clock() direction = [] while True: evt.update() if evt.type == pygame.QUIT: break screen.fill((0, 0, 0))
def main(): addHook('profileLoaded', lambda: init_menu(items, fs))
screen.blit(SATURNLABEL, (700, 110)) menu.space_text(700, 10, 100, 20, 0) #Sun menu.space_text(700, 30, 100, 20, 1) #Earth menu.space_text(700, 50, 100, 20, 2) #Moon of Earth menu.space_text(700, 70, 100, 20, 3) #Mars menu.space_text(700, 90, 100, 20, 4) #Jupyter menu.space_text(700, 110, 100, 20, 5) #Saturn p.display.update() clock.tick(s.FRAMERATE) # Initialize class instances def init_simulation(ss=s): # Change variable constans global s s = ss for i in range(len(s.STARTPOS)): # len(s.STARTPOS) Space_object(screen, s.STARTPOS[i], s.MASS[i], s.OBJECT_IMG[i], s.STARTVEL[i], trace_length=s.TRACE_LENGTH[i], trace_time=s.TRACE_TIME[i]) animation_loop() menu.init_menu(p, screen, clock, init_simulation) p.quit()
from menu import init_menu init_menu()
terrain.setProperty(1, 0, 255) mapManager.add(maps.Map(terrain, (4, 4))) pManager = base.PlayerManager(libpkmon.player, terrain, base.playerEvent, base.npcs) pManager.getPlayer().setPos(5+4, 10+4) LoadMap(pManager.getPlayer().getPos()) npcManager = base.NPCManager() for i in base.npcs: npcManager.new(i[0], i[1], base.npcs[i]) pEventList = [] runningNpcEvent = base.NPC(None, None) uMenu = menu.init_menu(menu.buttons, menu.inst) uBackpack = backpack.Backpack(wm, pManager.getPlayer()) uBattle = battle.Battle(uBackpack, wm) menu.inst[2].setBackpack(uBackpack) import time fps = 0 t = time.clock() direction = [] while True: evt.update() if evt.type == pygame.QUIT: break screen.fill((0, 0, 0)) # render terrain to gaming world