From 1d12c3a90fecb09690eadbcd12da2aa0dee4d9e2 Mon Sep 17 00:00:00 2001 From: Dan Olson Date: Fri, 27 Nov 2009 04:54:05 -0800 Subject: [PATCH] Cheesy stubbed main menu --- pyhexen.py | 13 +++++++++---- pyhexen/menu.py | 20 ++++++++++++++++---- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/pyhexen.py b/pyhexen.py index fed6d51..065095e 100644 --- a/pyhexen.py +++ b/pyhexen.py @@ -17,11 +17,16 @@ vid.Init () menu = pyhexen.menu.Menu (wad, vid) vid.SetPalette (wad.CacheLumpName('PLAYPAL')) -vid.DrawRawScreen (wad.CacheLumpName('TITLE')) -vid.DrawPatch (4, 160, wad.CacheLumpName('ADVISOR')) - -vid.WaitVBL () while True: + menu.Tick () + + vid.DrawRawScreen (wad.CacheLumpName('TITLE')) + vid.DrawPatch (4, 160, wad.CacheLumpName('ADVISOR')) + + menu.DrawMainMenu () + + vid.WaitVBL () + input (pygame.event.get()) diff --git a/pyhexen/menu.py b/pyhexen/menu.py index c753823..032564a 100644 --- a/pyhexen/menu.py +++ b/pyhexen/menu.py @@ -6,22 +6,20 @@ class Menu: def __init__ (self, wad, vid): self.wad = wad self.vid = vid + self.time = 0 + self.active = True self.SkullBaseLump = self.wad.GetNumForName("M_SKL00") self.FontABaseLump = self.wad.GetNumForName("FONTA_S")+1 self.FontBBaseLump = self.wad.GetNumForName("FONTB_S")+1 def ProcessText (self, text, x, y, baselump, draw=True): - print 'Processing %s' % text for c in text: - print 'ord %d' % ord (c) if ord (c) < 33: - print ("skipzored") x = x + 5 else: patch = self.wad.CacheLumpNum (baselump + ord (c) - 33) (w, h) = struct.unpack_from ('