home *** CD-ROM | disk | FTP | other *** search
/ Game.EXE 2001 January / Game.EXE_01_2001.iso / demos / Blade of Darkness / data1.cab / Program_Executable_Files / Scripts / Menu.py < prev    next >
Encoding:
Text File  |  2000-11-16  |  90.9 KB  |  2,272 lines

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