home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 56 / CDPowerplay56Disc2.iso / demos / blade / data1.cab / Program_Executable_Files / Scripts / Menu.py < prev    next >
Encoding:
Text File  |  2000-10-27  |  91.4 KB  |  2,171 lines

  1. # Modified 03/Mar/2000 Rod Wolfson
  2.  
  3. import MenuWidget
  4. import WidgetsExtra
  5. import Bladex
  6. import BBLib
  7. import netgame
  8. import Raster
  9. import BIPCx
  10. import Sounds
  11. import GotoMapVars
  12. import acts
  13. import SaveGame
  14. import MemPersistence
  15. if netgame.GetNetState() == 0:
  16. ##  import Scorer
  17. ##  import TabWidget
  18.   import KeybWidget
  19. else:
  20.   import NetScorer
  21.  
  22.  
  23. import Raster
  24. import BInput
  25. import BUIx
  26. import pdb
  27. #import sys
  28.  
  29. import Reference #Por demo_mode...
  30.  
  31.  
  32. import MenuText
  33. import NetMisc
  34. import netwidgets
  35.  
  36. import os
  37.  
  38.  
  39. #import Bldb
  40.  
  41. MenuFontSmall="../../Data/Letras menu peq.bmp"
  42. MenuFontMed="../../Data/Letras menu med.bmp"
  43. MenuFontBig="../../Data/Letras menu gra.bmp"
  44.  
  45. Character = -1
  46.  
  47. EscapeFunction = None
  48.  
  49. # SOUNDS FOR MENU->
  50. SndCorreGema=Bladex.CreateSound("..\\..\\Sounds\\golpe-2.wav","Risoto1")
  51. SndCorreGema.Volume=0.5
  52. SndCorreGema.MinDistance=1000000.0
  53. SndCorreGema.MaxDistance=2000000
  54.  
  55. SndNewMenu=Bladex.CreateSound("..\\..\\Sounds\\golpe-madera-pesada.wav","Risoto2")
  56. SndNewMenu.Volume=1.0
  57. SndNewMenu.MinDistance=1000000.0
  58. SndNewMenu.MaxDistance=2000000
  59.  
  60. last_ss_quality=-1
  61. sound_cfg_changed=0
  62.  
  63. def PlaySound(Chound):
  64.     cam = Bladex.GetEntity("Camera")
  65.     Chound.Position = cam.Position
  66.     Chound.Stop()
  67.     Chound.PlaySound(0)
  68.  
  69. # MUSIC FOR MENU->
  70. #Bladex.AddMusicEventMP3( "MenuMusic",  "..\\..\\Sounds\\abismo-fin1.MP3",     2.0, 1.0, 1.0, 10001, 1, -1 )
  71. #-----------------------------------------
  72.  
  73. def BackMenu(option):
  74.     _MainMenu.DeActivateMenuItem()
  75.  
  76. BackOption = {"Name"    : MenuText.GetMenuText("Back"),
  77.               "VSep"    : 65,
  78.               "Command" : BackMenu,
  79.               "Font"    : MenuFontBig
  80.              }
  81.  
  82. # Map Loading Upong Menu Request---
  83. def Load2DMap(option):
  84.     Bladex.LoadLevel("2DMap")
  85.     
  86. def LoadPlayerSelect(option):
  87.     global EscapeFunction
  88.     
  89.     if "Casa" != Bladex.GetCurrentMap():
  90.         MemPersistence.Store("MapAlreadyLoaded","pepepotamo")
  91.         Bladex.LoadLevel("Casa")        
  92.     else:
  93.         aux = EscapeFunction
  94.         EscapeFunction = None
  95.         _MainMenu.DeActivateMenuItem()
  96.         _MainMenu.DeActivateMenuItem()
  97.         EscapeFunction = aux
  98.         aux = None
  99.         EscapeFunction(1)
  100.  
  101. def LoadTutorial(option):
  102.     Bladex.LoadLevel("Tutorial")
  103. #----------------------------------
  104.  
  105. # Save/Load Game-------------------
  106. def SaveGame1(option):
  107.     Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame1.py');state=None")
  108.  
  109. def SaveGame2(option):
  110.     Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame2.py');state=None")
  111.  
  112. def SaveGame3(option):
  113.     Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame3.py');state=None")
  114.  
  115. def SaveGame4(option):
  116.     Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame4.py');state=None")
  117.  
  118.  
  119.  
  120. def LoadGameAux(name):
  121.     path="../../Save/%s_files"%(name,)
  122.     execfile="execfile('../../Scripts/sys_init.py');execfile('../../Save/%s.py')"%(name,)
  123.  
  124.     file_data_aux=open("%s/%saux"%(path,"aux"),"rt")
  125.     text=file_data_aux.read()
  126.     print text
  127. ##    text="Anulado para hacer pruebas"
  128.     file_data_aux.close()
  129.  
  130.     Bladex.BeginLoadGame()
  131.     Bladex.CloseLevel(execfile,text)
  132.  
  133.  
  134. def LoadGame(option):
  135.  
  136.     LoadGameAux("SaveGame1")
  137.  
  138.  
  139.  
  140. def LoadGame2(option):
  141.  
  142.     LoadGameAux("SaveGame2")
  143.  
  144.  
  145. def LoadGame3(option):
  146.     LoadGameAux("SaveGame3")
  147.  
  148. def LoadGame4(option):
  149.     LoadGameAux("SaveGame4")
  150. #----------------------------------
  151.  
  152. def CmdQuit(menu_class):
  153.   Bladex.Quit()
  154.  
  155. def CommandPrb(menu_class):
  156.   print "Hola"
  157.  
  158. def OptionCommandPrb(menu_class,option):
  159.   print "Received",option
  160.  
  161. def SetOptionCommandPrb():
  162.   return "Off"
  163.  
  164. ## Pantalla completa/ventana
  165. # Traducir
  166. def SetFullScreenMode(option):
  167.   print option
  168.   if option=="Full Screen":
  169.     Raster.SetVideoMode(0)
  170.   else:
  171.     Raster.SetWindowSize(640,480)
  172.  
  173.  
  174. def FullScreenModeSettings():
  175.   print "FullScreenModeSettings"
  176.   if Raster.FullScreen():
  177.     return 0
  178.   else:
  179.     return 1
  180.  
  181.  
  182.  
  183. # Auto-Facing
  184. def SetFacing(option):
  185.   if option=="Yes":
  186.     Bladex.SetAutoEngageCombat(1)
  187.   else:
  188.     Bladex.SetAutoEngageCombat(0)
  189.   SaveConfiguration()
  190.  
  191. def GetFacing():
  192.   return Bladex.GetAutoEngageCombat()
  193.  
  194.  
  195. def FacingSettings():
  196.   if Bladex.GetAutoEngageCombat():
  197.     return 1
  198.   else:
  199.     return 0
  200.  
  201. GORE_PASSWORD         = ""
  202. NEW_GORE_PASSWORD     = ""
  203. CONFIRM_GORE_PASSWORD = ""
  204.  
  205. CORRECT_GORE_PASSWORD = ""
  206.  
  207. def LoadPasswordFile():
  208.     import rotor
  209.     global CORRECT_GORE_PASSWORD
  210.  
  211.     # read encrypted string
  212.     try:
  213.         passwordfile = open("..\\..\\Bin\\Password.txt", "r")
  214.     except:
  215.         return        
  216.     encrpass = passwordfile.read()
  217.     passwordfile.close()
  218.     
  219.     # use the enigma to decrypt (thank's Hitler!)
  220.     rt = rotor.newrotor('key',12)
  221.     CORRECT_GORE_PASSWORD = rt.decrypt(encrpass)
  222.     del rt
  223.     
  224. LoadPasswordFile()
  225.  
  226. def SavePasswordFile():
  227.     import rotor
  228.     global CORRECT_GORE_PASSWORD
  229.     
  230.     # use the enigma to decrypt (thank's Hitler!)
  231.     rt       = rotor.newrotor('key',12)
  232.     encrpass = rt.encrypt(CORRECT_GORE_PASSWORD)
  233.     del rt
  234.  
  235.     # write encrypted string
  236.     passwordfile = open("..\\..\\Bin\\Password.txt", "w")
  237.     passwordfile.write(encrpass)
  238.     passwordfile.close()
  239.  
  240.  
  241. # Mouse Config--------
  242. # Axis Invertion
  243. def GetMouseInvert():
  244.     MouseData = Bladex.GetMouseState()
  245.     return MouseData[0]
  246.  
  247. def SetMouseInvert(option):
  248.     MouseData = Bladex.GetMouseState()
  249.     if option == "Yes":
  250.         Bladex.SetMouseState(0,MouseData[1],MouseData[2])
  251.     else:
  252.         Bladex.SetMouseState(1,MouseData[1],MouseData[2])
  253.     KeybWidget.SaveListConfig()
  254.     
  255. # X Sens
  256. def GetMouseXSens():
  257.     MouseData = Bladex.GetMouseState()
  258.     return MouseData[1]
  259.  
  260. def SetMouseXSens(v):
  261.     MouseData = Bladex.GetMouseState()
  262.     Bladex.SetMouseState(MouseData[0],v,MouseData[2])
  263.     KeybWidget.SaveListConfig()
  264.  
  265. # Y Sens
  266. def GetMouseYSens():
  267.     MouseData = Bladex.GetMouseState()
  268.     return MouseData[2]
  269.  
  270. def SetMouseYSens(v):
  271.     MouseData = Bladex.GetMouseState()
  272.     Bladex.SetMouseState(MouseData[0],MouseData[1],v)
  273.     KeybWidget.SaveListConfig()
  274.  
  275. # KeybConfig
  276. def ResetKeyB(option):
  277.     _MainMenu.DeActivateMenuItem()
  278.     acts.ResetDefaultControls()
  279.     if KeybWidget.AdditionalKeysCallBack:
  280.        KeybWidget.AdditionalKeysCallBack()
  281.     _MainMenu.ActivateMenuItem()
  282.     #Maybe should be overwritting values with default-control-file values
  283.  
  284.     
  285.  
  286. def SetDeFacingValue(v):
  287.     return Bladex.SetAecGap(v)
  288.  
  289.  
  290.  
  291. # Scorer Config
  292. CurrentScorerVar = "Full"
  293.  
  294. def CurrentScorer():
  295.     global CurrentScorerVar
  296.     if CurrentScorerVar == "Full":
  297.         return 0
  298.     if CurrentScorerVar == "Auto":
  299.         return 1
  300.  
  301. def SetScorer(option):
  302.     global CurrentScorerVar
  303.     import Scorer
  304.     if option == "Full":
  305.         Scorer.PowDefWidgets.Activate()
  306.         Scorer.wKeysFrame.SetVisible(1)
  307.         Scorer.wKeysRFrame.SetVisible(1)
  308.         Scorer.wSpecialsFrame.SetVisible(1)
  309.         Scorer.wEnemiesFrame.SetVisible(1)
  310.         Scorer.wObjectsFrame.SetVisible(1)
  311.         Scorer.wArrowInfo.SetVisible(1)
  312.     elif option == "Auto":
  313.         Scorer.wLeftHand.SetVisible(0)
  314.         Scorer.wRightHand.SetVisible(0)
  315.         Scorer.PowDefWidgets.Deactivate()
  316.         Scorer.wKeysFrame.SetVisible(0)
  317.         Scorer.wKeysRFrame.SetVisible(0)
  318.         Scorer.wSpecialsFrame.SetVisible(0)
  319.         Scorer.wEnemiesFrame.SetVisible(0)
  320.         Scorer.wObjectsFrame.SetVisible(0)
  321.         Scorer.wArrowInfo.SetVisible(0)
  322.     CurrentScorerVar = option
  323.     SaveConfiguration()
  324.  
  325.   
  326. # Gore PassWord Checking
  327. def CheckGorePassWord():
  328.     global GORE_PASSWORD
  329.     global CORRECT_GORE_PASSWORD
  330.     
  331.     print "Checking Password"
  332.     return (CORRECT_GORE_PASSWORD == GORE_PASSWORD)
  333.     
  334.  
  335. def Empty():
  336.     return ""
  337.  
  338. def SetPass(name):
  339.     global GORE_PASSWORD
  340.     GORE_PASSWORD = name
  341.  
  342. def SetNewPass(name):
  343.     global NEW_GORE_PASSWORD
  344.     NEW_GORE_PASSWORD = name
  345.  
  346. def SetConfNewPass(name):
  347.     global CONFIRM_GORE_PASSWORD
  348.     CONFIRM_GORE_PASSWORD = name
  349.  
  350. def SavePassword(xx):
  351.     global CONFIRM_GORE_PASSWORD
  352.     global NEW_GORE_PASSWORD
  353.     global GORE_PASSWORD
  354.     global CORRECT_GORE_PASSWORD
  355.     
  356.     if (CORRECT_GORE_PASSWORD == GORE_PASSWORD):
  357.         if (NEW_GORE_PASSWORD == CONFIRM_GORE_PASSWORD):
  358.             CORRECT_GORE_PASSWORD = NEW_GORE_PASSWORD
  359.             SavePasswordFile()
  360.             _MainMenu.DeActivateMenuItem()
  361.         else:
  362.             print MenuText.GetMenuText("Password confirmation differs")
  363.     else:
  364.         print MenuText.GetMenuText("Wrong password")
  365.     
  366.     
  367. def SaveConfiguration():
  368.     
  369.     cfgfile=open('..\\..\\Scripts\\GameCfg.py','w')
  370.     cfgfile.write('\n# Configuration settings... be carefull!\n\n\n')
  371.     cfgfile.write("Bladex.SetBloodLevel("+`Bladex.GetBloodLevel()`+')\n')
  372.     cfgfile.write("Bladex.SetMutilationLevel("+`Bladex.GetMutilationLevel()`+')\n')
  373.     cfgfile.write("Bladex.SetDrawObjectShadows("+`Bladex.GetDrawObjectShadows()`+')\n')
  374.     cfgfile.write("Bladex.SetAutoEngageCombat("+`Bladex.GetAutoEngageCombat()`+')\n')
  375.     cfgfile.write("Bladex.SetAecGap("+`Bladex.GetAecGap()`+')\n')    
  376.     cfgfile.write("SetScorer("+`CurrentScorerVar`+")\n")
  377.         
  378.     cfgfile.write('\n# Achalay my brother!.\n\n\n')
  379.     cfgfile.close()
  380.     
  381.     print "Game options Saved."
  382.  
  383. ## Sangre
  384. # Traducir
  385. def SetBlood(option):
  386.   if option=="Yes":
  387.     Bladex.SetBloodLevel(1)
  388.   else:
  389.     Bladex.SetBloodLevel(0)
  390.   SaveConfiguration()
  391.  
  392.  
  393. def BloodSettings():
  394.   if Bladex.GetBloodLevel():
  395.     return 0
  396.   else:
  397.     return 1
  398.  
  399.  
  400.  
  401. ## Mutilaciones
  402. # Traducir
  403. def SetMutilation(option):
  404.   if option=="Yes":
  405.     Bladex.SetMutilationLevel(1)
  406.   else:
  407.     Bladex.SetMutilationLevel(0)
  408.   SaveConfiguration()
  409.  
  410.  
  411. def MutilationSettings():
  412.   if Bladex.GetMutilationLevel():
  413.     return 0
  414.   else:
  415.     return 1
  416.  
  417.  
  418.  
  419.  
  420.  
  421. ## Sombras
  422. # Traducir
  423. def SetShadows(option):
  424.   if option=="Yes":
  425.     Bladex.SetDrawObjectShadows(1)
  426.   else:
  427.     Bladex.SetDrawObjectShadows(0)
  428.   SaveConfiguration()
  429.  
  430.  
  431. def ShadowsSettings():
  432.   if Bladex.GetDrawObjectShadows():
  433.     return 0
  434.   else:
  435.     return 1
  436.  
  437.  
  438.  
  439.  
  440. ## Correcci≤n Gamma
  441. def GetGammaValue():
  442.   return Raster.GetGammaCorrection()
  443.  
  444. def SetGammaValue(v):
  445.   Raster.SetGammaCorrection(v)
  446.  
  447. ## Correcci≤n Brightness
  448. def GetBrightnessValue():
  449.   return Raster.GetBrightness()
  450.  
  451. def SetBrightnessValue(v):
  452.   Raster.SetBrightness(v)
  453.  
  454. ## Correcci≤n Contrast
  455. def GetContrastValue():
  456.   return Raster.GetContrast()
  457.  
  458. def SetContrastValue(v):
  459.   Raster.SetContrast(v)
  460.  
  461.  
  462.  
  463.  
  464. # OPTIONS/SOUND FUNCTION CALLS----------------
  465. ## Volumen de sonido
  466. def GetSoundValue():
  467.   return int(10*Bladex.GetSoundVolume())
  468.  
  469. def SetSoundValue(v):
  470.   global sound_cfg_changed
  471.   sound_cfg_changed=1
  472.  
  473.   return Bladex.SetSoundVolume(v*0.1)
  474.  
  475. ## Volumen de la musica
  476. def GetMusicValue():
  477.   return int(10*Bladex.GetMusicVolume())
  478.  
  479.  
  480. def SetMusicValue(v):
  481.   global sound_cfg_changed
  482.   sound_cfg_changed=1
  483.  
  484.   return Bladex.SetMusicVolume(v*0.1)
  485.  
  486.  
  487.  
  488. def GetSoundQuality():
  489.     global last_ss_quality
  490.     last_ss_quality=Bladex.GetSSQuality()
  491.     return Bladex.GetSSQuality()
  492.  
  493.  
  494. def SetSoundQuality(option):
  495.     global last_ss_quality
  496.     if option == "High":
  497.         #Bladex.SetSSQuality(2)
  498.         last_ss_quality=2
  499.         return 2
  500.     if option == "Med":
  501.         #Bladex.SetSSQuality(1)
  502.         last_ss_quality=1
  503.         return 1
  504.     if option == "Low":
  505.         #Bladex.SetSSQuality(0)
  506.         last_ss_quality=0
  507.         return 0
  508.  
  509. #---
  510. def GetEAX():
  511.     return Bladex.GetEAXOverride()
  512.  
  513.  
  514. def SetEAX(option):
  515.     global sound_cfg_changed
  516.     sound_cfg_changed=1
  517.  
  518.     if option == "Enabled":
  519.         Bladex.SetEAXOverride(0)
  520.         #a = "hacer algo"
  521.     if option == "Disabled":
  522.         Bladex.SetEAXOverride(1)
  523.         #a = "hacer algo"
  524. #---
  525. def GetSpeakerConfig():
  526.     return Bladex.GetSpeakerConfig()
  527.  
  528.  
  529. def SetSpeakerConfig(option):
  530.     global sound_cfg_changed
  531.     sound_cfg_changed=1
  532.  
  533.     if option == "4":
  534.         Bladex.SetSpeakerConfig(3)
  535.         return 3
  536.     if option == "2":
  537.         Bladex.SetSpeakerConfig(1)
  538.         return 1
  539.     if option == "2 + Subwoofer":
  540.         Bladex.SetSpeakerConfig(2)
  541.         return 2
  542.     if option == "Earphones":
  543.         Bladex.SetSpeakerConfig(0)
  544.         return 0
  545.  
  546.  
  547. #---------------------------------------------
  548.  
  549. #def GetMouseInvert():
  550. #    MouseData = Bladex.GetMouseState()
  551. #    return MouseData[0]
  552.  
  553. #def SetMouseInvert(option):
  554. #    MouseData = Bladex.GetMouseState()
  555. #    if option == "Yes":
  556. #        Bladex.SetMouseState(0,MouseData[1],MouseData[2])
  557. #    else:
  558. #        Bladex.SetMouseState(1,MouseData[1],MouseData[2])
  559.  
  560. ## De-Facing Values
  561. def GetDeFacingValue():
  562.   return int( Bladex.GetAecGap() )
  563.  
  564. def SetDeFacingValue(v):
  565.   i = Bladex.SetAecGap(v)
  566.   SaveConfiguration()
  567.   return  i
  568.  
  569.     
  570. #Inicio de TravelBook
  571. def ExecTravelBook(menu_class):
  572.     if Reference.DEMO_MODE==1:
  573.         return
  574.     import Scorer
  575.     Scorer.HideTBS()
  576.     hWnd = Bladex.GetWindowId()
  577.  
  578.     print "Executing Travel Book..."
  579.     # Status File Setup
  580.     StatusFile = open("..\\..\\TravelBook\\status.txt", "w")
  581.  
  582.     BarbEquipementFile = None
  583.     AmazonEquipementFile = None
  584.     DwarfEquipementFile = None
  585.     KnightEquipementFile = None
  586.  
  587.     char = Bladex.GetEntity("Player1")
  588.     Inventory = char.GetInventory()
  589.  
  590.     # CHARACTER TYPE AND MAIN AVAILABLE LINKS---------
  591.  
  592.     # Character Characteristics_____
  593.     if char.Kind == "Barbarian_N":
  594.         StatusFile.write("Barbarian\n")    # Character Barabarian
  595.     #    if Bladex.GetCurrentMap != "Barb-M1"  : StatusFile.write("cc\n")            # ! First Map 4 this character
  596.  
  597.     if char.Kind == "Amazon_N":
  598.         StatusFile.write("Amazon\n")        # Character Amazon
  599.     #    if Bladex.GetCurrentMap != "Ruins-M4" : StatusFile.write("cc\n")            # ! First Map 4 this character
  600.  
  601.     if char.Kind == "Dwarf_N":
  602.         StatusFile.write("Dwarf\n")            # Character Dwarf
  603.     #    if Bladex.GetCurrentMap != "Dwarf_M3" : StatusFile.write("cc\n")            # ! First Map 4 this character
  604.  
  605.     if char.Kind == "Knight_N":
  606.         StatusFile.write("Knight\n")        # Character Knight
  607.     #    if Bladex.GetCurrentMap != "Ragnar-M2": StatusFile.write("cc\n")            # ! First Map 4 this character
  608.  
  609.     StatusFile.write("cc\n")            # Making Character Characteristics available.
  610.     
  611.     # Creation History Link________
  612.     if (Inventory.nTablets > 0):
  613.         StatusFile.write("ch\n")
  614.     
  615.     if len(GotoMapVars.BaList):
  616.         StatusFile.write("ba\n")
  617.  
  618.     StatusFile.close()
  619.     #-------------------------------------------------
  620.  
  621.     # SKILL FILE--------------------------------------
  622.     SkillFile    = open("..\\..\\TravelBook\\Character Characteristics\\Skills\\Character Skills.txt", "w")
  623.     list = Bladex.GetCombos("Player1") # Also 2 be used for Specific Weapon Combos
  624.     for i in range(len(list)):
  625.         if list[i][1] == 0:
  626.             SkillFile.write("New")
  627.         SkillFile.write(list[i][0])
  628.         SkillFile.write("\n")
  629.     SkillFile.close()
  630.     #-------------------------------------------------
  631.  
  632.     # EQUIPEMENT FILE---------------------------------
  633.     BarbEquipementFile        = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Barb\\Carried Equipement.txt", "w")
  634.     AmazonEquipementFile    = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Amazon\\Carried Equipement.txt", "w")
  635.     DwarfEquipementFile        = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Dwarf\\Carried Equipement.txt", "w")
  636.     KnightEquipementFile    = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Knight\\Carried Equipement.txt", "w")
  637.     
  638.     BarbShieldsFile            = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Barb\\Carried Shields.txt", "w")
  639.     AmazonShieldsFile        = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Amazon\\Carried Shields.txt", "w")
  640.     DwarfShieldsFile        = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Dwarf\\Carried Shields.txt", "w")
  641.     KnightShieldsFile        = open("..\\..\\TravelBook\\Character Characteristics\\Equipement\\Knight\\Carried Shields.txt", "w")
  642.  
  643.     
  644.     # Race-Ordered Weapons
  645.     KnightWeaps = [    "QueenSword","IceSword","FireSword","Gladius","Orksword","Espadaelfica" ,
  646.                     "Espadaromana","Espadacurva","Dagesse","Cimitarra","EgyptSword","Espadafilo" ,
  647.                     "Espada","Maza","Maza2","Maza3"]
  648.  
  649.     DwarfWeaps = [    "CrushHammer","FireAxe","IceHammer","Hacha","Hacha5","Hacha4","Hacha3",
  650.                     "Hacha6","Hacha2","Garrote","Martillo","Martillo2","Garropin","MazaDoble" ,
  651.                     "Garrote2","Martillo3"]
  652.  
  653.     AmazonWeaps = [    "TaiSword","SteelFeather","FireBo","LightEdge","Ninjato",
  654.                     "HookSword","Katana" ,"DoubleSword","Bo","Lanza","Naginata","Tridente",
  655.                     "Hachacuchilla","Naginata2","DeathBo","CrushBo"]
  656.  
  657.     BarbWeaps  = [    "FireBigSword","IceAxe","DalWeapon","Sablazo","Chaosword",
  658.                     "DeathSword","LongSword","Alfanje","BigSword","SawSword","FlatSword",
  659.                     "Eclipse","Guadanya","Hacha2hojas","RhinoClub","Hacharrajada"]
  660.  
  661.     ShowableItems = []
  662.  
  663.     InventoryList = []
  664.     
  665.     for i in range(Inventory.nWeapons):
  666.         Weapon = Inventory.GetWeapon(i)
  667.         RootWeapon = Bladex.GetEntity(Weapon)
  668.         InventoryList.append(RootWeapon.Kind)
  669.  
  670.     # Fromerly picked Weapons___
  671.     TakenObjects = char.Data.GetObjectsTaken()
  672.  
  673.     # ITEMS FILE________________
  674.     ItemsFile    = open("..\\..\\TravelBook\\Character Characteristics\\Items\\Carried Items.txt", "w")
  675.     for i in range(Inventory.nKindObjects):
  676.         Object = Inventory.GetObject(i)
  677.         RootObject = Bladex.GetEntity(Object)
  678.         ItemsFile.write(RootObject.Kind)
  679.         ItemsFile.write("\n")
  680.  
  681.     ItemsFile.close()
  682.     #---------------------------
  683.  
  684.     # FORMERLY PICKED WEAPONS___
  685.     for i in TakenObjects:
  686.         if not InventoryList.count(i):
  687.             if (BarbWeaps.count(i)):
  688.                 BarbEquipementFile.write(i)
  689.                 WC = Bladex.GetWeaponCombos("Player1",i)
  690.                 BarbEquipementFile.write("\n")
  691.                 c = 0
  692.                 for combo in WC:
  693.                     BarbEquipementFile.write(combo[0])
  694.                     BarbEquipementFile.write("\n")
  695.                     c = c+1
  696.                 for counter in range(4 - c):
  697.                     BarbEquipementFile.write("none\n")
  698.             
  699.             
  700.             if (AmazonWeaps.count(i)):
  701.                 AmazonEquipementFile.write(i)
  702.                 WC = Bladex.GetWeaponCombos("Player1",i)
  703.                 AmazonEquipementFile.write("\n")
  704.                 c = 0
  705.                 for combo in WC:
  706.                     AmazonEquipementFile.write(combo[0])
  707.                     AmazonEquipementFile.write("\n")
  708.                     c = c+1
  709.                 for counter in range(4 - c):
  710.                     AmazonEquipementFile.write("none\n")
  711.             
  712.             
  713.             if (DwarfWeaps.count(i)):
  714.                 DwarfEquipementFile.write(i)
  715.                 WC = Bladex.GetWeaponCombos("Player1",i)
  716.                 DwarfEquipementFile.write("\n")
  717.                 c = 0
  718.                 for combo in WC:
  719.                     DwarfEquipementFile.write(combo[0])
  720.                     DwarfEquipementFile.write("\n")
  721.                     c = c+1
  722.                 for counter in range(4 - c):
  723.                     DwarfEquipementFile.write("none\n")
  724.             
  725.             
  726.             if (KnightWeaps.count(i)):
  727.                 KnightEquipementFile.write(i)
  728.                 WC = Bladex.GetWeaponCombos("Player1",i)
  729.                 KnightEquipementFile.write("\n")
  730.                 c = 0
  731.                 for combo in WC:
  732.                     KnightEquipementFile.write(combo[0])
  733.                     KnightEquipementFile.write("\n")
  734.                     c = c+1
  735.                 for counter in range(4 - c):
  736.                     KnightEquipementFile.write("none\n")
  737.  
  738.  
  739.     WrittenWeapons = []
  740.     
  741.     # CARRIED WEAPONS___________
  742.     for i in range(Inventory.nWeapons):
  743.         Weapon = Inventory.GetWeapon(i)
  744.         RootWeapon = Bladex.GetEntity(Weapon)
  745.         if not WrittenWeapons.count(RootWeapon.Kind):
  746.             WrittenWeapons.append(RootWeapon.Kind)
  747.     
  748.             # Weapon is Barbarian's
  749.             if(BarbWeaps.count(RootWeapon.Kind)):
  750.                 i = RootWeapon.Kind
  751.                 BarbEquipementFile.write(i)
  752.                 BarbEquipementFile.write("_i")
  753.                 WC = Bladex.GetWeaponCombos("Player1",i)
  754.                 BarbEquipementFile.write("\n")
  755.                 c = 0
  756.                 for combo in WC:
  757.                     if not BarbEquipementFile.write(combo[1]) == 0:
  758.                         BarbEquipementFile.write("New")
  759.                     BarbEquipementFile.write(combo[0])
  760.                     BarbEquipementFile.write("\n")
  761.                     c = c+1
  762.                 for counter in range(4 - c):
  763.                     BarbEquipementFile.write("none\n")
  764.     
  765.             # Weapon is Amazon's
  766.             if(AmazonWeaps.count(RootWeapon.Kind)):
  767.                 i = RootWeapon.Kind
  768.                 AmazonEquipementFile.write(i)
  769.                 AmazonEquipementFile.write("_i")
  770.                 WC = Bladex.GetWeaponCombos("Player1",i)
  771.                 AmazonEquipementFile.write("\n")
  772.                 c = 0
  773.                 for combo in WC:
  774.                     if not AmazonEquipementFile.write(combo[1]) == 0:
  775.                         AmazonEquipementFile.write("New")
  776.                     AmazonEquipementFile.write(combo[0])
  777.                     AmazonEquipementFile.write("\n")
  778.                     c = c+1
  779.                 for counter in range(4 - c):
  780.                     AmazonEquipementFile.write("none\n")
  781.     
  782.             # Weapon is Dwarf's
  783.             if(DwarfWeaps.count(RootWeapon.Kind)):
  784.                 i = RootWeapon.Kind
  785.                 DwarfEquipementFile.write(i)
  786.                 DwarfEquipementFile.write("_i")
  787.                 WC = Bladex.GetWeaponCombos("Player1",i)
  788.                 DwarfEquipementFile.write("\n")
  789.                 c = 0
  790.                 for combo in WC:
  791.                     if not DwarfEquipementFile.write(combo[1]) == 0:
  792.                         DwarfEquipementFile.write("New")
  793.                     DwarfEquipementFile.write(combo[0])
  794.                     DwarfEquipementFile.write("\n")
  795.                     c = c+1
  796.                 for counter in range(4 - c):
  797.                     DwarfEquipementFile.write("none\n")
  798.     
  799.             # Weapon is Knight
  800.             if(KnightWeaps.count(RootWeapon.Kind)):
  801.                 i = RootWeapon.Kind
  802.                 KnightEquipementFile.write(i)
  803.                 KnightEquipementFile.write("_i")
  804.                 WC = Bladex.GetWeaponCombos("Player1",i)
  805.                 KnightEquipementFile.write("\n")
  806.                 c = 0
  807.                 for combo in WC:
  808.                     if not KnightEquipementFile.write(combo[1]) == 0:
  809.                         KnightEquipementFile.write("New")
  810.                     KnightEquipementFile.write(combo[0])
  811.                     KnightEquipementFile.write("\n")
  812.                     c = c+1
  813.                 for counter in range(4 - c):
  814.                     KnightEquipementFile.write("none\n")
  815.  
  816.     WrittenShields = []
  817.     # Carried Shiels___________
  818.     for i in range(Inventory.nShields):
  819.         Shield = Inventory.GetShield(i)
  820.         RootShield = Bladex.GetEntity(Shield)
  821.         if not WrittenShields.count(RootShield.Kind):
  822.             WrittenShields.append(RootShield.Kind)
  823.  
  824.             #if RootShield is Barb's
  825.             BarbShieldsFile.write(RootShield.Kind)
  826.             BarbShieldsFile.write("_i")
  827.             BarbShieldsFile.write("\n")
  828.     
  829.             #if RootShield is Amazon's
  830.             AmazonShieldsFile.write(RootShield.Kind)
  831.             AmazonShieldsFile.write("_i")
  832.             AmazonShieldsFile.write("\n")
  833.     
  834.             #if RootShield is Dwarf's
  835.             DwarfShieldsFile.write(RootShield.Kind)
  836.             DwarfShieldsFile.write("_i")
  837.             DwarfShieldsFile.write("\n")
  838.     
  839.             #if RootShield is Knight's
  840.             KnightShieldsFile.write(RootShield.Kind)
  841.             KnightShieldsFile.write("_i")
  842.             KnightShieldsFile.write("\n")
  843.     # FORMERLY CARRIED SHIELDS___________
  844.     Shield = [    "Escudo1","Escudo2","Escudo3","Escudo4","Escudo5","Escudo6","Escudo7",
  845.                 "Escudo8","Escudo9","Escudon","VampShield","DalShield","KingShield"]
  846.  
  847.     for Obj in TakenObjects:
  848.         if not InventoryList.count(Obj):
  849.             if Shield.count(Obj):
  850.                 KnightShieldsFile.write(RootShield.Kind)
  851.                 KnightShieldsFile.write("\n")
  852.                 DwarfShieldsFile.write(RootShield.Kind)
  853.                 DwarfShieldsFile.write("\n")
  854.                 BarbShieldsFile.write(RootShield.Kind)
  855.                 BarbShieldsFile.write("\n")
  856.                 AmazonShieldsFile.write(RootShield.Kind)
  857.                 AmazonShieldsFile.write("\n")
  858.  
  859.     #if it is a shield
  860.     # if it is not in inventory
  861.     #write shield
  862.  
  863.     BarbEquipementFile.close()
  864.     AmazonEquipementFile.close()
  865.     DwarfEquipementFile.close()
  866.     KnightEquipementFile.close()
  867.  
  868.     BarbShieldsFile.close() 
  869.     AmazonShieldsFile.close()
  870.     DwarfShieldsFile.close()
  871.     KnightShieldsFile.close()
  872.     #-------------------------------------------------
  873.     
  874.     # DIARY WRITING-----------------------------------
  875.     # Writting Fuct--------------------
  876.     count = 1
  877.     for imapa in range(len(GotoMapVars.MText)):
  878.         MFile = open("..\\..\\TravelBook\\Kingdom History\\M"+`imapa + 1`+".txt", "w")
  879.         for texto in GotoMapVars.MText[imapa]:
  880.             if (texto[0] == "T" and texto[1] == "T"):
  881.                 MFile.write(texto)
  882.                 MFile.write(str(count))
  883.                 count = count + 1
  884.             else :
  885.                 MFile.write(texto)
  886.                 if char.Kind == "Barbarian_N":
  887.                     MFile.write("Bar")
  888.                 if char.Kind == "Amazon_N":
  889.                     MFile.write("Amz")
  890.                 if char.Kind == "Dwarf_N":
  891.                     MFile.write("Dwf")
  892.                 if char.Kind == "Knight_N":
  893.                     MFile.write("Kgt")
  894.             MFile.write(".htm")
  895.             MFile.write("\n")
  896.         MFile.close()
  897.     #----------------------------------    
  898.     #-------------------------------------------------
  899.     # CREATION HISTORY--------------------
  900.     count = 1
  901.     MFile = open("..\\..\\TravelBook\\Creation History\\status.txt", "w")
  902.     for imapa in range(len(GotoMapVars.MText)):
  903.         for texto in GotoMapVars.MText[imapa]:
  904.             if (texto[0] == "T" and texto[1] == "T"):
  905.                 MFile.write("CH")
  906.                 MFile.write(str(count))
  907.                 count = count + 1
  908.                 MFile.write("\n")
  909.     MFile.close()
  910.     #----------------------------------    
  911.     # BLADE ATHEM--------------------
  912.     MFile = open("..\\..\\TravelBook\\The Blade Athem\\status.txt", "w")
  913.     for mapp in GotoMapVars.BaList:
  914.         MFile.write(mapp)
  915.         MFile.write("\n")
  916.     MFile.close()
  917.     #----------------------------------    
  918.  
  919.     Bladex.SetInputMode("Mouse","UNACQUIRE")
  920.     Bladex.SetInputMode("Keyboard","UNACQUIRE")
  921.     BIPCx.CreateNewProcess("..\\..\\TravelBook\\BladeTBW.exe",hWnd)
  922.     BIPCx.CreateNewProcess("..\\..\\TravelBook\\TravelBook.exe",hWnd)
  923.     print "Waiting..."
  924.     print BIPCx.WaitCommand()
  925.     Bladex.SetInputMode("Mouse","ACQUIRE")
  926.     Bladex.SetInputMode("Keyboard","ACQUIRE")
  927.  
  928.  
  929.  
  930.  
  931.  
  932. _MainMenu=None
  933.  
  934.  
  935.  
  936.  
  937. def ActivateMenu():
  938.   try:
  939.     AppMode=Bladex.GetAppMode()
  940.   except x:
  941.     print "Error getting AppMode",x
  942.  
  943.   if AppMode=="Game" or AppMode=="Demo":
  944.  
  945.     if AppMode=="Demo":
  946.         import Demo_Stuff
  947.         if Demo_Stuff.demo_is_active==1:
  948.             #pdb.set_trace()
  949.             print "ERROR - Menu.ActivateMenu()"
  950.             print "Fix with a path but should NOT happen!!!"
  951.             Demo_Stuff.DemoLoop()
  952.             return
  953.  
  954.     global _MainMenu
  955.  
  956.     # Stop Music
  957.     # Start Music
  958.     #Bladex.KillMusic()
  959.  
  960.     _MainMenu=MainMenu("Menu Principal",Desc1)
  961.     NetMisc.SetMainMenu(_MainMenu)
  962.  
  963.     #print "Reference count _MainMenu.wMenu: (recien creado)",sys.getrefcount(_MainMenu.wMenu)
  964.  
  965.     _MainMenu.MenuStack.Push(_MainMenu.wMenu)
  966.  
  967.     InputManager=BInput.GetInputManager()    
  968.     oldInputActionsSet=InputManager.GetInputActionsSet()
  969.     InputManager.SetInputActionsSet("Menu")
  970.  
  971.     # Acciones de los men·s.
  972.     Bladex.AddInputAction("Menu Next",0)
  973.     Bladex.AddInputAction("Menu Prev",0)
  974.     Bladex.AddInputAction("Menu Inc",0)
  975.     Bladex.AddInputAction("Menu Dec",0)
  976.     Bladex.AddInputAction("Menu ActivateItem",0)
  977.     Bladex.AddInputAction("Menu DeActivateItem",0)
  978.     Bladex.AddInputAction("Menu Supr",0)
  979.     Bladex.AddInputAction("Menu Next Strong",0)
  980.  
  981.  
  982.     # Teclas de los men·s.
  983.     Bladex.AssocKey("Menu Next","Keyboard","Down")
  984.     Bladex.AddBoundFunc("Menu Next",_MainMenu.MenuNextItem)
  985.  
  986.     Bladex.AssocKey("Menu Prev","Keyboard","Up")
  987.     Bladex.AddBoundFunc("Menu Prev",_MainMenu.MenuPrevItem)
  988.  
  989.     Bladex.AssocKey("Menu Inc","Keyboard","Right")
  990.     Bladex.AddBoundFunc("Menu Inc",_MainMenu.MenuIncItem)
  991.  
  992.     Bladex.AssocKey("Menu Dec","Keyboard","Left")
  993.     Bladex.AddBoundFunc("Menu Dec",_MainMenu.MenuDecItem)
  994.  
  995.     Bladex.AssocKey("Menu Supr","Keyboard","Delete")
  996.     Bladex.AddBoundFunc("Menu Supr",_MainMenu.MenuSuprItem)
  997.  
  998.     Bladex.AssocKey("Menu ActivateItem","Keyboard","Enter")
  999.     Bladex.AddBoundFunc("Menu ActivateItem",_MainMenu.ActivateMenuItem)
  1000.  
  1001.     #Bladex.AssocKey("Menu DeActivateItem","Keyboard","Backspace")
  1002.     Bladex.AssocKey("Menu DeActivateItem","Keyboard","Esc")
  1003.     Bladex.AddBoundFunc("Menu DeActivateItem",_MainMenu.DeActivateMenuItem)
  1004.  
  1005.     Bladex.AssocKey("Menu Next Strong","Keyboard","Tab")
  1006.     Bladex.AddBoundFunc("Menu Next Strong",_MainMenu.MenuNextItemStrong)
  1007.  
  1008.  
  1009.     InputManager=BInput.GetInputManager()
  1010.     InputManager.SetInputActionsSet("Menu")
  1011.     if Reference.DEMO_MODE==0:
  1012.         SaveGame.CreateSaveMenu()
  1013.         
  1014.     #print "Reference count _MainMenu.wMenu: (fin de ActivateMenu())",sys.getrefcount(_MainMenu.wMenu)
  1015.     #Bladex.SetAppMode("Menu")
  1016.   elif AppMode=="Menu":
  1017.     # Start Music
  1018.     #Bladex.ExeMusicEvent(Bladex.GetMusicEvent("MenuMusic"))
  1019.     #print "Reference count _MainMenu.wMenu:",sys.getrefcount(_MainMenu.wMenu)
  1020.     #print "Reference count _MainMenu:",sys.getrefcount(_MainMenu)
  1021.     Bladex.AddScheduledFunc(Bladex.GetTime(),ClearMenuKeyb,())
  1022.     Bladex.SetAppMode("Game")
  1023.     
  1024.     if netgame.GetNetState() == 0:
  1025.       import Scorer
  1026.       Scorer.ActivateScorer()
  1027.     else:
  1028.       NetScorer.ActivateScorer()
  1029.       
  1030.     Raster.SetTextMode(3)
  1031.  
  1032.  
  1033.   else:
  1034.     print "Invalid AppMode"
  1035.  
  1036.   print "End ActivateMenu()"
  1037.  
  1038.  
  1039. def PreActivateMenu():
  1040.   Bladex.AddScheduledFunc(Bladex.GetTime(), ActivateMenu, (), "ActivateMenu")
  1041.  
  1042. def ClearMenuKeyb():
  1043.   InputManager=BInput.GetInputManager()
  1044.   InputManager.SetInputActionsSet("Menu")
  1045.  
  1046.   global _MainMenu
  1047.  
  1048.   #print "Reference count _MainMenu:",sys.getrefcount(_MainMenu)
  1049.  
  1050.   Bladex.RemoveInputAction("Menu Next")
  1051.   Bladex.RemoveInputAction("Menu Prev")
  1052.   Bladex.RemoveInputAction("Menu Inc")
  1053.   Bladex.RemoveInputAction("Menu Dec")
  1054.   Bladex.RemoveInputAction("Menu ActivateItem")
  1055.   Bladex.RemoveInputAction("Menu DeActivateItem")
  1056.   Bladex.RemoveInputAction("Menu Supr")
  1057.   Bladex.RemoveInputAction("Menu Next Strong")
  1058.  
  1059.   #print "Reference count _MainMenu: (Antes ->None)",sys.getrefcount(_MainMenu)
  1060.   _MainMenu=None
  1061.   #print "Reference count _MainMenu: (Asignacion -> None)",sys.getrefcount(_MainMenu)
  1062.  
  1063.   InputManager.SetInputActionsSet("Default")
  1064.  
  1065.  
  1066.  
  1067.  
  1068.  
  1069.  
  1070.  
  1071.  
  1072. wNULL_MenuParent=BUIx.CreateNULLWidget()
  1073.  
  1074. class MainMenu:
  1075.   def __init__(self,Name,MenuDescription):
  1076.     #Bldb.set_trace()
  1077.     self.Name=Name
  1078.     self.MenuDescription=MenuDescription
  1079.     #BBLib.ReadMMP("..\\..\\Data\\NewLogo.mmp")
  1080.     self.MenuStack=MenuWidget.MenuStack(ActivateMenu)
  1081.     self.wMenu=MenuWidget.B_MenuTree(wNULL_MenuParent,self.MenuDescription,self.MenuStack)
  1082.     self.wMenu.SetAutoScale(1)
  1083.  
  1084. #Raster.LoadBitmap("Background","..\\..\\Data\\Menu.bmp")
  1085.  
  1086.   def __del__(self):
  1087.     self.MenuStack.Reset()
  1088.     self.MenuStack=None
  1089.     self.wMenu=None
  1090.  
  1091.  
  1092.   def ActivateMenuItem(self):
  1093.     if Bladex.GetAppMode()=="Menu":
  1094.       wActiveMenuElement=self.MenuStack.Top().GetFocus()
  1095.       try:
  1096.         sw=wActiveMenuElement.GetFocus()
  1097.         sw.ActivateItem(1)
  1098.       except:
  1099.         wActiveMenuElement.ActivateItem(1)
  1100.       #print "Act"
  1101.       #PlaySound(SndNewMenu)
  1102.       SndNewMenu.PlayStereo()
  1103.  
  1104.  
  1105.   def DeActivateMenuItem(self):
  1106.     global EscapeFunction
  1107.     if Bladex.GetAppMode()=="Menu":
  1108.     
  1109.       if ((self.MenuStack.nItems() == 1) and (EscapeFunction!=None)):
  1110.         if(EscapeFunction(0)):
  1111.           return      
  1112.  
  1113.       wActiveMenuElement=self.MenuStack.Top().GetFocus()
  1114.       try:
  1115.         sw=wActiveMenuElement.GetFocus()
  1116.         sw.ActivateItem(0)
  1117.       except:
  1118.         wActiveMenuElement.ActivateItem(0)
  1119.       #print "Deact"
  1120.  
  1121.  
  1122.       #
  1123.       # Do we have to  change the quality of the sound?
  1124.       #
  1125.       global last_ss_quality
  1126.       global sound_cfg_changed
  1127.       if last_ss_quality!=-1 and last_ss_quality<>Bladex.GetSSQuality():
  1128.         print "Reseting sound quality"
  1129.         Bladex.SetSSQuality(last_ss_quality)
  1130.       else:
  1131.         if sound_cfg_changed==1:
  1132.             Bladex.SaveSSConfig()
  1133.             sound_cfg_changed=0
  1134.  
  1135.  
  1136.       SndNewMenu.PlayStereo()
  1137.  
  1138.  
  1139.  
  1140.   def MenuNextItemStrong(self):
  1141.     w=self.MenuStack.Top()
  1142.     w.NextFocus()
  1143.  
  1144.   def MenuNextItem(self):
  1145.     w=self.MenuStack.Top()
  1146.     sw=w.GetFocus()
  1147.     #PlaySound(SndCorreGema)
  1148.     SndCorreGema.PlayStereo()
  1149.     try:
  1150.       sw.NextFocus()
  1151.     except:
  1152.       w.NextFocus()
  1153.  
  1154.  
  1155.   def MenuPrevItem(self):
  1156.     w=self.MenuStack.Top()
  1157.     sw=w.GetFocus()
  1158.     #PlaySound(SndCorreGema)
  1159.     SndCorreGema.PlayStereo()
  1160.     try:
  1161.       sw.PrevFocus()
  1162.     except:
  1163.       w.PrevFocus()
  1164.  
  1165.  
  1166.   def MenuIncItem(self):
  1167.     w=self.MenuStack.Top()
  1168.     sw=w.GetFocus()
  1169.     try:
  1170.       #print "Increasing spin value"
  1171.       sw.IncMenuItem()
  1172.     except AttributeError:
  1173.       try:
  1174.         w.IncMenuItem()
  1175.       except AttributeError:
  1176.          pass
  1177.       #print "cant increase any more"#Seems not 2 be working this way
  1178.  
  1179.   def MenuDecItem(self):
  1180.     w=self.MenuStack.Top()
  1181.     sw=w.GetFocus()
  1182.     try:
  1183.       sw.DecMenuItem()
  1184.       #print "Decreasing spin value"
  1185.     except AttributeError:
  1186.       try:
  1187.         w.DecMenuItem()
  1188.       except AttributeError:
  1189.          pass
  1190.       #print "cant decrease any more"#Seems not 2 be working this way
  1191.  
  1192.  
  1193.   def MenuSuprItem(self):
  1194.     print "MenuSuprItem(self)"
  1195.     w=self.MenuStack.Top().GetFocus()
  1196.     sw=w.GetFocus()
  1197.     try:
  1198.       sw.SuprMenuItem()
  1199.     except:
  1200.       w.SuprMenuItem()
  1201.  
  1202.  
  1203.   def CommandPrb(self):
  1204.     print "Method CommandPrb"
  1205.  
  1206.   def EndMenu(self):
  1207.     while len(self.MenuStack.Top())>0:
  1208.       self.DeActivateMenuItem()
  1209.  
  1210. #class B_MenuItemLogo(BUIx.B_FrameWidget,MenuWidget.B_MenuTreeItem):
  1211. #  def __init__(self,Parent,MenuDescr,StackMenu):
  1212. #    BUIx.B_FrameWidget.__init__(self,Parent,MenuDescr["Name"],512,128)
  1213. #    MenuWidget.B_MenuTreeItem.__init__(self,MenuDescr,StackMenu)
  1214.  
  1215. #    self.bm1=BUIx.B_BitmapWidget(Parent,"logobm1",640,480,"Logo1")
  1216. #    self.bm1.SetColor(255,255,255)
  1217. #    self.bm1.SetAlpha(1.0)
  1218.  
  1219.  
  1220. #    self.bm2=BUIx.B_BitmapWidget(Parent,"logobm2",256,128,"Logo2")
  1221. #    self.bm2.SetColor(255,255,255)
  1222. #    self.bm2.SetAlpha(1.0)
  1223.  
  1224. #    self.subbm1=BUIx.B_BitmapWidget(Parent,"sublogobm1",256,128,"LogoSub1")
  1225. #    self.subbm1.SetColor(255,255,255)
  1226. #    self.subbm1.SetAlpha(1.0)
  1227.  
  1228. #    self.subbm2=BUIx.B_BitmapWidget(Parent,"sublogobm2",256,128,"LogoSub2")
  1229. #    self.subbm2.SetColor(255,255,255)
  1230. #    self.subbm2.SetAlpha(1.0)
  1231.  
  1232. #    self.AddWidget(self.bm1,0,0,
  1233. #                   BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,
  1234. #                   BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  1235.  
  1236. #    self.AddWidget(self.bm2,0,0,
  1237. #                   BUIx.B_FrameWidget.B_FR_AbsoluteRight,BUIx.B_FrameWidget.B_FR_Right,
  1238. #                   BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  1239.  
  1240. #    self.AddWidget(self.subbm1,0,0,
  1241. #                   BUIx.B_FrameWidget.B_FR_AbsoluteLeft,BUIx.B_FrameWidget.B_FR_Left,
  1242. #                   BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  1243. #    self.AddWidget(self.subbm2,0,0,
  1244. #                   BUIx.B_FrameWidget.B_FR_AbsoluteRight,BUIx.B_FrameWidget.B_FR_Right,
  1245. #                   BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  1246.  
  1247. #    self.Vid=WidgetsExtra.B_VideoWidget(self,"video logo","..\\..\\Data\\Sangre.avi") #video\\Main.avi)#
  1248.     #self.Vid=WidgetsExtra.B_VideoWidget(self,"video logo","..\\..\\Data\\vid_hom.avi")
  1249.     #print "B_MenuItemLogo.Vid",self.Vid,"with refcount",sys.getrefcount(self.Vid)
  1250. #    self.AddWidget(self.Vid,0.5,1,
  1251. #                   BUIx.B_FrameWidget.B_FR_HRelative,BUIx.B_FrameWidget.B_FR_HCenter,
  1252. #                   BUIx.B_FrameWidget.B_FR_AbsoluteTop,BUIx.B_FrameWidget.B_FR_Top)
  1253.     #print "B_MenuItemLogo.Vid",self.Vid,"with refcount",sys.getrefcount(self.Vid)
  1254. #    self.thisown=1
  1255.  
  1256.  
  1257. #  def AcceptsFocus(self):
  1258. #    return 0
  1259.  
  1260. #  def __del__(self):
  1261. #    BUIx.B_FrameWidget.__del__(self)
  1262. #    MenuWidget.B_MenuTreeItem.__del__(self)
  1263. #    #print "B_MenuItemLogo.Vid",self.Vid,"with refcount",sys.getrefcount(self.Vid)
  1264. #    self.Vid.SetDrawFunc(None)  #Parche, si no no se llama a __del__()
  1265. #    #print "B_MenuItemLogo.Vid (DrawFunc -> None)",self.Vid,"with refcount",sys.getrefcount(self.Vid)
  1266. #    self.Vid=None
  1267. #    #print "B_MenuItemLogo.__del__()"
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277.  
  1278.  
  1279. CtrlsPosition=(70, BUIx.B_FrameWidget.B_FR_AbsoluteLeft, BUIx.B_FrameWidget.B_FR_Left)
  1280. if netgame.GetNetState() == 0:
  1281.   def AuxCtrlDef(action_menu_name,action_name,kFlags):
  1282.     return  {"Name":MenuText.GetMenuText(action_menu_name),
  1283.              "Position" :CtrlsPosition,
  1284.              "Action"   :action_name,
  1285.              "Kind"     :KeybWidget.ControlMenuItem,
  1286.              "Command"  :KeybWidget.ControlMenuItem.BeginDefineKey,
  1287.              "kFlags"   :kFlags,
  1288.              "Size"        :(200,300)
  1289.             }
  1290.   KeybActions=[]
  1291.   for k in acts.ConfigurableActions:
  1292.     KeybActions.append(AuxCtrlDef(k[0],k[1],k[2]))
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301. #LogoItem={"Name":"Logo",
  1302. #          "VSep":50,
  1303. #          "Kind":B_MenuItemLogo
  1304. #         }
  1305.  
  1306.  
  1307.  
  1308.  
  1309. #OpenGLOptions=[{"Name":MenuText.GetMenuText("Screen Mode"),
  1310. #                "VSep":30,
  1311. #                "Kind":MenuWidget.B_MenuItemOption,
  1312. #                "Options":[MenuText.GetMenuText("Full Screen"),MenuText.GetMenuText("Windowed")],
  1313. #                "Command":SetFullScreenMode,
  1314. #                "SelOptionFunc":FullScreenModeSettings
  1315. #               },
  1316. #               {"Name":MenuText.GetMenuText("OpenGL 2")}
  1317. #              ]
  1318.  
  1319.  
  1320. def GoTo2d(menu_class):
  1321.     import GotoMapVars
  1322.     GotoMapVars.EndOfLevel()
  1323.  
  1324.  
  1325. vsepexit=200-int(46*((600-Raster.GetSize()[1])/120))
  1326.  
  1327. if Reference.DEMO_MODE:
  1328.     QuitMenu  =            {"VSep":30,
  1329.                             "Name"     :MenuText.GetMenuText("Exit"),
  1330.                             "Font"     :MenuFontBig,
  1331.                             "iFocus"   :2,
  1332.                             "ListDescr":[ {"Name":MenuText.GetMenuText("Exit, Are you sure?"),
  1333.                                            "VSep":vsepexit,
  1334.                                            "Font":MenuFontBig,
  1335.                                            "Kind":MenuWidget.B_MenuItemTextNoFXNoFocus
  1336.                                           },
  1337.                                           {"Name":MenuText.GetMenuText("Yes"),
  1338.                                            "VSep":20,
  1339.                                            "Font":MenuFontMed,
  1340.                                            "ListDescr":[ {"Name":"Features",
  1341.                                                           "Kind":MenuWidget.B_BackFeatures
  1342.                                                          },
  1343.                                                          {"Name":" "},                                                     
  1344.                                                        ]
  1345.                                           },
  1346.                                           {"Name":MenuText.GetMenuText("No"),
  1347.                                            "VSep":10,
  1348.                                            "Font":MenuFontMed,
  1349.                                            "Command":BackMenu
  1350.                                           },
  1351.                                           {"Name":"Back",
  1352.                                            "Kind":MenuWidget.B_BackBlank
  1353.                                           }
  1354.                                         ]
  1355.                            }
  1356.  
  1357. else:
  1358.     QuitMenu  =            {"VSep":30,
  1359.                             "Name"     :MenuText.GetMenuText("Exit"),
  1360.                             "Font"     :MenuFontBig,
  1361.                             "iFocus"   :1,
  1362.                             "ListDescr":[ {"Name":MenuText.GetMenuText("Exit, Are you sure?"),
  1363.                                            "VSep":vsepexit,
  1364.                                            "Font":MenuFontBig,
  1365.                                            "Kind":MenuWidget.B_MenuItemTextNoFXNoFocus
  1366.                                           },
  1367.                                           {"Name":MenuText.GetMenuText("Yes"),
  1368.                                            "VSep":20,
  1369.                                            "Command":CmdQuit,
  1370.                                            "Font":MenuFontMed
  1371.                                           },
  1372.                                           {"Name":MenuText.GetMenuText("No"),
  1373.                                            "VSep":10,
  1374.                                            "Font":MenuFontMed,
  1375.                                            "Command":BackMenu
  1376.                                           },
  1377.                                           {"Name":"Back",
  1378.                                            "Kind":MenuWidget.B_BackBlank
  1379.                                           }
  1380.                                         ]
  1381.                            }
  1382.  
  1383. PlayerConfigMenu=[
  1384.                   {"Name":MenuText.GetMenuText("Name:"),
  1385.                    "VSep":30,
  1386.                    "Kind":netwidgets.B_InputBox,
  1387.                    "MaxSize":16,
  1388.                    "GetInput":NetMisc.GetPlayerName,
  1389.                    "SetInput":NetMisc.SetPlayerName
  1390.                   },
  1391.                   {"Name":MenuText.GetMenuText("Character:"),
  1392.                    "Font":MenuFontMed,
  1393.                    "Kind":MenuWidget.B_MenuItemOption,
  1394.                    "Options":[MenuText.GetMenuText("Knight"),MenuText.GetMenuText("Barbarian"),MenuText.GetMenuText("Dwarf"),MenuText.GetMenuText("Amazon")],
  1395.                    "SelOptionFunc":NetMisc.GetCharType,
  1396.                    "Command":NetMisc.SetCharType
  1397.                   },
  1398.                   {"Name":"Lista de jugadores",
  1399.                    "Kind":netwidgets.B_ImageListWidget,
  1400.                    "ImageList":NetMisc.CharBitmaps,
  1401.                    "GetCharType":NetMisc.GetCharStatus,
  1402.                    "VSep":30
  1403.                   },
  1404.                   {"Name":MenuText.GetMenuText("Next Skin"),
  1405.                    "VSep":30,
  1406.                    "Command":NetMisc.NextSkin
  1407.                   },
  1408.                   {"Name":MenuText.GetMenuText("Handicap:"),
  1409.                    "Kind":MenuWidget.B_MenuSpin,
  1410.                    "SpinValues":(1,4,3),
  1411.                    "SpinGetValue":NetMisc.GetHandicap,
  1412.                    "SpinSetValueEnd":NetMisc.SetHandicap
  1413.                   },
  1414.                   {"Name":MenuText.GetMenuText("Save"),
  1415.                    "Command":NetMisc.SavePlayerConfiguration
  1416.                   },
  1417.                   {"Name":"Back",
  1418.                    "Kind":MenuWidget.B_BackBlank
  1419.                   }                  
  1420.                  ]
  1421.  
  1422. def MapLoading(option):
  1423.     global Character
  1424.     if Character == 0:
  1425.         Bladex.LoadLevel("Ruins_M4")
  1426.     if Character == 1:
  1427.         Bladex.LoadLevel("Barb_M1")
  1428.     if Character == 2:
  1429.         Bladex.LoadLevel("Ragnar_M2")
  1430.     if Character == 3:
  1431.         Bladex.LoadLevel("Dwarf_M3")
  1432.  
  1433. TutGameChoosing = {"Name":"TopMenu",
  1434.          "Kind":MenuWidget.B_MenuItemTextNoFX,
  1435.          "ListDescr":[ {"Name":MenuText.GetMenuText("Enter Tutorial"),
  1436.                         "VSep":250,
  1437.                         "Font":MenuFontBig,
  1438.                         "Command":LoadTutorial
  1439.                        },
  1440.                        {"Name":MenuText.GetMenuText("Continue"),
  1441.                         "Font":MenuFontBig,
  1442.                         "Command":MapLoading
  1443.                        },
  1444.                        BackOption,
  1445.                        {"Name":"Back",
  1446.                         "Kind":MenuWidget.B_BackImageWidget
  1447.                        }
  1448.                      ]
  1449.         }
  1450.  
  1451. NormalMenu = 1
  1452.  
  1453. def SwitchCasaByGlobalMenu():
  1454.     global Desc1
  1455.     global TutGameChoosing
  1456.     
  1457.     DescAux = Desc1
  1458.     Desc1 = TutGameChoosing
  1459.     TutGameChoosing = DescAux
  1460.     DescAux = None
  1461.  
  1462. def SwitchToCasaMenu():
  1463.     global NormalMenu
  1464.     if NormalMenu:
  1465.         NormalMenu = 0
  1466.         SwitchCasaByGlobalMenu()
  1467.         if Reference.DEMO_MODE:
  1468.             GetMenuItem(['Enter Tutorial'])["Kind"] = MenuWidget.B_MenuItemTextNoFXNoFocus
  1469.  
  1470.  
  1471. def SwitchToGlobalMenu():
  1472.     global NormalMenu
  1473.     if not NormalMenu:
  1474.         NormalMenu = 1
  1475.         SwitchCasaByGlobalMenu()
  1476.         
  1477.  
  1478.                  
  1479. if netgame.GetNetState() != 0:
  1480.   PlayerConfigMenu.insert(6,{"Name":MenuText.GetMenuText("This modification will take effect in the next arena"),
  1481.                              "VSep":20,
  1482.                              "Font":MenuFontSmall,
  1483.                              "Kind":MenuWidget.B_MenuItemTextNoFXNoFocus
  1484.                              })
  1485.  
  1486.   Desc1={"Name":"TopMenu",
  1487.          "Kind":MenuWidget.B_MenuItemTextNoFX,
  1488.          "ListDescr":[ {"Name":MenuText.GetMenuText("Disconnect"),
  1489.                         "VSep":220,
  1490.                         "Font":MenuFontBig,
  1491.                         "Command":NetMisc.Disconnect
  1492.                        },
  1493.                        {"Name":MenuText.GetMenuText("Modify Player"),
  1494.                         "Font":MenuFontBig,
  1495.                         "ListDescr":PlayerConfigMenu
  1496.                        }
  1497.                        ,QuitMenu,
  1498.                        {"Name":"Back",
  1499.                         "Kind":MenuWidget.B_BackImageWidget
  1500.                        }
  1501.                      ]
  1502.         }
  1503. else:
  1504.   Desc1={"Name":"TopMenu",
  1505.          "Size":(640,480),
  1506.          "Kind":MenuWidget.B_MenuItemTextNoFX,
  1507.          "ListDescr":[ {"Name":MenuText.GetMenuText("Game"),
  1508.                         "Font":MenuFontBig,
  1509.                         "VSep":200,
  1510.                         "ListDescr":[{
  1511.                                        "Name":MenuText.GetMenuText("Start New Game"),
  1512.                                        "Font":MenuFontBig,
  1513.                                        "VSep":220,
  1514.                                        "Command":LoadPlayerSelect
  1515.                                       },
  1516.                                       {"Name":MenuText.GetMenuText("Save Current"),
  1517.                                        "Font":MenuFontBig,
  1518.                                        #"Kind":MenuWidget.B_VariableFocusTextMenuItem,
  1519.                                        #"Command":SaveGame1
  1520.                                        "ListDescr":[ {"Name"     : MenuText.GetMenuText("Savegame Slot 1:"),
  1521.                                                       "Font":MenuFontBig,
  1522.                                                       "VSep"     : 200,
  1523.                                                       "Command":SaveGame1
  1524.                                                      },
  1525.                                                      {"Name"     : MenuText.GetMenuText("Savegame Slot 2:"),
  1526.                                                       "Font":MenuFontBig,
  1527.                                                       "VSep"     : 20,
  1528.                                                       "Command":SaveGame2
  1529.                                                      },
  1530.                                                      {"Name"     : MenuText.GetMenuText("Savegame Slot 3:"),
  1531.                                                       "Font":MenuFontBig,
  1532.                                                       "VSep"     : 20,
  1533.                                                       "Command":SaveGame3
  1534.                                                      },
  1535.                                                      {"Name"     : MenuText.GetMenuText("Savegame Slot 4:"),
  1536.                                                       "Font":MenuFontBig,
  1537.                                                       "VSep"     : 20,
  1538.                                                       "Command":SaveGame4
  1539.                                                      },
  1540.                                                      {"Name":"Back",
  1541.                                                       "Kind":MenuWidget.B_BackImageWidget
  1542.                                                      }
  1543.                                                    ]
  1544.                                       },
  1545.                                       {"Name":MenuText.GetMenuText("Load Saved"),
  1546.                                        "Font":MenuFontBig,
  1547.                                        "ListDescr":[ {"Name"     : MenuText.GetMenuText("Load Game at Slot 1:"),
  1548.                                                       "Font":MenuFontBig,
  1549.                                                       "VSep"     : 200,
  1550.                                                       "Command":LoadGame
  1551.                                                      },
  1552.                                                      {"Name"     : MenuText.GetMenuText("Load Game at Slot 2:"),
  1553.                                                       "Font":MenuFontBig,
  1554.                                                       "VSep"     : 20,
  1555.                                                       "Command":LoadGame2
  1556.                                                      },
  1557.                                                      {"Name"     : MenuText.GetMenuText("Load Game at Slot 3:"),
  1558.                                                       "Font":MenuFontBig,
  1559.                                                       "VSep"     : 20,
  1560.                                                       "Command":LoadGame3
  1561.                                                      },
  1562.                                                      {"Name"     : MenuText.GetMenuText("Load Game at Slot 4:"),
  1563.                                                       "Font":MenuFontBig,
  1564.                                                       "VSep"     : 20,
  1565.                                                       "Command":LoadGame4
  1566.                                                      },
  1567.                                                      {"Name":"Back",
  1568.                                                       "Kind":MenuWidget.B_BackImageWidget
  1569.                                                      }
  1570.                                                    ]
  1571.  
  1572.                                       },
  1573.                                       {"Name":MenuText.GetMenuText("Arena"),
  1574.                                        "Font":MenuFontBig,
  1575.                                        "VSep":20,
  1576.                                        "ListDescr":[ {"Name":MenuText.GetMenuText("Connection:"),
  1577.                                                       "Font":MenuFontMed,
  1578.                                                       "VSep":250,
  1579.                                                       "Kind":MenuWidget.B_MenuItemOption,
  1580.                                                       "Options":[MenuText.GetMenuText("IPX (Local network)"),MenuText.GetMenuText("TCP/IP (Internet)")],
  1581.                                                       "SelOptionFunc":NetMisc.GetProtocol,
  1582.                                                       "Command":NetMisc.SetProtocol
  1583.                                                      },
  1584.                                                      {"Name":MenuText.GetMenuText("New arena"),
  1585.                                                       "Font":MenuFontBig,
  1586.                                                       "ListDescr":[
  1587.                                                                  {"Name"     : MenuText.GetMenuText("Name:"),
  1588.                                                                     "VSep"     : 20,
  1589.                                                                     "Kind"     : netwidgets.B_InputBox,
  1590.                                                                     "MaxSize"  : 16,
  1591.                                                                     "GetInput" : NetMisc.GetArenaName,
  1592.                                                                     "SetInput" : NetMisc.SetArenaName,
  1593.                                                                    },
  1594.                                                                    {"Name"       : "Lista de mapas",
  1595.                                                                     "Kind"       : netwidgets.B_MapListWidget,                                                                    
  1596.                                                                     "LeftMap"    : "..\\..\\Data\\net\\MapL.bmp",
  1597.                                                                     "RightMap"   : "..\\..\\Data\\net\\MapR.bmp",
  1598.                                                                     "SelMap"     : "..\\..\\Data\\net\\MapM.bmp",
  1599.                                                                     "MarkMap"    : "..\\..\\Data\\net\\MapS.bmp",
  1600.                                                                     "MapGetValue": NetMisc.GetArenaMaps,
  1601.                                                                     "MapSetValue": NetMisc.SetArenaMaps,
  1602.                                                                     "VSep"       : 15
  1603.                                                                    },
  1604.                                                                    {"Name":MenuText.GetMenuText("The bad place"),
  1605.                                                                     "VSep":1,
  1606.                                                                     "Kind":netwidgets.B_DescriptorLabel
  1607.                                                                     },
  1608.                                                                    {"Name":MenuText.GetMenuText("Max players:"),
  1609.                                                                     "Kind":MenuWidget.B_MenuSpin,
  1610.                                                                     "SpinValues":(2,10,8),
  1611.                                                                     "SpinGetValue":NetMisc.GetMaxPlayers,
  1612.                                                                     "SpinSetValueEnd":NetMisc.SetMaxPlayers,
  1613.                                                                     "VSep"       : 30
  1614.                                                                    },
  1615.                                                                    {"Name":MenuText.GetMenuText("Max handicap:"),
  1616.                                                                     "Kind":MenuWidget.B_MenuSpin,
  1617.                                                                     "SpinValues":(1,4,3),
  1618.                                                                     "SpinGetValue":NetMisc.GetArenaHandicap,
  1619.                                                                     "SpinSetValueEnd":NetMisc.SetArenaHandicap
  1620.                                                                    },
  1621.                                                                    {"Name":MenuText.GetMenuText("Packets per second:"),
  1622.                                                                     "Font":MenuFontMed,
  1623.                                                                     "Kind":MenuWidget.B_MenuItemOption,
  1624.                                                                     "Options":[
  1625.                                                                                MenuText.GetMenuText("Variable"),
  1626.                                                                                "10",
  1627.                                                                                "20",
  1628.                                                                                "30",
  1629.                                                                                "40",
  1630.                                                                                "50",
  1631.                                                                                "60"
  1632.                                                                               ],
  1633.                                                                     "SelOptionFunc":NetMisc.GetPPS,
  1634.                                                                     "Command":NetMisc.SetPPS
  1635.                                                                  },
  1636.                                                                    {"Name":MenuText.GetMenuText("Player configuration"),
  1637.                                                                     "ListDescr":PlayerConfigMenu
  1638.                                                                    },
  1639.                                                                    {"Name":MenuText.GetMenuText("Death Limit:"),
  1640.                                                                     "Kind":MenuWidget.B_MenuSpin,
  1641.                                                                     "SpinValues":(1,51,50),
  1642.                                                                     "SpinGetValue":NetMisc.GetFragLimit,
  1643.                                                                     "SpinSetValueEnd":NetMisc.SetFragLimit
  1644.                                                                    },
  1645.                                                                    {"Name":MenuText.GetMenuText("Start"),
  1646.                                                                     "Command":NetMisc.StartServer
  1647.                                                                    },
  1648.                                                                    {"Name":"Back",
  1649.                                                                     "Kind":MenuWidget.B_BackBlank
  1650.                                                                    }
  1651.                                                                   ]
  1652.                                                      },
  1653.                                                      {"Name":MenuText.GetMenuText("Join game"),
  1654.                                                       "Font":MenuFontBig,
  1655.                                                       "ListDescr":[
  1656.                                                                    {"Name"     : MenuText.GetMenuText("Address:"),
  1657.                                                                     "Kind"     : netwidgets.B_InputBox,
  1658.                                                                     "MaxSize"  : 32,
  1659.                                                                     "GetInput" : NetMisc.GetIp,
  1660.                                                                     "SetInput" : NetMisc.SetIp,
  1661.                                                                     "Locked"   : NetMisc.IpLooked,
  1662.                                                                     "VSep"     : 120
  1663.                                                                    },
  1664.                                                                    {
  1665.                                                                     "Name"     : MenuText.GetMenuText("Search"),
  1666.                                                                     "Command"  : NetMisc.BrowseServers
  1667.                                                                    },
  1668.                                                                    {"Name"     : MenuText.GetMenuText("Server's list"),
  1669.                                                                     "Kind"     : netwidgets.B_ServerListWidget,
  1670.                                                                     "Size"     : (610,200),
  1671.                                                                     "ListDescr": []
  1672.                                                                    },
  1673.                                                                    {"Name":MenuText.GetMenuText("Player configuration"),
  1674.                                                                      "ListDescr":PlayerConfigMenu,
  1675.                                                                    },
  1676.                                                                    {"Name":"Back",
  1677.                                                                     "Kind":MenuWidget.B_BackBlank
  1678.                                                                    }
  1679.                                                                   ]
  1680.                                                      },
  1681.                                                      {"Name":MenuText.GetMenuText("Player configuration"),
  1682.                                                       "Font":MenuFontBig,
  1683.                                                       "ListDescr":PlayerConfigMenu
  1684.                                                      },
  1685.                                                      {"Name":"Back",
  1686.                                                       "Kind":MenuWidget.B_BackImageWidget
  1687.                                                      }
  1688.                                                    ]
  1689.                                       },
  1690.                                       BackOption,
  1691.                                       {"Name":"Back",
  1692.                                        "Kind":MenuWidget.B_BackImageWidget
  1693.                                       }
  1694.                                    ]
  1695.                        },
  1696.                        {"Name":MenuText.GetMenuText("Travel Book"),
  1697.                         "Font":MenuFontBig,
  1698.                         "Command":ExecTravelBook
  1699.                        },
  1700.                        {"Name":MenuText.GetMenuText("Options"),
  1701.                         "Font":MenuFontBig,
  1702.                         "ListDescr":[
  1703.                                      {"Name":MenuText.GetMenuText("Video"),
  1704.                                       "VSep":230,
  1705.                                       "Font":MenuFontBig,
  1706.                                       "ListDescr":[
  1707.                                                    {"Name":MenuText.GetMenuText("Gamma Level"),
  1708.                                                     "VSep":240,
  1709.                                                     "Font":MenuFontMed,
  1710.                                                     "Kind":MenuWidget.B_MenuSpin,
  1711.                                                     "SpinValues":(0.0,1.0,20),
  1712.                                                     "SpinGetValue":GetGammaValue,
  1713.                                                     "SpinOnChange":SetGammaValue,
  1714.                                                     "SpinSetValue":SetGammaValue,
  1715.                                                    },
  1716.                                                    {"Name":MenuText.GetMenuText("Contrast Level"),
  1717.                                                     "VSep":15,
  1718.                                                     "Font":MenuFontMed,
  1719.                                                     "Kind":MenuWidget.B_MenuSpin,
  1720.                                                     "SpinValues":(0.5,4.0,35),
  1721.                                                     "SpinGetValue":GetContrastValue,
  1722.                                                     "SpinOnChange":SetContrastValue,
  1723.                                                     "SpinSetValue":SetContrastValue,
  1724.                                                    },
  1725.                                                    {"Name":MenuText.GetMenuText("Brightness Level"),
  1726.                                                     "VSep":15,
  1727.                                                     "Font":MenuFontMed,
  1728.                                                     "Kind":MenuWidget.B_MenuSpin,
  1729.                                                     "SpinValues":(0.0,50.0,25),
  1730.                                                     "SpinGetValue":GetBrightnessValue,
  1731.                                                     "SpinOnChange":SetBrightnessValue,
  1732.                                                     "SpinSetValue":SetBrightnessValue,
  1733.                                                    },
  1734.                                                    BackOption,
  1735.                                                    {"Name":"Back",
  1736.                                                     "Kind":MenuWidget.B_BackImageWidget
  1737.                                                    }
  1738.                                                   ]
  1739.                                       },
  1740.                                       {"Name":MenuText.GetMenuText("Sound"),
  1741.                                       "Font":MenuFontBig,
  1742.                                       
  1743.                                       "ListDescr":[
  1744.                                                    {"Name":MenuText.GetMenuText("FX Volume"),
  1745.                                                     "VSep":230,
  1746.                                                     "Font":MenuFontMed,
  1747.                                                     "Kind":MenuWidget.B_MenuSpin,
  1748.                                                     "SpinValues":(int(0),int(10),int(10)),
  1749.                                                     "SpinGetValue":GetSoundValue,
  1750.                                                     "SpinSetValueEnd":SetSoundValue
  1751.                                                    },
  1752.                                                    {"Name":MenuText.GetMenuText("Music Volume"),
  1753.                                                     "VSep": 10,
  1754.                                                     "Font":MenuFontMed,
  1755.                                                     "Kind":MenuWidget.B_MenuSpin,
  1756.                                                     "SpinValues":(int(0),int(10),int(10)),
  1757.                                                     "SpinGetValue":GetMusicValue,
  1758.                                                     "SpinSetValueEnd":SetMusicValue
  1759.                                                    },
  1760.                                                    {"Name":MenuText.GetMenuText("Sound Quality:"),
  1761.                                                     "VSep":10,
  1762.                                                     "Font":MenuFontMed,
  1763.                                                     "Kind":MenuWidget.B_MenuItemOption,
  1764.                                                     "Options":[MenuText.GetMenuText("Low"),MenuText.GetMenuText("Med"),MenuText.GetMenuText("High")],
  1765.                                                     "SelOptionFunc":GetSoundQuality,
  1766.                                                     "Command":SetSoundQuality
  1767.                                                    },
  1768.                                                    {"Name":MenuText.GetMenuText("EAX:"),
  1769.                                                     "VSep":10,
  1770.                                                     "Font":MenuFontMed,
  1771.                                                     "Options":[MenuText.GetMenuText("Disabled"),MenuText.GetMenuText("Enabled")],
  1772.                                                     "Kind":MenuWidget.B_MenuItemOption,
  1773.                                                     "SelOptionFunc":GetEAX,
  1774.                                                     "Command":SetEAX
  1775.                                                    },
  1776.                                                    {"Name":MenuText.GetMenuText("EAX is sound alteration system for improved environment realism"),
  1777.                                                     "VSep":5,
  1778.                                                     "Font": MenuFontSmall,
  1779.                                                     "Kind": MenuWidget.B_MenuItemTextNoFXNoFocus
  1780.                                                    },
  1781.                                                    {"Name":MenuText.GetMenuText("Speaker Configuration:"),
  1782.                                                     "VSep":10,
  1783.                                                     "Font":MenuFontMed,
  1784.                                                     "Options":[MenuText.GetMenuText("Earphones"),MenuText.GetMenuText("2"),MenuText.GetMenuText("2 + Subwoofer"),MenuText.GetMenuText("4")],
  1785.                                                     "Kind":MenuWidget.B_MenuItemOption,
  1786.                                                     "SelOptionFunc":GetSpeakerConfig,
  1787.                                                     "Command":SetSpeakerConfig
  1788.                                                    },
  1789.                                                    BackOption,
  1790.                                                    {"Name":"Back",
  1791.                                                     "Kind":MenuWidget.B_BackImageWidget
  1792.                                                    }
  1793.                                                   ]
  1794.                                      },
  1795.                                      {"Name":MenuText.GetMenuText("Controls"),
  1796.                                       "Font":MenuFontBig,
  1797.                                       "ListDescr":[{"Name":MenuText.GetMenuText("General Actions"),
  1798.                                                     "VSep":230,
  1799.                                                     "Font":MenuFontBig,
  1800.                                                     "ListDescr":[{"Name":MenuText.GetMenuText("Configure Actions"),
  1801.                                                                   "VSep":240,
  1802.                                                                   "Font":MenuFontBig,
  1803.                                                                   "ListDescr":[{"Name":"KeybList",
  1804.                                                                                 "Kind":KeybWidget.B_KeybListWidget,
  1805.                                                                                 "VSep":170,
  1806.                                                                                 "Size":(610,200),
  1807.                                                                                 "ListDescr":KeybActions
  1808.                                                                                },
  1809.                                                                                BackOption,
  1810.                                                                                {"Name":"Back",
  1811.                                                                                 "Kind":MenuWidget.B_BackImageWidget
  1812.                                                                                }
  1813.                                                                              ]
  1814.                                                                  },
  1815.                                                                  {"Name":MenuText.GetMenuText("Reset"),
  1816.                                                                   "VSep":10,
  1817.                                                                   "Font":MenuFontBig,
  1818.                                                                   "Command": ResetKeyB
  1819.                                                                  },
  1820.                                                                  BackOption,
  1821.                                                                  {"Name":"Back",
  1822.                                                                   "Kind":MenuWidget.B_BackImageWidget
  1823.                                                                  }
  1824.                                                                  ]
  1825.                                                    },
  1826.                                                    {"Name":MenuText.GetMenuText("Mouse"),
  1827.                                                     "Font":MenuFontBig,
  1828.                                                     "ListDescr":[{"Name":MenuText.GetMenuText("Invert"),
  1829.                                                                   "VSep":250,
  1830.                                                                   "Font":MenuFontMed,
  1831.                                                                   "Kind":MenuWidget.B_MenuItemOption,
  1832.                                                                   "Options":[MenuText.GetMenuText("Yes"),MenuText.GetMenuText("No")],
  1833.                                                                   "SelOptionFunc":GetMouseInvert,
  1834.                                                                   "Command": SetMouseInvert
  1835.                                                                   },
  1836.                                                                  {"Name":MenuText.GetMenuText("X Speed"),
  1837.                                                                   "Font":MenuFontMed,
  1838.                                                                   "Kind":MenuWidget.B_MenuSpin,
  1839.                                                                   "SpinValues":(int(0),int(10),int(10)),
  1840.                                                                   "SpinGetValue":GetMouseXSens,
  1841.                                                                   "SpinSetValueEnd":SetMouseXSens
  1842.                                                                   },
  1843.                                                                  {"Name":MenuText.GetMenuText("Y Speed"),
  1844.                                                                   "Font":MenuFontMed,
  1845.                                                                   "Kind":MenuWidget.B_MenuSpin,
  1846.                                                                   "SpinValues":(int(0),int(10),int(10)),
  1847.                                                                   "SpinGetValue":GetMouseYSens,
  1848.                                                                   "SpinSetValueEnd":SetMouseYSens
  1849.                                                                   },
  1850.                                                                   BackOption,
  1851.                                                                  {"Name":"Back",
  1852.                                                                   "Kind":MenuWidget.B_BackImageWidget
  1853.                                                                  }
  1854.                                                                  ]
  1855.                                                    },
  1856.                                                    {"Name":MenuText.GetMenuText("(Gamepad)"),
  1857.                                                     "Font":MenuFontBig,
  1858.                                                     "ListDescr":[{"Name":MenuText.GetMenuText("Invert"),
  1859.                                                                   "VSep":250,
  1860.                                                                   "Font":MenuFontMed,
  1861.                                                                   "Kind":MenuWidget.B_MenuItemOption,
  1862.                                                                   "Options":[MenuText.GetMenuText("Yes"),MenuText.GetMenuText("No")],
  1863.                                                                   "SelOptionFunc":GetMouseInvert,
  1864.                                                                   "Command": SetMouseInvert
  1865.                                                                   },
  1866.                                                                  {"Name":MenuText.GetMenuText("X Speed"),
  1867.                                                                   "Font":MenuFontMed,
  1868.                                                                   "Kind":MenuWidget.B_MenuSpin,
  1869.                                                                   "SpinValues":(int(0),int(10),int(10)),
  1870.                                                                   "SpinGetValue":GetMouseXSens,
  1871.                                                                   "SpinSetValueEnd":SetMouseXSens
  1872.                                                                   },
  1873.                                                                  {"Name":MenuText.GetMenuText("Y Speed"),
  1874.                                                                   "Font":MenuFontMed,
  1875.                                                                   "Kind":MenuWidget.B_MenuSpin,
  1876.                                                                   "SpinValues":(int(0),int(10),int(10)),
  1877.                                                                   "SpinGetValue":GetMouseYSens,
  1878.                                                                   "SpinSetValueEnd":SetMouseYSens
  1879.                                                                   },
  1880.                                                                   BackOption,
  1881.                                                                  {"Name":"Back",
  1882.                                                                   "Kind":MenuWidget.B_BackImageWidget
  1883.                                                                  }
  1884.                                                                  ]
  1885.                                                    },
  1886.                                                    BackOption,
  1887.                                                    {"Name":"Back",
  1888.                                                     "Kind":MenuWidget.B_BackImageWidget
  1889.                                                    }
  1890.                                                   ]
  1891.                                      },
  1892.                                      {"Name":MenuText.GetMenuText("Game Options"),
  1893.                                       "Font":MenuFontBig,
  1894.                                       "ListDescr":[{"Name":MenuText.GetMenuText("Auto-Facing:"),
  1895.                                                     "VSep":240,
  1896.                                                     "Font":MenuFontMed,
  1897.                                                     "Kind":MenuWidget.B_MenuItemOption,
  1898.                                                     "Options":[MenuText.GetMenuText("No"),MenuText.GetMenuText("Yes")],
  1899.                                                     "Command": SetFacing,
  1900.                                                     "SelOptionFunc":GetFacing
  1901.                                                    },
  1902.                                                    {"Name":MenuText.GetMenuText("De-Facing Time"),
  1903.                                                     "Kind":MenuWidget.B_MenuSpin,
  1904.                                                     "SpinValues":(int(1),int(30),int(29)),
  1905.                                                     "SpinGetValue":GetDeFacingValue,
  1906.                                                     "SpinSetValueEnd":SetDeFacingValue
  1907.                                                    },
  1908.                                                    {"Name":MenuText.GetMenuText("Character Shadows:"),
  1909.                                                     "VSep":15,
  1910.                                                     "Font":MenuFontMed,
  1911.                                                     "Kind":MenuWidget.B_MenuItemOption,
  1912.                                                     "Options":[MenuText.GetMenuText("Yes"),MenuText.GetMenuText("No")],
  1913.                                                     "SelOptionFunc":ShadowsSettings,
  1914.                                                     "Command":SetShadows
  1915.                                                    },
  1916.                                                    #{"Name":MenuText.GetMenuText("On-Screen Info:"),
  1917.                                                    #"Font":MenuFontMed,
  1918.                                                    #"VSep":15,
  1919.                                                    #"Kind":MenuWidget.B_MenuItemOption,
  1920.                                                    #"Options":[MenuText.GetMenuText("Full"),MenuText.GetMenuText("Auto")],
  1921.                                                    #"SelOptionFunc":CurrentScorer,
  1922.                                                    #"Command":SetScorer
  1923.                                                    #},
  1924.                                                    #{"Name":MenuText.GetMenuText("Detail Level:"),
  1925.                                                    #"Font":MenuFontBig,
  1926.                                                    #"Kind":MenuWidget.B_MenuItemOption,
  1927.                                                    #"Options":[MenuText.GetMenuText("High"),MenuText.GetMenuText("Med"),MenuText.GetMenuText("Low")],
  1928.                                                    #"Command":OptionCommandPrb
  1929.                                                    #},
  1930.                                                    {"Name":MenuText.GetMenuText("Gore"),
  1931.                                                     "Font":MenuFontMed,
  1932.                                                     "VSep":30,
  1933.                                                     "ListDescr":[
  1934.                                                                  {"Name":MenuText.GetMenuText("Parental Lock"),
  1935.                                                                   "Font":MenuFontBig,
  1936.                                                                   "VSep":250,
  1937.                                                                   "ListDescr":[{ "Name"        : MenuText.GetMenuText("Password:"),
  1938.                                                                                  "VSep"        : 200,
  1939.                                                                                  "Kind"        : netwidgets.B_InputBox,
  1940.                                                                                  "MaxSize"     : 8,
  1941.                                                                                  "GetInput"    : Empty,
  1942.                                                                                  "SetInput"    : SetPass,
  1943.                                                                                  "PasswordChar": "#",
  1944.                                                                                },
  1945.                                                                                {"Name":MenuText.GetMenuText("Change Password"),
  1946.                                                                                 "ListDescr":[{"Name":MenuText.GetMenuText("Change Password"),
  1947.                                                                                               "VSep":200,
  1948.                                                                                               "Font":MenuFontBig,
  1949.                                                                                               "Kind":MenuWidget.B_MenuItemTextNoFXNoFocus
  1950.                                                                                              },                                                                   
  1951.                                                                                              {"Name"        : MenuText.GetMenuText("Current Password:"),
  1952.                                                                                               "Kind"        : netwidgets.B_InputBox,
  1953.                                                                                               "MaxSize"     : 8,
  1954.                                                                                               "GetInput"    : Empty,
  1955.                                                                                               "SetInput"    : SetPass,
  1956.                                                                                               "PasswordChar": "#",
  1957.                                                                                               "VSep":20,                                                                                 
  1958.                                                                                              },
  1959.                                                                                              {"Name"        : MenuText.GetMenuText("New Password:"),
  1960.                                                                                               "Kind"        : netwidgets.B_InputBox,
  1961.                                                                                               "MaxSize"     : 8,
  1962.                                                                                               "GetInput"    : Empty,
  1963.                                                                                               "SetInput"    : SetNewPass,
  1964.                                                                                               "PasswordChar": "#",
  1965.                                                                                              },
  1966.                                                                                              {"Name"        : MenuText.GetMenuText("Confirm New Password:"),
  1967.                                                                                               "Kind"        : netwidgets.B_InputBox,
  1968.                                                                                               "MaxSize"     : 8,
  1969.                                                                                               "GetInput"    : Empty,
  1970.                                                                                               "SetInput"    : SetConfNewPass,
  1971.                                                                                               "PasswordChar": "#",
  1972.                                                                                              },
  1973.                                                                                              {"Name"        : MenuText.GetMenuText("OK"),
  1974.                                                                                               "Command"     : SavePassword,
  1975.                                                                                               "VSep"        : 40,
  1976.                                                                                              },                                                                                             
  1977.                                                                                              {"Name":"Back",
  1978.                                                                                               "Kind":MenuWidget.B_BackBlank
  1979.                                                                                              }
  1980.  
  1981.                                                                                             ]
  1982.                                                                                 },
  1983.                                                                                 BackOption,
  1984.                                                                                 {"Name":"Back",
  1985.                                                                                  "Kind":MenuWidget.B_BackBlank
  1986.                                                                                 }
  1987.                                                                                ]
  1988.                                                                   },
  1989.                                                                   {"VSep":20,
  1990.                                                                    "Name":MenuText.GetMenuText("Blood:"),
  1991.                                                                    "Font":MenuFontBig,
  1992.                                                                    "Kind":MenuWidget.B_MenuItemOption,
  1993.                                                                    "Options":[MenuText.GetMenuText("Yes"),MenuText.GetMenuText("No")],
  1994.                                                                    "Command":SetBlood,
  1995.                                                                    "SelOptionFunc":BloodSettings,
  1996.                                                                    "CheckPass" : CheckGorePassWord
  1997.                                                                   },
  1998.                                                                   {"Name":MenuText.GetMenuText("Mutilations:"),
  1999.                                                                    "Font":MenuFontBig,
  2000.                                                                    "Kind":MenuWidget.B_MenuItemOption,
  2001.                                                                    "Options":[MenuText.GetMenuText("Yes"),MenuText.GetMenuText("No")],
  2002.                                                                    "Command":SetMutilation,
  2003.                                                                    "SelOptionFunc":MutilationSettings,
  2004.                                                                    "CheckPass" : CheckGorePassWord
  2005.                                                                   },
  2006.                                                                   BackOption,
  2007.                                                                   {"Name":"Back",
  2008.                                                                    "Kind":MenuWidget.B_BackImageWidget
  2009.                                                                   }
  2010.                                                                 ]
  2011.                                                    },
  2012.                                                    BackOption,
  2013.                                                    {"Name":"Back",
  2014.                                                     "Kind":MenuWidget.B_BackImageWidget
  2015.                                                    }
  2016.                                                    #{"Name":MenuText.GetMenuText("Gamma Correction"),
  2017.                                                    # "Font":MenuFontMed,
  2018.                                                    # "Kind":MenuWidget.B_MenuSpin,
  2019.                                                    # "SpinValues":(-30,70,10),
  2020.                                                    # "SpinGetValue":GetGammaValue,
  2021.                                                    # "SpinSetValueEnd":SetGammaValue,
  2022.                                                    # "Size":(240,19)
  2023.                                                    #}
  2024.                                                   ]
  2025.                                      },
  2026.                                      BackOption,
  2027.                                      {"Name":"Back",
  2028.                                       "Kind":MenuWidget.B_BackImageWidget
  2029.                                      }
  2030.                                     ]
  2031.   
  2032.                        },
  2033.                        {"Name":MenuText.GetMenuText("Credits"),
  2034.                         "Font":MenuFontBig,
  2035.                         "ListDescr":[ {"Name":MenuText.GetMenuText("Sub SubMenu51")},
  2036.                                       {"Name":MenuText.GetMenuText("Sub SubMenu52")}
  2037.                                     ]
  2038.                        },
  2039.                        QuitMenu,
  2040.                        {"Name":"Back",
  2041.                         "Kind":MenuWidget.B_BackImageWidget
  2042.                        }
  2043.                      ]
  2044.         }
  2045.   ########## RODRIGO!! AQUI ESTA COMO SE HACE    
  2046.   if "Casa" != Bladex.GetCurrentMap():
  2047.     Desc1["ListDescr"].insert(1,
  2048.                                            {"Name":MenuText.GetMenuText("Back To Game"),
  2049.                                             "Font":MenuFontBig,
  2050.                                             "Command":BackMenu,
  2051.                                            })
  2052.     ########## ENJOY! 
  2053.  
  2054.  
  2055.  
  2056. def BackMap():
  2057.     Desc1["ListDescr"].insert(len(Desc1["ListDescr"])-1,
  2058.                                          {"Name":MenuText.GetMenuText("Leave Rune Quest"),
  2059.                                           "Font":MenuFontBig,
  2060.                                           "Command":GoTo2d,
  2061.                                           "VSep":20,
  2062.                                          })
  2063.  
  2064. # Xample by Dario and co
  2065. #    Menu.GetMenuItem(['Game','Save Current'])["Kind"] = MenuWidget.B_MenuItemTextNoFocus
  2066. #    Menu.GetMenuItem(['Options','Game Options','Gore','Password:'])
  2067. def GetMenuItem(way):
  2068.     global Desc1
  2069.  
  2070.     idx          = 0
  2071.     continueflag = 1
  2072.     MenuLevel    = Desc1
  2073.     ReturnValue  = 1
  2074.  
  2075.     while(continueflag):
  2076.         continueflag = 0
  2077.         for val in MenuLevel["ListDescr"]:
  2078.             if val.has_key("Name"):
  2079.                 print "see",val["Name"]
  2080.                 if MenuText.GetInverseMenuText(val["Name"])==way[idx]:
  2081.                     idx = idx + 1
  2082.                     if len(way)==idx:
  2083.                         ReturnValue = val
  2084.                         
  2085.                     else:
  2086.                         if val.has_key("ListDescr"):
  2087.                             continueflag = 1
  2088.                             MenuLevel = val
  2089.                             print "Searching at",val["Name"]
  2090.                             
  2091.                         else:
  2092.                             print val["Name"],"is not a list"
  2093.                     break
  2094.     MenuLevel = None
  2095.     return ReturnValue
  2096.  
  2097.  
  2098.  
  2099. def InitMenuKeys():
  2100.     Raster.SetTextMode(3)
  2101.     InputManager=BInput.GetInputManager()
  2102.     InputManager.AddInputActionsSet("MenuRedefine") #Conjunto para cuando se estßn definiendo los controles
  2103.     InputManager.AddInputActionsSet("Menu")
  2104.  
  2105.     oldInputActionsSet=InputManager.GetInputActionsSet()
  2106.  
  2107.     InputManager.SetInputActionsSet("Menu")
  2108.     #Bladex.AddInputAction("Deactivate Menu",0)
  2109.     #Bladex.AssocKey("Deactivate Menu","Keyboard","Esc")
  2110.     #Bladex.AddBoundFunc("Deactivate Menu",ActivateMenu)
  2111.  
  2112.     InputManager.SetInputActionsSet("Default")
  2113.     Bladex.AddInputAction("Activate Menu",0)
  2114.  
  2115.     Bladex.AssocKey("Activate Menu","Keyboard","Esc")
  2116.     Bladex.AddBoundFunc("Activate Menu",PreActivateMenu)
  2117.  
  2118.     InputManager.SetInputActionsSet(oldInputActionsSet)
  2119.     print "Activadas!"
  2120.  
  2121.     if Reference.DEMO_MODE==1:
  2122.         #print "Demo mode was 1!"
  2123.  
  2124.         GetMenuItem(['Travel Book'])["Kind"] = MenuWidget.B_MenuItemTextNoFXNoFocus
  2125.  
  2126.         GetMenuItem(['Credits'])["Kind"] = MenuWidget.B_MenuItemTextNoFXNoFocus
  2127.         del GetMenuItem(['Credits'])["ListDescr"] #xq tienen submenus
  2128.  
  2129.         GetMenuItem(['Game','Save Current'])["Kind"] = MenuWidget.B_MenuItemTextNoFXNoFocus
  2130.         del GetMenuItem(['Game','Save Current'])["ListDescr"] #xq tienen submenus
  2131.  
  2132.         GetMenuItem(['Game','Load Saved'])["Kind"] = MenuWidget.B_MenuItemTextNoFXNoFocus
  2133.         del GetMenuItem(['Game','Load Saved'])["ListDescr"] #xq tienen submenus
  2134.  
  2135.         GetMenuItem(['Game','Arena'])["Kind"] = MenuWidget.B_MenuItemTextNoFXNoFocus
  2136.         del GetMenuItem(['Game','Arena'])["ListDescr"] #xq tienen submenus
  2137.  
  2138.         GetMenuItem(['Options','Controls','(Gamepad)'])["Kind"] = MenuWidget.B_MenuItemTextNoFXNoFocus
  2139.         del GetMenuItem(['Options','Controls','(Gamepad)'])["ListDescr"] #xq tienen submenus
  2140.  
  2141.  
  2142.  
  2143.  
  2144. #InitMenuKeys()
  2145.  
  2146.  
  2147. try:
  2148.   execfile("..\\..\\Scripts\\GameCfg.py")
  2149.   print "Menu.py -> Executed GameCfg.py"
  2150. except:
  2151.   print "Menu.py -> No GameCfg.py found"
  2152.  
  2153.  
  2154.  
  2155. """
  2156. class Listener(BInput.B_InputListener):
  2157.   def __init__(self,name):
  2158.     BInput.B_InputListener.__init__(self,name)
  2159.     #self.SetPythonFunc(self.Prb)
  2160.  
  2161.   def Prb(self,x,y,z):
  2162.     print "Listener::Prb()",x,y,z
  2163.  
  2164.  
  2165. _Listener=Listener("Python Listener 1")
  2166. InputManager=BInput.GetInputManager()
  2167. keyb=InputManager.GetAttachedDevice("Keyboard")
  2168. keyb.AddListener(_Listener)
  2169. """
  2170.  
  2171.