home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyc (Python 1.5)
-
- import Bladex
- import Reference
- import Menu
- import Raster
- import BUIx
- import BBLib
- import BInput
- import darfuncs
- import GameText
- import TutorialScorer
- fading_start_time = 0
- logo_rebel = 0
- logo_friendware = 0
- logo_blade = 0
- last_demo_msg_time = 0
- demo_is_active = 0
- prev_was_menu = 0
- LOGOS_FULL = 1
- TutorialScorer.ActivateTutorialScorer('../../Data/Letras menu med.bmp')
- TutorialScorer.wMultiText.SetColor(255, 0, 0)
- LastMessage = 0
- OnEnterDemo = 0
- OnExitDemo = 0
-
- def StaticLogoRebel(time):
- global last_demo_msg_time
- alpha = (time - fading_start_time) * 0.25
- if alpha > 0.8:
- alpha = 0.8
-
- if alpha < 0:
- alpha = 0
-
- if time - last_demo_msg_time > 3.0:
- GameText.WriteTextAux('Modo DEMO - pulsa una tecla', 2.0, 255, 255, 255, [])
- last_demo_msg_time = time
-
- (w, h) = Raster.GetSize()
- Raster.SetPosition(w - 136, h - 90 - 5)
- Raster.SetAlpha(alpha)
- Raster.DrawBitmap(logo_rebel, 128, 90)
- Raster.SetPosition(10, h - 110)
- Raster.SetAlpha(alpha)
- Raster.DrawBitmap(logo_friendware, 128 - 20, 128)
- Raster.SetPosition(w / 2.0 - 128, -90)
- Raster.SetAlpha(alpha)
- Raster.DrawBitmap(logo_blade, 256, 256)
-
-
- def FadeLogoFriendware(time):
- global fading_start_time
- if time - fading_start_time < 2:
- alpha = (time - fading_start_time) * 0.5
- else:
- alpha = 1.0 - (time - fading_start_time - 2) * 0.5
- if alpha > 1:
- alpha = 1
- elif alpha <= 0:
- alpha = 0
- if time - fading_start_time > 1:
- Bladex.RemoveAfterFrameFunc('FadeLogoFriendware')
- fading_start_time = Bladex.GetTime() + 0.5
- Bladex.SetAfterFrameFunc('StaticLogoRebel', StaticLogoRebel)
-
-
- Raster.SetPenColor(255, 255, 255)
- Raster.SetAlpha(alpha)
- if LOGOS_FULL == 1:
- Raster.SetPosition(110, 0)
- Raster.DrawBitmap(logo_friendware, Raster.GetSize()[0] - 220, Raster.GetSize()[1])
- else:
- Raster.SetPosition(Raster.GetSize()[0] - 256, Raster.GetSize()[1] - 225)
- Raster.DrawBitmap(logo_friendware, 255, 255)
-
-
- def FadeLogoRebel(time):
- global fading_start_time
- if time - fading_start_time < 2:
- alpha = (time - fading_start_time) * 0.5
- else:
- alpha = 1.0 - (time - fading_start_time - 2) * 0.5
- if alpha > 1:
- alpha = 1
- elif alpha <= 0:
- alpha = 0
- if time - fading_start_time > 1:
- Bladex.RemoveAfterFrameFunc('FadeLogoRebel')
- fading_start_time = Bladex.GetTime() + 0.5
- Bladex.SetAfterFrameFunc('FadeLogoFriendware', FadeLogoFriendware)
-
-
- Raster.SetPenColor(255, 255, 255)
- Raster.SetAlpha(alpha)
- if LOGOS_FULL == 1:
- Raster.SetPosition(60, 40)
- Raster.DrawBitmap(logo_rebel, Raster.GetSize()[0] - 120, Raster.GetSize()[1] - 80)
- else:
- Raster.SetPosition(Raster.GetSize()[0] - 256, Raster.GetSize()[1] - 256)
- Raster.DrawBitmap(logo_rebel, 255, 255)
-
-
- def LaunchDemoCamera2(a, b):
- global fading_start_time
- fading_start_time = Bladex.GetTime() + 1
- Bladex.RemoveAfterFrameFunc('StaticLogoRebel')
- Bladex.SetAfterFrameFunc('FadeLogoRebel', FadeLogoRebel)
- darfuncs.LaunchMaxCamera('demo_travelling.cam', 0, -1, LaunchDemoCamera)
-
-
- def LaunchDemoCamera(a, b):
- darfuncs.LaunchMaxCamera('demo_travelling.cam', 0, -1, LaunchDemoCamera2)
-
- import pdb
- oldInputActionsSet = None
-
- def FinishDemoFunc(x, y, z):
- global Listener
- print 'Demo_Stuff.FinishDemoFunc called'
- InputManager = BInput.GetInputManager()
- InputManager.SetInputActionsSet(oldInputActionsSet)
- InputManager.GetAttachedDevice('Keyboard').RemoveListener('EndDemo')
- Listener = None
- DemoLoop()
-
-
- def DemoLoop():
- global demo_is_active, prev_was_menu, fading_start_time, Listener, oldInputActionsSet, demo_is_active, prev_was_menu, prev_was_menu, demo_is_active, fading_start_time, Listener, oldInputActionsSet
- AppMode = Bladex.GetAppMode()
- import Scorer
- if AppMode == 'Menu':
- demo_is_active = 1
- prev_was_menu = 1
- print 'DemoLoop-Menu2Demo'
- Menu.ActivateMenu()
- print 'DemoLoop , activatemenu en menu2demo'
- Bladex.SetAppMode('Demo')
- if OnEnterDemo:
- OnEnterDemo()
-
- print 'demo mode set up'
- Bladex.ExeMusicEvent(Bladex.GetMusicEvent('musica_loop_demo'))
- fading_start_time = Bladex.GetTime() + 1
- Bladex.SetAfterFrameFunc('FadeLogoRebel', FadeLogoRebel)
- Listener = BInput.B_InputListener('EndDemo')
- Listener.SetPythonFunc(FinishDemoFunc)
- InputManager = BInput.GetInputManager()
- oldInputActionsSet = InputManager.GetInputActionsSet()
- InputManager.SetInputActionsSet('Demo')
- InputManager.GetAttachedDevice('Keyboard').AddListener(Listener)
- Bladex.AddScheduledFunc(Bladex.GetTime() + 0.1, LaunchDemoCamera, (0, 0))
- Scorer.SetVisible(0)
- elif AppMode == 'Demo':
- demo_is_active = 0
- Bladex.ActivateInput()
- if prev_was_menu == 1:
- Menu.ActivateMenu()
- print 'DemoLoop-Demo2Menu'
- print 'set menu mode'
- Bladex.SetAppMode('Menu')
- else:
- print 'DemoLoop-Demo2Game'
- print 'NO set 2 menu mode'
- Bladex.SetAppMode('Game')
- if OnExitDemo:
- OnExitDemo()
-
- Bladex.ExeMusicEvent(-1)
- Bladex.RemoveAfterFrameFunc('FadeLogoRebel')
- Bladex.RemoveAfterFrameFunc('FadeLogoFriendware')
- Bladex.RemoveAfterFrameFunc('StaticLogoRebel')
- prev_was_menu = 0
- cam = Bladex.GetEntity('Camera')
- if Bladex.GetCurrentMap() != 'Casa':
- cam.SetPersonView('Player1')
- cam.Cut()
- Bladex.SetListenerPosition(1)
- Scorer.SetVisible(1)
-
- elif AppMode == 'Game':
- prev_was_menu = 0
- demo_is_active = 1
- print 'DemoLoop-Game2Demo'
- Bladex.SetAppMode('Demo')
- print 'demo mode set up'
- Bladex.ExeMusicEvent(Bladex.GetMusicEvent('musica_loop_demo'))
- fading_start_time = Bladex.GetTime() + 1
- Bladex.SetAfterFrameFunc('FadeLogoRebel', FadeLogoRebel)
- if OnEnterDemo:
- OnEnterDemo()
-
- Listener = BInput.B_InputListener('EndDemo')
- Listener.SetPythonFunc(FinishDemoFunc)
- InputManager = BInput.GetInputManager()
- oldInputActionsSet = InputManager.GetInputActionsSet()
- InputManager.SetInputActionsSet('Demo')
- InputManager.GetAttachedDevice('Keyboard').AddListener(Listener)
- LaunchDemoCamera(0, 0)
- Scorer.SetVisible(0)
-
-
-
- def Init():
- global logo_rebel, logo_friendware, logo_blade
- if Reference.DEMO_MODE == 1:
- Bladex.SetMenuTgapFunc(DemoLoop)
- else:
- return None
- BBLib.ReadMMP('../../Data/logorebel.mmp')
- logo_rebel = Raster.BmpHandle('LOGOREBELALFA')
- BBLib.ReadMMP('../../Data/logofriendware256.mmp')
- logo_friendware = Raster.BmpHandle('LOGOFRIENDWARE')
- BBLib.ReadMMP('../../Data/logoblade256.mmp')
- logo_blade = Raster.BmpHandle('LOGOBLADE')
- Bladex.AddMusicEventMP3('musica_loop_demo', '..\\..\\Sounds\\tema.mp3', 0.1, 1.0, 1.0, 11000, 0, -1)
- Bladex.AddMusicEventMP3('emptyloquesea_demo', '', 0.1, 0.1, 1.0, 11000, 0, 0)
-
-