import ceguifrom enum import *from graphics.dialogbase import *savegamedlg_counter = 0def doSaveGameDialog(ignore): import snake.pyos snake.pyos.spawn(SaveGameDialog, "saveGameDialog_tasklet")def SaveGameDialog(): ''' The dialog that allows players to save and load the game ''' global savegamedlg_counter savegamedlg_counter += 1 name = "savegamedlg" + str(savegamedlg_counter) dialog = cegui.WindowManager.getSingleton().loadWindowLayout("layouts/savegamedialog.layout", name) # here's where we will set the dialog's title and button to Load or Save handler = genHandler(dialog, [("Cancel", 0)]) return runDialog(name, dialog, handler)