Announcement

Collapse

The Infinity Blade Forums Have Moved

We've launched brand new Infinity Blade forums with improved features and revamped layout. We've also included a complete archive of the previous posts. Come check out the new Infinity Blade forums.
See more
See less

Why does my menu disappear after a period of time?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Why does my menu disappear after a period of time?

    Hey all

    I am having a problem with my scaleform menu. What happens is, when the level loads, a menu appears, with a series of options for the player. Now, this menu works fine, except for one thing. If the player does not choose an option, and doesn't touch the menu, after a certain amount of time, (around a minute I think) the menu will disappear, leaving the player stuck in cinematic mode, with no way of leaving it, or getting the menu to reappear :/

    I am not sure why this is happening at all!!!

    This is the code that calls the menu:

    Inside my gameinfo class
    Code:
    function RestartPlayer( Controller aPlayer)
    {	
    	Super.RestartPlayer( aPlayer );
    	
    	PHPlayerController(aPlayer).SetCinematicMode(true, true, true, true, true, true);
    	PHPlayerController(aPlayer).RunMenu();
    	
    
    }

    Inside my playercontroller class
    Code:
    reliable client function RunMenu()
    {
    	local PHMenu Menu;
    	Menu = new class'PHMenu';
    	Menu.Start();
    }
    And this is the movie code:
    Code:
    class PHMenu extends GFxMoviePlayer;
    
    var GFxClikWidget Option1Button;
    var GFxClikWidget Option2Button;
    
    var GFxObject RootMC, MouseCursor;
    
    function bool Start(optional bool StartPaused = false)
    {
        super.Start();
        Advance(0.f);
    	
    	RootMC = GetVariableObject("_root");
    	MouseCursor = CreateMouseCursor();
    	MouseCursor.SetBool("topmostLevel", true); // This ensures the mouse is drawn at the top most level, above all other UI widgets.
    	
    	
    	return true;
      
    }
    
    function GFxObject CreateMouseCursor()
    {
        return RootMC.AttachMovie("MouseContainer", "MouseCursor");
    }
    
    event bool WidgetInitialized(name WidgetName, name WidgetPath, GFxObject Widget)
    {
    	
    	switch(WidgetName)
    	{
    		case ('Option1Btn'):
    			Option1Button = GFxClikWidget(Widget);
    			Option1Button.AddEventListener('CLIK_press', Dostuff1);
    			break;
    			
    		case ('Option2Btn'):
    			Option2Button = GFxClikWidget(Widget);
    		        Option2Button.AddEventListener('CLIK_press', Dostuff2);
    			break;
    		
    		default:
    			break;
    	}
    	return true;
    }
    
    reliable client function Dostuff1(GFxClikWidget.EventData ev)
    {
    	Local PlayerController MyPC;
    	MyPC = GetPC();
    	PHPlayerController(MyPC).SelectOption1();
    	Close(false);
    }
    	
    
    
    function Dostuff2(GFxClikWidget.EventData ev)
    {
    	Local PlayerController MyPC;
    	MyPC = GetPC();
    	PHPlayerController(MyPC).SelectOption2();
    	Close(false);
    	
    }
    
    
    defaultproperties
    {
    	MovieInfo = SwfMovie'PHFrontEnd.FrontEnd.PHMenu'
    	bCaptureInput = true;
    	bIgnoreMouseInput = false;
            bDisplayWithHudOff = true;
    
    	WidgetBindings.Add((WidgetName="Option1Btn",WidgetClass=class'GFxClikWidget'))
    	WidgetBindings.Add((WidgetName="Option2Btn",WidgetClass=class'GFxClikWidget'))
    
    }
    The actionscript for the swf:
    Code:
    _global.gfxExtentions = true;
    
    import gfx.controls.ButtonGroup;
    
    stop();
    So, if anybody has any ideas, or suggestions, that would be amazing!

    Thankyou!

    #2
    Same here.

    Comment


      #3
      Hey just found the solution.
      You need to assign the local GfxMoviePlayer in RunMenu() to a class member.
      A wild guess might be, since its only local, it gets garbage collected some time after the function terminated
      (though, isnt it linked somwhere as it is obviously displayed?)

      Hope this helps anyone,
      Cheers Philipp

      Comment

      Working...
      X