Announcement

Collapse
No announcement yet.

[SOLVED] Handling login and create profile menus w/ multiple dialogs in the ViewStack

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

    [SOLVED] Handling login and create profile menus w/ multiple dialogs in the ViewStack

    [EDIT] TL-DR version: I was getting over excited with popping and pushing. Problem solved by making a notification function called from actionscript after views are done popping before making a new viewstack call. The problem was not with having multiple dialog's in the stack, this works perfectly fine.

    __________________________________________________ __________________________________________________ __________________________________



    So...I've been altering the UDKFrontEnd setup by adding Login and Create Profile Dialog screens (by extending GFxUDKFrontEnd_Dialog).
    Let me preface this by adding that I'm in an older build (sept 2011 of udk) and as such, using an older scaleform version (and actionscript 2.0).

    Anyways, I changed the select_multiplayer bind of the main menu to Spawn my Login Dialog.
    Within the Login Dialog I have a button which when clicked Spawns the Create Profile Dialog which is all well and good.

    Now, common sense would tell me that the system I'm working with isn't meant to handle multiple dialog views in the viewstack (on top of one another) at the same time, as in the udk menu they are only ever spawned one at a time and are usually popped from the stack before performing a function or moving to a new menu. Regardless, I told my brain to keep its thoughts to itself and proceeded to try and get it working in this fashion.

    Now that I have all the functionality for these two dialogs in place I'm having issues popping them from the stack and moving on to a new view.

    1st scenario:
    -Enter Front End, press multiplayer.
    -Login Dialog spawns, press Create Profile button
    -Create Profile Dialog spawns (without popping Login from the stack first)
    -I create a new profile and go through all my fancy uscript work.

    Now that I have a new profile I'm trying to pop the create profile dialog from the stack in order to pass the information to the login dialog which is right under it in the ViewStack (to log the new profile in). However, in order to do so I have to either make two MoveBackImpl() or two MenuManager.PopView() calls in order to actually pop the Create Profile dialog from the stack and return to the Login dialog screen. If I only make one, the Create Profile dialog just sits there mocking me as if I hadn't popped it at all.

    2nd scenario:
    -The Login Dialog is pushed to the top of the stack after Create Dialog is popped (from the two calls)
    -It is given the login information from my Menu Manager which stored the info in vars passed from the Create Profile Dialog.
    -I have the Login Screen process the information for the login

    Now I want to pop the login dialog from the stack and proceed to the multiplayer menu (provided the login succeeded), but again this requires me to Pop the ViewStack twice in order to remove the Login Dialog screen. A single call seems to do nothing, even though I know the menu manager is receiving it from my logs.

    However, this is not the case if I never spawn the create profile dialog:

    3rd scenario:
    -Enter Front End, press multiplayer.
    -Login Dialog spawns, enter info and press Login button

    In this case where I have never spawned the Create Profile Dialog it only requires one call to either pop it from the stack or PushViewByName('Multiplayer').

    I have no idea why the view stack is being so difficult, I've been racking my brain but all I can get out of it is "I tried to tell you, but you didn't want to listen."
    Would it be advisable to just rework the system so that before i transition from one dialog to another i pop the login from the stack and vice versa on the way back from creating a new profile?

    __________________________________________________ _____

    My second (and simpler) question is what is the best way to push a view after popping a dialog from the stack? if I simultaneously try calling PopView() and PushViewByName('blah') the pushed view is not registered, presumably b/c the popped view is still tweening out.

    Example:
    -Player Logs in, login info is accepted.
    -Pop the login dialog from the stack
    -Push multiplayer menu onto the stack.

    Thanks in advance for any insight and/or help.

    #2
    Ok, so here's the deal. Turned out I was calling popviews and pushviews to quickly in succession which was causing some calls to be missed. Especially in the case where I would pop a view and push one immediately afterward. The same was happening when I tried popping from one dialog to the next and immediately popping from that one back to a menu. The way I solved this was by editing the MenuManager.as file. At the end of the popViewImpl():MovieClip function, before it returns, I added an external interface call in order to notify my menu manager .uc file after actionscript was done physically popping the view. Once the notification function was called in my manager class, I parsed the view stack to see what view was on top and then told that view how to act based upon bools I had set before popping the stack.

    Based upon the amount of views this thread got within the first 24 hrs I seemed to have perked some interest. So for anyone interested, here's a video of it working currently. Otherwise disregard; problem solved.



    So in the video at about 1:35 is where the issue was. Although you can't see it, when I press submit, it pops the create profile dialog from the stack to go back to the login dialog. The login dialog then processes the new profile's information and logs them in. After the login completes, the login dialog is popped from the stack taking us back to the main menu. From here the main menu pushes the multiplayer menu onto the stack. Which is alot of stuff happening in like a half a second and it was pretty imperative to have it happen in the right order, at the right time (e.g. waiting for the view stack pop to complete in actionscript before trying to tell the stack to process another pop or push from unrealscript).



    P.S. Sorry if i cluttered the scaleform forum with nubbish ramblings
    I just started playing with GFx a few days ago... 'tis fun though.

    Comment

    Working...
    X