home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 1.5)
-
- import MenuWidget
- import WidgetsExtra
- import Bladex
- import BBLib
- import netgame
- import Raster
- import BIPCx
- import Sounds
- import GotoMapVars
- import acts
- import SaveGame
- import MemPersistence
- if netgame.GetNetState() == 0:
- import KeybWidget
- else:
- import NetScorer
- import Raster
- import BInput
- import BUIx
- import pdb
- import Reference
- import MenuText
- import NetMisc
- import netwidgets
- import os
- MenuFontSmall = '../../Data/Letras menu peq.bmp'
- MenuFontMed = '../../Data/Letras menu med.bmp'
- MenuFontBig = '../../Data/Letras menu gra.bmp'
- Character = -1
- EscapeFunction = None
- SndCorreGema = Bladex.CreateSound('..\\..\\Sounds\\golpe-2.wav', 'Risoto1')
- SndCorreGema.Volume = 0.5
- SndCorreGema.MinDistance = 1000000.0
- SndCorreGema.MaxDistance = 2000000
- SndNewMenu = Bladex.CreateSound('..\\..\\Sounds\\golpe-madera-pesada.wav', 'Risoto2')
- SndNewMenu.Volume = 1.0
- SndNewMenu.MinDistance = 1000000.0
- SndNewMenu.MaxDistance = 2000000
- last_ss_quality = -1
- sound_cfg_changed = 0
-
- def PlaySound(Chound):
- cam = Bladex.GetEntity('Camera')
- Chound.Position = cam.Position
- Chound.Stop()
- Chound.PlaySound(0)
-
-
- def BackMenu(option):
- _MainMenu.DeActivateMenuItem()
-
- BackOption = {
- 'Name': MenuText.GetMenuText('Back'),
- 'VSep': 65,
- 'Command': BackMenu,
- 'Font': MenuFontBig }
-
- def Load2DMap(option):
- Bladex.LoadLevel('2DMap')
-
-
- def LoadPlayerSelect(option):
- global EscapeFunction, EscapeFunction
- if 'Casa' != Bladex.GetCurrentMap():
- MemPersistence.Store('MapAlreadyLoaded', 'pepepotamo')
- Bladex.LoadLevel('Casa')
- else:
- aux = EscapeFunction
- EscapeFunction = None
- _MainMenu.DeActivateMenuItem()
- _MainMenu.DeActivateMenuItem()
- EscapeFunction = aux
- aux = None
- EscapeFunction(1)
-
-
- def LoadTutorial(option):
- Bladex.LoadLevel('Tutorial')
-
-
- def SaveGame1(option):
- Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame1.py');state=None")
-
-
- def SaveGame2(option):
- Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame2.py');state=None")
-
-
- def SaveGame3(option):
- Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame3.py');state=None")
-
-
- def SaveGame4(option):
- Bladex.SetRunString("import GameState;state=GameState.WorldState();state.GetState();state.SaveState('../../Save/SaveGame4.py');state=None")
-
-
- def LoadGameAux(name):
- path = '../../Save/%s_files' % (name,)
- execfile = "execfile('../../Scripts/sys_init.py');execfile('../../Save/%s.py')" % (name,)
- file_data_aux = open('%s/%saux' % (path, 'aux'), 'rt')
- text = file_data_aux.read()
- print text
- file_data_aux.close()
- Bladex.BeginLoadGame()
- Bladex.CloseLevel(execfile, text)
-
-
- def LoadGame(option):
- LoadGameAux('SaveGame1')
-
-
- def LoadGame2(option):
- LoadGameAux('SaveGame2')
-
-
- def LoadGame3(option):
- LoadGameAux('SaveGame3')
-
-
- def LoadGame4(option):
- LoadGameAux('SaveGame4')
-
-
- def CmdQuit(menu_class):
- Bladex.Quit()
-
-
- def CommandPrb(menu_class):
- print 'Hola'
-
-
- def OptionCommandPrb(menu_class, option):
- print 'Received', option
-
-
- def SetOptionCommandPrb():
- return 'Off'
-
-
- def SetFullScreenMode(option):
- print option
- if option == 'Full Screen':
- Raster.SetVideoMode(0)
- else:
- Raster.SetWindowSize(640, 480)
-
-
- def FullScreenModeSettings():
- print 'FullScreenModeSettings'
- if Raster.FullScreen():
- return 0
- else:
- return 1
-
-
- def SetFacing(option):
- if option == 'Yes':
- Bladex.SetAutoEngageCombat(1)
- else:
- Bladex.SetAutoEngageCombat(0)
- SaveConfiguration()
-
-
- def GetFacing():
- return Bladex.GetAutoEngageCombat()
-
-
- def FacingSettings():
- if Bladex.GetAutoEngageCombat():
- return 1
- else:
- return 0
-
- GORE_PASSWORD = ''
- NEW_GORE_PASSWORD = ''
- CONFIRM_GORE_PASSWORD = ''
- CORRECT_GORE_PASSWORD = ''
-
- def LoadPasswordFile():
- global CORRECT_GORE_PASSWORD
- import rotor
-
- try:
- passwordfile = open('..\\..\\Bin\\Password.txt', 'r')
- except:
- return None
-
- encrpass = passwordfile.read()
- passwordfile.close()
- rt = rotor.newrotor('key', 12)
- CORRECT_GORE_PASSWORD = rt.decrypt(encrpass)
- del rt
-
- LoadPasswordFile()
-
- def SavePasswordFile():
- import rotor
- rt = rotor.newrotor('key', 12)
- encrpass = rt.encrypt(CORRECT_GORE_PASSWORD)
- del rt
- passwordfile = open('..\\..\\Bin\\Password.txt', 'w')
- passwordfile.write(encrpass)
- passwordfile.close()
-
-
- def GetMouseInvert():
- MouseData = Bladex.GetMouseState()
- return MouseData[0]
-
-
- def SetMouseInvert(option):
- MouseData = Bladex.GetMouseState()
- if option == 'Yes':
- Bladex.SetMouseState(0, MouseData[1], MouseData[2])
- else:
- Bladex.SetMouseState(1, MouseData[1], MouseData[2])
- KeybWidget.SaveListConfig()
-
-
- def GetMouseXSens():
- MouseData = Bladex.GetMouseState()
- return MouseData[1]
-
-
- def SetMouseXSens(v):
- MouseData = Bladex.GetMouseState()
- Bladex.SetMouseState(MouseData[0], v, MouseData[2])
- KeybWidget.SaveListConfig()
-
-
- def GetMouseYSens():
- MouseData = Bladex.GetMouseState()
- return MouseData[2]
-
-
- def SetMouseYSens(v):
- MouseData = Bladex.GetMouseState()
- Bladex.SetMouseState(MouseData[0], MouseData[1], v)
- KeybWidget.SaveListConfig()
-
-
- def ResetKeyB(option):
- _MainMenu.DeActivateMenuItem()
- acts.ResetDefaultControls()
- if KeybWidget.AdditionalKeysCallBack:
- KeybWidget.AdditionalKeysCallBack()
-
- _MainMenu.ActivateMenuItem()
-
-
- def SetDeFacingValue(v):
- return Bladex.SetAecGap(v)
-
- CurrentScorerVar = 'Full'
-
- def CurrentScorer():
- if CurrentScorerVar == 'Full':
- return 0
-
- if CurrentScorerVar == 'Auto':
- return 1
-
-
-
- def SetScorer(option):
- global CurrentScorerVar
- import Scorer
- if option == 'Full':
- Scorer.PowDefWidgets.Activate()
- Scorer.wKeysFrame.SetVisible(1)
- Scorer.wKeysRFrame.SetVisible(1)
- Scorer.wSpecialsFrame.SetVisible(1)
- Scorer.wEnemiesFrame.SetVisible(1)
- Scorer.wObjectsFrame.SetVisible(1)
- Scorer.wArrowInfo.SetVisible(1)
- elif option == 'Auto':
- Scorer.wLeftHand.SetVisible(0)
- Scorer.wRightHand.SetVisible(0)
- Scorer.PowDefWidgets.Deactivate()
- Scorer.wKeysFrame.SetVisible(0)
- Scorer.wKeysRFrame.SetVisible(0)
- Scorer.wSpecialsFrame.SetVisible(0)
- Scorer.wEnemiesFrame.SetVisible(0)
- Scorer.wObjectsFrame.SetVisible(0)
- Scorer.wArrowInfo.SetVisible(0)
-
- CurrentScorerVar = option
- SaveConfiguration()
-
-
- def CheckGorePassWord():
- print 'Checking Password'
- return CORRECT_GORE_PASSWORD == GORE_PASSWORD
-
-
- def Empty():
- return ''
-
-
- def SetPass(name):
- global GORE_PASSWORD
- GORE_PASSWORD = name
-
-
- def SetNewPass(name):
- global NEW_GORE_PASSWORD
- NEW_GORE_PASSWORD = name
-
-
- def SetConfNewPass(name):
- global CONFIRM_GORE_PASSWORD
- CONFIRM_GORE_PASSWORD = name
-
-
- def SavePassword(xx):
- global CORRECT_GORE_PASSWORD
- if CORRECT_GORE_PASSWORD == GORE_PASSWORD:
- if NEW_GORE_PASSWORD == CONFIRM_GORE_PASSWORD:
- CORRECT_GORE_PASSWORD = NEW_GORE_PASSWORD
- SavePasswordFile()
- _MainMenu.DeActivateMenuItem()
- else:
- print MenuText.GetMenuText('Password confirmation differs')
- else:
- print MenuText.GetMenuText('Wrong password')
-
-
- def SaveConfiguration():
- cfgfile = open('..\\..\\Scripts\\GameCfg.py', 'w')
- cfgfile.write('\n# Configuration settings... be carefull!\n\n\n')
- cfgfile.write('Bladex.SetBloodLevel(' + `Bladex.GetBloodLevel()` + ')\n')
- cfgfile.write('Bladex.SetMutilationLevel(' + `Bladex.GetMutilationLevel()` + ')\n')
- cfgfile.write('Bladex.SetDrawObjectShadows(' + `Bladex.GetDrawObjectShadows()` + ')\n')
- cfgfile.write('Bladex.SetAutoEngageCombat(' + `Bladex.GetAutoEngageCombat()` + ')\n')
- cfgfile.write('Bladex.SetAecGap(' + `Bladex.GetAecGap()` + ')\n')
- cfgfile.write('SetScorer(' + `CurrentScorerVar` + ')\n')
- cfgfile.write('\n# Achalay my brother!.\n\n\n')
- cfgfile.close()
- print 'Game options Saved.'
-
-
- def SetBlood(option):
- if option == 'Yes':
- Bladex.SetBloodLevel(1)
- else:
- Bladex.SetBloodLevel(0)
- SaveConfiguration()
-
-
- def BloodSettings():
- if Bladex.GetBloodLevel():
- return 0
- else:
- return 1
-
-
- def SetMutilation(option):
- if option == 'Yes':
- Bladex.SetMutilationLevel(1)
- else:
- Bladex.SetMutilationLevel(0)
- SaveConfiguration()
-
-
- def MutilationSettings():
- if Bladex.GetMutilationLevel():
- return 0
- else:
- return 1
-
-
- def SetShadows(option):
- if option == 'Yes':
- Bladex.SetDrawObjectShadows(1)
- else:
- Bladex.SetDrawObjectShadows(0)
- SaveConfiguration()
-
-
- def ShadowsSettings():
- if Bladex.GetDrawObjectShadows():
- return 0
- else:
- return 1
-
-
- def GetGammaValue():
- return Raster.GetGammaCorrection()
-
-
- def SetGammaValue(v):
- Raster.SetGammaCorrection(v)
-
-
- def GetBrightnessValue():
- return Raster.GetBrightness()
-
-
- def SetBrightnessValue(v):
- Raster.SetBrightness(v)
-
-
- def GetContrastValue():
- return Raster.GetContrast()
-
-
- def SetContrastValue(v):
- Raster.SetContrast(v)
-
-
- def GetSoundValue():
- return int(10 * Bladex.GetSoundVolume())
-
-
- def SetSoundValue(v):
- global sound_cfg_changed
- sound_cfg_changed = 1
- return Bladex.SetSoundVolume(v * 0.1)
-
-
- def GetMusicValue():
- return int(10 * Bladex.GetMusicVolume())
-
-
- def SetMusicValue(v):
- global sound_cfg_changed
- sound_cfg_changed = 1
- return Bladex.SetMusicVolume(v * 0.1)
-
-
- def GetSoundQuality():
- global last_ss_quality
- last_ss_quality = Bladex.GetSSQuality()
- return Bladex.GetSSQuality()
-
-
- def SetSoundQuality(option):
- global last_ss_quality, last_ss_quality, last_ss_quality
- if option == 'High':
- last_ss_quality = 2
- return 2
-
- if option == 'Med':
- last_ss_quality = 1
- return 1
-
- if option == 'Low':
- last_ss_quality = 0
- return 0
-
-
-
- def GetEAX():
- return Bladex.GetEAXOverride()
-
-
- def SetEAX(option):
- global sound_cfg_changed
- sound_cfg_changed = 1
- if option == 'Enabled':
- Bladex.SetEAXOverride(0)
-
- if option == 'Disabled':
- Bladex.SetEAXOverride(1)
-
-
-
- def GetSpeakerConfig():
- return Bladex.GetSpeakerConfig()
-
-
- def SetSpeakerConfig(option):
- global sound_cfg_changed
- sound_cfg_changed = 1
- if option == '4':
- Bladex.SetSpeakerConfig(3)
- return 3
-
- if option == '2':
- Bladex.SetSpeakerConfig(1)
- return 1
-
- if option == '2 + Subwoofer':
- Bladex.SetSpeakerConfig(2)
- return 2
-
- if option == 'Earphones':
- Bladex.SetSpeakerConfig(0)
- return 0
-
-
-
- def GetDeFacingValue():
- return int(Bladex.GetAecGap())
-
-
- def SetDeFacingValue(v):
- i = Bladex.SetAecGap(v)
- SaveConfiguration()
- return i
-
-
- def ExecTravelBook(menu_class):
- if Reference.DEMO_MODE == 1:
- return None
-
- import Scorer
- Scorer.HideTBS()
- hWnd = Bladex.GetWindowId()
- print 'Executing Travel Book...'
- StatusFile = open('..\\..\\TravelBook\\status.txt', 'w')
- BarbEquipementFile = None
- AmazonEquipementFile = None
- DwarfEquipementFile = None
- KnightEquipementFile = None
- char = Bladex.GetEntity('Player1')
- Inventory = char.GetInventory()
- if char.Kind == 'Barbarian_N':
- StatusFile.write('Barbarian\n')
-
- if char.Kind == 'Amazon_N':
- StatusFile.write('Amazon\n')
-
- if char.Kind == 'Dwarf_N':
- StatusFile.write('Dwarf\n')
-
- if char.Kind == 'Knight_N':
- StatusFile.write('Knight\n')
-
- StatusFile.write('cc\n')
- if Inventory.nTablets > 0:
- StatusFile.write('ch\n')
-
- if len(GotoMapVars.BaList):
- StatusFile.write('ba\n')
-
- StatusFile.close()
- SkillFile = open('..\\..\\TravelBook\\Character Characteristics\\Skills\\Character Skills.txt', 'w')
- list = Bladex.GetCombos('Player1')
- for i in range(len(list)):
- SkillFile.write(list[i][0])
- SkillFile.write('\n')
-
- SkillFile.close()
- BarbEquipementFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Barb\\Carried Equipement.txt', 'w')
- AmazonEquipementFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Amazon\\Carried Equipement.txt', 'w')
- DwarfEquipementFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Dwarf\\Carried Equipement.txt', 'w')
- KnightEquipementFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Knight\\Carried Equipement.txt', 'w')
- BarbShieldsFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Barb\\Carried Shields.txt', 'w')
- AmazonShieldsFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Amazon\\Carried Shields.txt', 'w')
- DwarfShieldsFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Dwarf\\Carried Shields.txt', 'w')
- KnightShieldsFile = open('..\\..\\TravelBook\\Character Characteristics\\Equipement\\Knight\\Carried Shields.txt', 'w')
- KnightWeaps = [
- 'QueenSword',
- 'IceSword',
- 'FireSword',
- 'Gladius',
- 'Orksword',
- 'Espadaelfica',
- 'Espadaromana',
- 'Espadacurva',
- 'Dagesse',
- 'Cimitarra',
- 'EgyptSword',
- 'Espadafilo',
- 'Espada',
- 'Maza',
- 'Maza2',
- 'Maza3']
- DwarfWeaps = [
- 'CrushHammer',
- 'FireAxe',
- 'IceHammer',
- 'Hacha',
- 'Hacha5',
- 'Hacha4',
- 'Hacha3',
- 'Hacha6',
- 'Hacha2',
- 'Garrote',
- 'Martillo',
- 'Martillo2',
- 'Garropin',
- 'MazaDoble',
- 'Garrote2',
- 'Martillo3']
- AmazonWeaps = [
- 'TaiSword',
- 'SteelFeather',
- 'FireBo',
- 'LightEdge',
- 'Ninjato',
- 'HookSword',
- 'Katana',
- 'DoubleSword',
- 'Bo',
- 'Lanza',
- 'Naginata',
- 'Tridente',
- 'Hachacuchilla',
- 'Naginata2',
- 'DeathBo',
- 'CrushBo']
- BarbWeaps = [
- 'FireBigSword',
- 'IceAxe',
- 'DalWeapon',
- 'Sablazo',
- 'Chaosword',
- 'DeathSword',
- 'LongSword',
- 'Alfanje',
- 'BigSword',
- 'SawSword',
- 'FlatSword',
- 'Eclipse',
- 'Guadanya',
- 'Hacha2hojas',
- 'RhinoClub',
- 'Hacharrajada']
- ShowableItems = []
- InventoryList = []
- for i in range(Inventory.nWeapons):
- Weapon = Inventory.GetWeapon(i)
- RootWeapon = Bladex.GetEntity(Weapon)
- InventoryList.append(RootWeapon.Kind)
-
- TakenObjects = char.Data.GetObjectsTaken()
- ItemsFile = open('..\\..\\TravelBook\\Character Characteristics\\Items\\Carried Items.txt', 'w')
- for i in range(Inventory.nKindObjects):
- Object = Inventory.GetObject(i)
- RootObject = Bladex.GetEntity(Object)
- ItemsFile.write(RootObject.Kind)
- ItemsFile.write('\n')
-
- ItemsFile.close()
- for i in TakenObjects:
- pass
-
- WrittenWeapons = []
- for i in range(Inventory.nWeapons):
- Weapon = Inventory.GetWeapon(i)
- RootWeapon = Bladex.GetEntity(Weapon)
-
- WrittenShields = []
- for i in range(Inventory.nShields):
- Shield = Inventory.GetShield(i)
- RootShield = Bladex.GetEntity(Shield)
-
- Shield = [
- 'Escudo1',
- 'Escudo2',
- 'Escudo3',
- 'Escudo4',
- 'Escudo5',
- 'Escudo6',
- 'Escudo7',
- 'Escudo8',
- 'Escudo9',
- 'Escudon',
- 'VampShield',
- 'DalShield',
- 'KingShield']
- for Obj in TakenObjects:
- pass
-
- BarbEquipementFile.close()
- AmazonEquipementFile.close()
- DwarfEquipementFile.close()
- KnightEquipementFile.close()
- BarbShieldsFile.close()
- AmazonShieldsFile.close()
- DwarfShieldsFile.close()
- KnightShieldsFile.close()
- count = 1
- for imapa in range(len(GotoMapVars.MText)):
- MFile = open('..\\..\\TravelBook\\Kingdom History\\M' + `imapa + 1` + '.txt', 'w')
- for texto in GotoMapVars.MText[imapa]:
- MFile.write('.htm')
- MFile.write('\n')
-
- MFile.close()
-
- count = 1
- MFile = open('..\\..\\TravelBook\\Creation History\\status.txt', 'w')
- for imapa in range(len(GotoMapVars.MText)):
- for texto in GotoMapVars.MText[imapa]:
- pass
-
-
- MFile.close()
- MFile = open('..\\..\\TravelBook\\The Blade Athem\\status.txt', 'w')
- for mapp in GotoMapVars.BaList:
- MFile.write(mapp)
- MFile.write('\n')
-
- MFile.close()
- Bladex.SetInputMode('Mouse', 'UNACQUIRE')
- Bladex.SetInputMode('Keyboard', 'UNACQUIRE')
- BIPCx.CreateNewProcess('..\\..\\TravelBook\\BladeTBW.exe', hWnd)
- BIPCx.CreateNewProcess('..\\..\\TravelBook\\TravelBook.exe', hWnd)
- print 'Waiting...'
- print BIPCx.WaitCommand()
- Bladex.SetInputMode('Mouse', 'ACQUIRE')
- Bladex.SetInputMode('Keyboard', 'ACQUIRE')
-
- _MainMenu = None
-
- def ActivateMenu():
- global _MainMenu
-
- try:
- AppMode = Bladex.GetAppMode()
- except x:
- print 'Error getting AppMode', x
-
- if AppMode == 'Game' or AppMode == 'Demo':
- if AppMode == 'Demo':
- import Demo_Stuff
- if Demo_Stuff.demo_is_active == 1:
- print 'ERROR - Menu.ActivateMenu()'
- print 'Fix with a path but should NOT happen!!!'
- Demo_Stuff.DemoLoop()
- return None
-
-
- _MainMenu = MainMenu('Menu Principal', Desc1)
- NetMisc.SetMainMenu(_MainMenu)
- _MainMenu.MenuStack.Push(_MainMenu.wMenu)
- InputManager = BInput.GetInputManager()
- oldInputActionsSet = InputManager.GetInputActionsSet()
- InputManager.SetInputActionsSet('Menu')
- Bladex.AddInputAction('Menu Next', 0)
- Bladex.AddInputAction('Menu Prev', 0)
- Bladex.AddInputAction('Menu Inc', 0)
- Bladex.AddInputAction('Menu Dec', 0)
- Bladex.AddInputAction('Menu ActivateItem', 0)
- Bladex.AddInputAction('Menu DeActivateItem', 0)
- Bladex.AddInputAction('Menu Supr', 0)
- Bladex.AddInputAction('Menu Next Strong', 0)
- Bladex.AssocKey('Menu Next', 'Keyboard', 'Down')
- Bladex.AddBoundFunc('Menu Next', _MainMenu.MenuNextItem)
- Bladex.AssocKey('Menu Prev', 'Keyboard', 'Up')
- Bladex.AddBoundFunc('Menu Prev', _MainMenu.MenuPrevItem)
- Bladex.AssocKey('Menu Inc', 'Keyboard', 'Right')
- Bladex.AddBoundFunc('Menu Inc', _MainMenu.MenuIncItem)
- Bladex.AssocKey('Menu Dec', 'Keyboard', 'Left')
- Bladex.AddBoundFunc('Menu Dec', _MainMenu.MenuDecItem)
- Bladex.AssocKey('Menu Supr', 'Keyboard', 'Delete')
- Bladex.AddBoundFunc('Menu Supr', _MainMenu.MenuSuprItem)
- Bladex.AssocKey('Menu ActivateItem', 'Keyboard', 'Enter')
- Bladex.AddBoundFunc('Menu ActivateItem', _MainMenu.ActivateMenuItem)
- Bladex.AssocKey('Menu DeActivateItem', 'Keyboard', 'Esc')
- Bladex.AddBoundFunc('Menu DeActivateItem', _MainMenu.DeActivateMenuItem)
- Bladex.AssocKey('Menu Next Strong', 'Keyboard', 'Tab')
- Bladex.AddBoundFunc('Menu Next Strong', _MainMenu.MenuNextItemStrong)
- InputManager = BInput.GetInputManager()
- InputManager.SetInputActionsSet('Menu')
- if Reference.DEMO_MODE == 0:
- SaveGame.CreateSaveMenu()
-
- elif AppMode == 'Menu':
- Bladex.AddScheduledFunc(Bladex.GetTime(), ClearMenuKeyb, ())
- Bladex.SetAppMode('Game')
- if netgame.GetNetState() == 0:
- import Scorer
- Scorer.ActivateScorer()
- else:
- NetScorer.ActivateScorer()
- Raster.SetTextMode(3)
- else:
- print 'Invalid AppMode'
- print 'End ActivateMenu()'
-
-
- def PreActivateMenu():
- Bladex.AddScheduledFunc(Bladex.GetTime(), ActivateMenu, (), 'ActivateMenu')
-
-
- def ClearMenuKeyb():
- global _MainMenu
- InputManager = BInput.GetInputManager()
- InputManager.SetInputActionsSet('Menu')
- Bladex.RemoveInputAction('Menu Next')
- Bladex.RemoveInputAction('Menu Prev')
- Bladex.RemoveInputAction('Menu Inc')
- Bladex.RemoveInputAction('Menu Dec')
- Bladex.RemoveInputAction('Menu ActivateItem')
- Bladex.RemoveInputAction('Menu DeActivateItem')
- Bladex.RemoveInputAction('Menu Supr')
- Bladex.RemoveInputAction('Menu Next Strong')
- _MainMenu = None
- InputManager.SetInputActionsSet('Default')
-
- wNULL_MenuParent = BUIx.CreateNULLWidget()
-
- class MainMenu:
-
- def __init__(self, Name, MenuDescription):
- self.Name = Name
- self.MenuDescription = MenuDescription
- self.MenuStack = MenuWidget.MenuStack(ActivateMenu)
- self.wMenu = MenuWidget.B_MenuTree(wNULL_MenuParent, self.MenuDescription, self.MenuStack)
- self.wMenu.SetAutoScale(1)
-
-
- def __del__(self):
- self.MenuStack.Reset()
- self.MenuStack = None
- self.wMenu = None
-
-
- def ActivateMenuItem(self):
- if Bladex.GetAppMode() == 'Menu':
- wActiveMenuElement = self.MenuStack.Top().GetFocus()
-
- try:
- sw = wActiveMenuElement.GetFocus()
- sw.ActivateItem(1)
- except:
- wActiveMenuElement.ActivateItem(1)
-
- SndNewMenu.PlayStereo()
-
-
-
- def DeActivateMenuItem(self):
- global sound_cfg_changed
- if Bladex.GetAppMode() == 'Menu':
- if self.MenuStack.nItems() == 1 and EscapeFunction != None:
- if EscapeFunction(0):
- return None
-
-
- wActiveMenuElement = self.MenuStack.Top().GetFocus()
-
- try:
- sw = wActiveMenuElement.GetFocus()
- sw.ActivateItem(0)
- except:
- wActiveMenuElement.ActivateItem(0)
-
- if last_ss_quality != -1 and last_ss_quality != Bladex.GetSSQuality():
- print 'Reseting sound quality'
- Bladex.SetSSQuality(last_ss_quality)
- elif sound_cfg_changed == 1:
- Bladex.SaveSSConfig()
- sound_cfg_changed = 0
-
- SndNewMenu.PlayStereo()
-
-
-
- def MenuNextItemStrong(self):
- w = self.MenuStack.Top()
- w.NextFocus()
-
-
- def MenuNextItem(self):
- w = self.MenuStack.Top()
- sw = w.GetFocus()
- SndCorreGema.PlayStereo()
-
- try:
- sw.NextFocus()
- except:
- w.NextFocus()
-
-
-
- def MenuPrevItem(self):
- w = self.MenuStack.Top()
- sw = w.GetFocus()
- SndCorreGema.PlayStereo()
-
- try:
- sw.PrevFocus()
- except:
- w.PrevFocus()
-
-
-
- def MenuIncItem(self):
- w = self.MenuStack.Top()
- sw = w.GetFocus()
-
- try:
- sw.IncMenuItem()
- except AttributeError:
-
- try:
- w.IncMenuItem()
- except AttributeError:
- pass
-
-
-
-
- def MenuDecItem(self):
- w = self.MenuStack.Top()
- sw = w.GetFocus()
-
- try:
- sw.DecMenuItem()
- except AttributeError:
-
- try:
- w.DecMenuItem()
- except AttributeError:
- pass
-
-
-
-
- def MenuSuprItem(self):
- print 'MenuSuprItem(self)'
- w = self.MenuStack.Top().GetFocus()
- sw = w.GetFocus()
-
- try:
- sw.SuprMenuItem()
- except:
- w.SuprMenuItem()
-
-
-
- def CommandPrb(self):
- print 'Method CommandPrb'
-
-
- def EndMenu(self):
- while len(self.MenuStack.Top()) > 0:
- self.DeActivateMenuItem()
-
-
- CtrlsPosition = (70, BUIx.B_FrameWidget.B_FR_AbsoluteLeft, BUIx.B_FrameWidget.B_FR_Left)
-
- def GoTo2d(menu_class):
- import GotoMapVars
- GotoMapVars.EndOfLevel()
-
- vsepexit = 200 - int(46 * ((600 - Raster.GetSize()[1]) / 120))
- if Reference.DEMO_MODE:
- QuitMenu = {
- 'VSep': 30,
- 'Name': MenuText.GetMenuText('Exit'),
- 'Font': MenuFontBig,
- 'iFocus': 2,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Exit, Are you sure?'),
- 'VSep': vsepexit,
- 'Font': MenuFontBig,
- 'Kind': MenuWidget.B_MenuItemTextNoFXNoFocus },
- {
- 'Name': MenuText.GetMenuText('Yes'),
- 'VSep': 20,
- 'Font': MenuFontMed,
- 'ListDescr': [
- {
- 'Name': 'Features',
- 'Kind': MenuWidget.B_BackFeatures },
- {
- 'Name': ' ' }] },
- {
- 'Name': MenuText.GetMenuText('No'),
- 'VSep': 10,
- 'Font': MenuFontMed,
- 'Command': BackMenu },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackBlank }] }
- else:
- QuitMenu = {
- 'VSep': 30,
- 'Name': MenuText.GetMenuText('Exit'),
- 'Font': MenuFontBig,
- 'iFocus': 1,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Exit, Are you sure?'),
- 'VSep': vsepexit,
- 'Font': MenuFontBig,
- 'Kind': MenuWidget.B_MenuItemTextNoFXNoFocus },
- {
- 'Name': MenuText.GetMenuText('Yes'),
- 'VSep': 20,
- 'Command': CmdQuit,
- 'Font': MenuFontMed },
- {
- 'Name': MenuText.GetMenuText('No'),
- 'VSep': 10,
- 'Font': MenuFontMed,
- 'Command': BackMenu },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackBlank }] }
- PlayerConfigMenu = [
- {
- 'Name': MenuText.GetMenuText('Name:'),
- 'VSep': 30,
- 'Kind': netwidgets.B_InputBox,
- 'MaxSize': 16,
- 'GetInput': NetMisc.GetPlayerName,
- 'SetInput': NetMisc.SetPlayerName },
- {
- 'Name': MenuText.GetMenuText('Character:'),
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Knight'),
- MenuText.GetMenuText('Barbarian'),
- MenuText.GetMenuText('Dwarf'),
- MenuText.GetMenuText('Amazon')],
- 'SelOptionFunc': NetMisc.GetCharType,
- 'Command': NetMisc.SetCharType },
- {
- 'Name': 'Lista de jugadores',
- 'Kind': netwidgets.B_ImageListWidget,
- 'ImageList': NetMisc.CharBitmaps,
- 'GetCharType': NetMisc.GetCharStatus,
- 'VSep': 30 },
- {
- 'Name': MenuText.GetMenuText('Next Skin'),
- 'VSep': 30,
- 'Command': NetMisc.NextSkin },
- {
- 'Name': MenuText.GetMenuText('Handicap:'),
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (1, 4, 3),
- 'SpinGetValue': NetMisc.GetHandicap,
- 'SpinSetValueEnd': NetMisc.SetHandicap },
- {
- 'Name': MenuText.GetMenuText('Save'),
- 'Command': NetMisc.SavePlayerConfiguration },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackBlank }]
-
- def MapLoading(option):
- if Character == 0:
- Bladex.LoadLevel('Ruins_M4')
-
- if Character == 1:
- Bladex.LoadLevel('Barb_M1')
-
- if Character == 2:
- Bladex.LoadLevel('Ragnar_M2')
-
- if Character == 3:
- Bladex.LoadLevel('Dwarf_M3')
-
-
- TutGameChoosing = {
- 'Name': 'TopMenu',
- 'Kind': MenuWidget.B_MenuItemTextNoFX,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Enter Tutorial'),
- 'VSep': 250,
- 'Font': MenuFontBig,
- 'Command': LoadTutorial },
- {
- 'Name': MenuText.GetMenuText('Continue'),
- 'Font': MenuFontBig,
- 'Command': MapLoading },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] }
- NormalMenu = 1
-
- def SwitchCasaByGlobalMenu():
- global Desc1, TutGameChoosing
- DescAux = Desc1
- Desc1 = TutGameChoosing
- TutGameChoosing = DescAux
- DescAux = None
-
-
- def SwitchToCasaMenu():
- global NormalMenu
- if NormalMenu:
- NormalMenu = 0
- SwitchCasaByGlobalMenu()
- if Reference.DEMO_MODE:
- GetMenuItem([
- 'Enter Tutorial'])['Kind'] = MenuWidget.B_MenuItemTextNoFXNoFocus
-
-
-
-
- def SwitchToGlobalMenu():
- global NormalMenu
- if not NormalMenu:
- NormalMenu = 1
- SwitchCasaByGlobalMenu()
-
-
- if netgame.GetNetState() != 0:
- PlayerConfigMenu.insert(6, {
- 'Name': MenuText.GetMenuText('This modification will take effect in the next arena'),
- 'VSep': 20,
- 'Font': MenuFontSmall,
- 'Kind': MenuWidget.B_MenuItemTextNoFXNoFocus })
- Desc1 = {
- 'Name': 'TopMenu',
- 'Kind': MenuWidget.B_MenuItemTextNoFX,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Disconnect'),
- 'VSep': 220,
- 'Font': MenuFontBig,
- 'Command': NetMisc.Disconnect },
- {
- 'Name': MenuText.GetMenuText('Modify Player'),
- 'Font': MenuFontBig,
- 'ListDescr': PlayerConfigMenu },
- QuitMenu,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] }
- else:
- Desc1 = {
- 'Name': 'TopMenu',
- 'Size': (640, 480),
- 'Kind': MenuWidget.B_MenuItemTextNoFX,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Game'),
- 'Font': MenuFontBig,
- 'VSep': 200,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Start New Game'),
- 'Font': MenuFontBig,
- 'VSep': 220,
- 'Command': LoadPlayerSelect },
- {
- 'Name': MenuText.GetMenuText('Save Current'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Savegame Slot 1:'),
- 'Font': MenuFontBig,
- 'VSep': 200,
- 'Command': SaveGame1 },
- {
- 'Name': MenuText.GetMenuText('Savegame Slot 2:'),
- 'Font': MenuFontBig,
- 'VSep': 20,
- 'Command': SaveGame2 },
- {
- 'Name': MenuText.GetMenuText('Savegame Slot 3:'),
- 'Font': MenuFontBig,
- 'VSep': 20,
- 'Command': SaveGame3 },
- {
- 'Name': MenuText.GetMenuText('Savegame Slot 4:'),
- 'Font': MenuFontBig,
- 'VSep': 20,
- 'Command': SaveGame4 },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Load Saved'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Load Game at Slot 1:'),
- 'Font': MenuFontBig,
- 'VSep': 200,
- 'Command': LoadGame },
- {
- 'Name': MenuText.GetMenuText('Load Game at Slot 2:'),
- 'Font': MenuFontBig,
- 'VSep': 20,
- 'Command': LoadGame2 },
- {
- 'Name': MenuText.GetMenuText('Load Game at Slot 3:'),
- 'Font': MenuFontBig,
- 'VSep': 20,
- 'Command': LoadGame3 },
- {
- 'Name': MenuText.GetMenuText('Load Game at Slot 4:'),
- 'Font': MenuFontBig,
- 'VSep': 20,
- 'Command': LoadGame4 },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Arena'),
- 'Font': MenuFontBig,
- 'VSep': 20,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Connection:'),
- 'Font': MenuFontMed,
- 'VSep': 250,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('IPX (Local network)'),
- MenuText.GetMenuText('TCP/IP (Internet)')],
- 'SelOptionFunc': NetMisc.GetProtocol,
- 'Command': NetMisc.SetProtocol },
- {
- 'Name': MenuText.GetMenuText('New arena'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Name:'),
- 'VSep': 20,
- 'Kind': netwidgets.B_InputBox,
- 'MaxSize': 16,
- 'GetInput': NetMisc.GetArenaName,
- 'SetInput': NetMisc.SetArenaName },
- {
- 'Name': 'Lista de mapas',
- 'Kind': netwidgets.B_MapListWidget,
- 'LeftMap': '..\\..\\Data\\net\\MapL.bmp',
- 'RightMap': '..\\..\\Data\\net\\MapR.bmp',
- 'SelMap': '..\\..\\Data\\net\\MapM.bmp',
- 'MarkMap': '..\\..\\Data\\net\\MapS.bmp',
- 'MapGetValue': NetMisc.GetArenaMaps,
- 'MapSetValue': NetMisc.SetArenaMaps,
- 'VSep': 15 },
- {
- 'Name': MenuText.GetMenuText('The bad place'),
- 'VSep': 1,
- 'Kind': netwidgets.B_DescriptorLabel },
- {
- 'Name': MenuText.GetMenuText('Max players:'),
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (2, 10, 8),
- 'SpinGetValue': NetMisc.GetMaxPlayers,
- 'SpinSetValueEnd': NetMisc.SetMaxPlayers,
- 'VSep': 30 },
- {
- 'Name': MenuText.GetMenuText('Max handicap:'),
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (1, 4, 3),
- 'SpinGetValue': NetMisc.GetArenaHandicap,
- 'SpinSetValueEnd': NetMisc.SetArenaHandicap },
- {
- 'Name': MenuText.GetMenuText('Packets per second:'),
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Variable'),
- '10',
- '20',
- '30',
- '40',
- '50',
- '60'],
- 'SelOptionFunc': NetMisc.GetPPS,
- 'Command': NetMisc.SetPPS },
- {
- 'Name': MenuText.GetMenuText('Player configuration'),
- 'ListDescr': PlayerConfigMenu },
- {
- 'Name': MenuText.GetMenuText('Death Limit:'),
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (1, 51, 50),
- 'SpinGetValue': NetMisc.GetFragLimit,
- 'SpinSetValueEnd': NetMisc.SetFragLimit },
- {
- 'Name': MenuText.GetMenuText('Start'),
- 'Command': NetMisc.StartServer },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackBlank }] },
- {
- 'Name': MenuText.GetMenuText('Join game'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Address:'),
- 'Kind': netwidgets.B_InputBox,
- 'MaxSize': 32,
- 'GetInput': NetMisc.GetIp,
- 'SetInput': NetMisc.SetIp,
- 'Locked': NetMisc.IpLooked,
- 'VSep': 120 },
- {
- 'Name': MenuText.GetMenuText('Search'),
- 'Command': NetMisc.BrowseServers },
- {
- 'Name': MenuText.GetMenuText("Server's list"),
- 'Kind': netwidgets.B_ServerListWidget,
- 'Size': (610, 200),
- 'ListDescr': [] },
- {
- 'Name': MenuText.GetMenuText('Player configuration'),
- 'ListDescr': PlayerConfigMenu },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackBlank }] },
- {
- 'Name': MenuText.GetMenuText('Player configuration'),
- 'Font': MenuFontBig,
- 'ListDescr': PlayerConfigMenu },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Travel Book'),
- 'Font': MenuFontBig,
- 'Command': ExecTravelBook },
- {
- 'Name': MenuText.GetMenuText('Options'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Video'),
- 'VSep': 230,
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Gamma Level'),
- 'VSep': 240,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (0.0, 1.0, 20),
- 'SpinGetValue': GetGammaValue,
- 'SpinOnChange': SetGammaValue,
- 'SpinSetValue': SetGammaValue },
- {
- 'Name': MenuText.GetMenuText('Contrast Level'),
- 'VSep': 15,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (0.5, 4.0, 35),
- 'SpinGetValue': GetContrastValue,
- 'SpinOnChange': SetContrastValue,
- 'SpinSetValue': SetContrastValue },
- {
- 'Name': MenuText.GetMenuText('Brightness Level'),
- 'VSep': 15,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (0.0, 50.0, 25),
- 'SpinGetValue': GetBrightnessValue,
- 'SpinOnChange': SetBrightnessValue,
- 'SpinSetValue': SetBrightnessValue },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Sound'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('FX Volume'),
- 'VSep': 230,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (int(0), int(10), int(10)),
- 'SpinGetValue': GetSoundValue,
- 'SpinSetValueEnd': SetSoundValue },
- {
- 'Name': MenuText.GetMenuText('Music Volume'),
- 'VSep': 10,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (int(0), int(10), int(10)),
- 'SpinGetValue': GetMusicValue,
- 'SpinSetValueEnd': SetMusicValue },
- {
- 'Name': MenuText.GetMenuText('Sound Quality:'),
- 'VSep': 10,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Low'),
- MenuText.GetMenuText('Med'),
- MenuText.GetMenuText('High')],
- 'SelOptionFunc': GetSoundQuality,
- 'Command': SetSoundQuality },
- {
- 'Name': MenuText.GetMenuText('EAX:'),
- 'VSep': 10,
- 'Font': MenuFontMed,
- 'Options': [
- MenuText.GetMenuText('Disabled'),
- MenuText.GetMenuText('Enabled')],
- 'Kind': MenuWidget.B_MenuItemOption,
- 'SelOptionFunc': GetEAX,
- 'Command': SetEAX },
- {
- 'Name': MenuText.GetMenuText('EAX is sound alteration system for improved environment realism'),
- 'VSep': 5,
- 'Font': MenuFontSmall,
- 'Kind': MenuWidget.B_MenuItemTextNoFXNoFocus },
- {
- 'Name': MenuText.GetMenuText('Speaker Configuration:'),
- 'VSep': 10,
- 'Font': MenuFontMed,
- 'Options': [
- MenuText.GetMenuText('Earphones'),
- MenuText.GetMenuText('2'),
- MenuText.GetMenuText('2 + Subwoofer'),
- MenuText.GetMenuText('4')],
- 'Kind': MenuWidget.B_MenuItemOption,
- 'SelOptionFunc': GetSpeakerConfig,
- 'Command': SetSpeakerConfig },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Controls'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('General Actions'),
- 'VSep': 230,
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Configure Actions'),
- 'VSep': 240,
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': 'KeybList',
- 'Kind': KeybWidget.B_KeybListWidget,
- 'VSep': 170,
- 'Size': (610, 200),
- 'ListDescr': KeybActions },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Reset'),
- 'VSep': 10,
- 'Font': MenuFontBig,
- 'Command': ResetKeyB },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Mouse'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Invert'),
- 'VSep': 250,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Yes'),
- MenuText.GetMenuText('No')],
- 'SelOptionFunc': GetMouseInvert,
- 'Command': SetMouseInvert },
- {
- 'Name': MenuText.GetMenuText('X Speed'),
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (int(0), int(10), int(10)),
- 'SpinGetValue': GetMouseXSens,
- 'SpinSetValueEnd': SetMouseXSens },
- {
- 'Name': MenuText.GetMenuText('Y Speed'),
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (int(0), int(10), int(10)),
- 'SpinGetValue': GetMouseYSens,
- 'SpinSetValueEnd': SetMouseYSens },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('(Gamepad)'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Invert'),
- 'VSep': 250,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Yes'),
- MenuText.GetMenuText('No')],
- 'SelOptionFunc': GetMouseInvert,
- 'Command': SetMouseInvert },
- {
- 'Name': MenuText.GetMenuText('X Speed'),
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (int(0), int(10), int(10)),
- 'SpinGetValue': GetMouseXSens,
- 'SpinSetValueEnd': SetMouseXSens },
- {
- 'Name': MenuText.GetMenuText('Y Speed'),
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (int(0), int(10), int(10)),
- 'SpinGetValue': GetMouseYSens,
- 'SpinSetValueEnd': SetMouseYSens },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Game Options'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Auto-Facing:'),
- 'VSep': 240,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('No'),
- MenuText.GetMenuText('Yes')],
- 'Command': SetFacing,
- 'SelOptionFunc': GetFacing },
- {
- 'Name': MenuText.GetMenuText('De-Facing Time'),
- 'Kind': MenuWidget.B_MenuSpin,
- 'SpinValues': (int(1), int(30), int(29)),
- 'SpinGetValue': GetDeFacingValue,
- 'SpinSetValueEnd': SetDeFacingValue },
- {
- 'Name': MenuText.GetMenuText('Character Shadows:'),
- 'VSep': 15,
- 'Font': MenuFontMed,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Yes'),
- MenuText.GetMenuText('No')],
- 'SelOptionFunc': ShadowsSettings,
- 'Command': SetShadows },
- {
- 'Name': MenuText.GetMenuText('Gore'),
- 'Font': MenuFontMed,
- 'VSep': 30,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Parental Lock'),
- 'Font': MenuFontBig,
- 'VSep': 250,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Password:'),
- 'VSep': 200,
- 'Kind': netwidgets.B_InputBox,
- 'MaxSize': 8,
- 'GetInput': Empty,
- 'SetInput': SetPass,
- 'PasswordChar': '#' },
- {
- 'Name': MenuText.GetMenuText('Change Password'),
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Change Password'),
- 'VSep': 200,
- 'Font': MenuFontBig,
- 'Kind': MenuWidget.B_MenuItemTextNoFXNoFocus },
- {
- 'Name': MenuText.GetMenuText('Current Password:'),
- 'Kind': netwidgets.B_InputBox,
- 'MaxSize': 8,
- 'GetInput': Empty,
- 'SetInput': SetPass,
- 'PasswordChar': '#',
- 'VSep': 20 },
- {
- 'Name': MenuText.GetMenuText('New Password:'),
- 'Kind': netwidgets.B_InputBox,
- 'MaxSize': 8,
- 'GetInput': Empty,
- 'SetInput': SetNewPass,
- 'PasswordChar': '#' },
- {
- 'Name': MenuText.GetMenuText('Confirm New Password:'),
- 'Kind': netwidgets.B_InputBox,
- 'MaxSize': 8,
- 'GetInput': Empty,
- 'SetInput': SetConfNewPass,
- 'PasswordChar': '#' },
- {
- 'Name': MenuText.GetMenuText('OK'),
- 'Command': SavePassword,
- 'VSep': 40 },
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackBlank }] },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackBlank }] },
- {
- 'VSep': 20,
- 'Name': MenuText.GetMenuText('Blood:'),
- 'Font': MenuFontBig,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Yes'),
- MenuText.GetMenuText('No')],
- 'Command': SetBlood,
- 'SelOptionFunc': BloodSettings,
- 'CheckPass': CheckGorePassWord },
- {
- 'Name': MenuText.GetMenuText('Mutilations:'),
- 'Font': MenuFontBig,
- 'Kind': MenuWidget.B_MenuItemOption,
- 'Options': [
- MenuText.GetMenuText('Yes'),
- MenuText.GetMenuText('No')],
- 'Command': SetMutilation,
- 'SelOptionFunc': MutilationSettings,
- 'CheckPass': CheckGorePassWord },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- BackOption,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] },
- {
- 'Name': MenuText.GetMenuText('Credits'),
- 'Font': MenuFontBig,
- 'ListDescr': [
- {
- 'Name': MenuText.GetMenuText('Sub SubMenu51') },
- {
- 'Name': MenuText.GetMenuText('Sub SubMenu52') }] },
- QuitMenu,
- {
- 'Name': 'Back',
- 'Kind': MenuWidget.B_BackImageWidget }] }
- if 'Casa' != Bladex.GetCurrentMap():
- Desc1['ListDescr'].insert(1, {
- 'Name': MenuText.GetMenuText('Back To Game'),
- 'Font': MenuFontBig,
- 'Command': BackMenu })
-
-
- def BackMap():
- Desc1['ListDescr'].insert(len(Desc1['ListDescr']) - 1, {
- 'Name': MenuText.GetMenuText('Leave Rune Quest'),
- 'Font': MenuFontBig,
- 'Command': GoTo2d,
- 'VSep': 20 })
-
-
- def GetMenuItem(way):
- idx = 0
- continueflag = 1
- MenuLevel = Desc1
- ReturnValue = 1
- while continueflag:
- continueflag = 0
- for val in MenuLevel['ListDescr']:
- if val.has_key('Name'):
- print 'see', val['Name']
- if MenuText.GetInverseMenuText(val['Name']) == way[idx]:
- idx = idx + 1
- if len(way) == idx:
- ReturnValue = val
- elif val.has_key('ListDescr'):
- continueflag = 1
- MenuLevel = val
- print 'Searching at', val['Name']
- else:
- print val['Name'], 'is not a list'
- break
-
-
-
- MenuLevel = None
- return ReturnValue
-
-
- def InitMenuKeys():
- Raster.SetTextMode(3)
- InputManager = BInput.GetInputManager()
- InputManager.AddInputActionsSet('MenuRedefine')
- InputManager.AddInputActionsSet('Menu')
- oldInputActionsSet = InputManager.GetInputActionsSet()
- InputManager.SetInputActionsSet('Menu')
- InputManager.SetInputActionsSet('Default')
- Bladex.AddInputAction('Activate Menu', 0)
- Bladex.AssocKey('Activate Menu', 'Keyboard', 'Esc')
- Bladex.AddBoundFunc('Activate Menu', PreActivateMenu)
- InputManager.SetInputActionsSet(oldInputActionsSet)
- print 'Activadas!'
- if Reference.DEMO_MODE == 1:
- GetMenuItem([
- 'Travel Book'])['Kind'] = MenuWidget.B_MenuItemTextNoFXNoFocus
- GetMenuItem([
- 'Credits'])['Kind'] = MenuWidget.B_MenuItemTextNoFXNoFocus
- del GetMenuItem([
- 'Credits'])['ListDescr']
- GetMenuItem([
- 'Game',
- 'Save Current'])['Kind'] = MenuWidget.B_MenuItemTextNoFXNoFocus
- del GetMenuItem([
- 'Game',
- 'Save Current'])['ListDescr']
- GetMenuItem([
- 'Game',
- 'Load Saved'])['Kind'] = MenuWidget.B_MenuItemTextNoFXNoFocus
- del GetMenuItem([
- 'Game',
- 'Load Saved'])['ListDescr']
- GetMenuItem([
- 'Game',
- 'Arena'])['Kind'] = MenuWidget.B_MenuItemTextNoFXNoFocus
- del GetMenuItem([
- 'Game',
- 'Arena'])['ListDescr']
- GetMenuItem([
- 'Options',
- 'Controls',
- '(Gamepad)'])['Kind'] = MenuWidget.B_MenuItemTextNoFXNoFocus
- del GetMenuItem([
- 'Options',
- 'Controls',
- '(Gamepad)'])['ListDescr']
-
-
-
- try:
- execfile('..\\..\\Scripts\\GameCfg.py')
- print 'Menu.py -> Executed GameCfg.py'
- except:
- print 'Menu.py -> No GameCfg.py found'
-
-