def GameDraw(DISPLAY): global track_list global TopBarControls global DropDownFileMenu global LastScreenFrame if not var.DisableControls: if not var.FileMenuEnabled: DISPLAY.fill((UI.ThemesManager_GetProperty("BackgroundColor"))) track_list.Render(DISPLAY) TopBarControls.Render(DISPLAY) OptionsBar.Draw(DISPLAY) EditorBar.Draw(DISPLAY) SoundCacheMessage.Draw(DISPLAY) LastScreenFrame = DISPLAY.copy() else: DISPLAY.blit(LastScreenFrame, (0, 0)) TopBarControls.Render(DISPLAY) DropDownFileMenu.Render(DISPLAY)
def EventUpdate(event): global track_list global TopBarControls global DropDownFileMenu if not var.DisableControls: if not var.FileMenuEnabled: track_list.EventUpdate(event) OptionsBar.EventUpdate(event) EditorBar.EventUpdate(event) DropDownFileMenu.EventUpdate(event) TopBarControls.EventUpdate(event)
def Update(): global track_list global TopBarControls global DropDownFileMenu SaveFileDialog.Update() OpenFileDialog.Update() if var.DisableControls: return TopBarControls.Update() UpdateTopBar() if var.FileMenuEnabled: DropDownFileMenu.Update() return track_list.Update() OptionsBar.Update() EditorBar.Update() SoundCacheMessage.Update()
def Initialize(): global track_list global TopBarControls global DropDownFileMenu # Add all widgets ButtonsList = list() ButtonsList.append(UI.Button(pygame.Rect(0, 0, 0, 0), "File", 14)) TopBarControls = UI.ButtonsBar((3, 5, Core.MAIN.ScreenWidth, 32), ButtonsList) DropDownFileMenuList = (("Load", DropDownButtonsActions_LoadButton), ("Save", DropDownButtonsActions_SaveButton), ("New File", DropDownButtonsActions_NewFileButton), ("About", DropDownButtonsActions_AboutButton), ("Settings", DropDownButtonsActions_SettingsButton)) DropDownFileMenu = UI.DropDownMenu(pygame.Rect(10, 35, 120, 65), DropDownFileMenuList) OptionsBar.Initialize() EditorBar.Initialize() SoundCacheMessage.Initialize() NewMusicFile()