6 def __init__ (self, menu, name, x, y):
16 def AddItem (self, item):
17 self.items.append (item)
19 def Choose (self, item):
23 def __init__ (self, wad, vid):
31 self.SkullBaseLump = self.wad.GetNumForName("M_SKL00")
32 self.FontABaseLump = self.wad.GetNumForName("FONTA_S")+1
33 self.FontBBaseLump = self.wad.GetNumForName("FONTB_S")+1
35 def AddMenu (self, menu):
36 self.menus.append (menu)
38 def ProcessText (self, text, x, y, baselump, draw=True):
43 patch = self.wad.CacheLumpNum (baselump + ord (c) - 33)
44 (w, h) = struct.unpack_from ('<hh', patch, 0)
46 self.vid.DrawPatch (x, y, patch)
50 def DrawTextA (self, text, x, y):
51 self.ProcessText (text, x, y, self.FontABaseLump)
53 def TextAWidth (self, text):
54 return self.ProcessText (text, 0, 0, self.FontABaseLump, False)
56 def DrawTextB (self, text, x, y):
57 self.ProcessText (text, x, y, self.FontBBaseLump)
59 def TextBWidth (self, text):
60 return self.ProcessText (text, 0, 0, self.FontBBaseLump, False)
64 self.time = self.time + 1
71 def Deactivate (self):
75 self.menus[self.current].Draw ()
76 x = self.menus[self.current].x
77 y = self.menus[self.current].y
78 for i in self.menus[self.current].items:
79 self.DrawTextB (i, x, y)
80 y = y + 20 # ITEM_HEIGHT
81 y = self.menus[self.current].y+(self.currentitem*20)+-1 # ITEM_HEIGHT, SELECTOR_YOFFSET
86 self.vid.DrawPatch(x-28, y, self.wad.CacheLumpName (selName))