[ut3mods] Extending UIButton

Discussion in 'Unreal Tournament 3 newsletter' started by John Melton, Aug 22, 2009.

  1. John Melton

    John Melton Guest

    Hello,



    I'm trying to extend UIButton and when I do the OnClicked delegate does not
    get called. I've attempted to set the delegate in the extended button class
    and setting it in a custom scene class. I've tried with a standard
    UIButton and the delegate will get called. When I extend UIObject the
    OnClicked delegate does not get called either.





    Code for said button and scene are located here:
    http://utforums.epicgames.com/showthread.php?t=697650



    Thank you for your time,

    John Melton


    ---------------------
    TO LEAVE THE LIST
    ---------------------
    Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    (not the subject line), write: SIGNOFF UT3MODS
     
  2. Berend Wouda

    Berend Wouda Guest

    This is a bug I ran into about a year ago. Back then I didn't get any
    responses on it, so I guess you're out of luck. I "fixed" the problem by
    setting the UIButton's delegate in a custom scene initializer.


    Regards,

    Kirk


    John Melton wrote:
    >
    > Hello,
    >
    > I’m trying to extend UIButton and when I do the OnClicked delegate
    > does not get called. I’ve attempted to set the delegate in the
    > extended button class and setting it in a custom scene class. I’ve
    > tried with a standard UIButton and the delegate will get called. When
    > I extend UIObject the OnClicked delegate does not get called either.
    >
    > Code for said button and scene are located here:
    > http://utforums.epicgames.com/showthread.php?t=697650
    >
    > Thank you for your time,
    >
    > John Melton
    >
    > ---------------------
    > TO LEAVE THE LIST
    > ---------------------
    > Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    > (not the subject line), write: SIGNOFF UT3MODS
    >


    ---------------------
    TO LEAVE THE LIST
    ---------------------
    Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    (not the subject line), write: SIGNOFF UT3MODS
     
  3. Map Mixer

    Map Mixer Guest

    Hi John



    It's a long story (I don't have a lot of time atm) and I don't claim to be
    an expert but when you extend UIButton, it misses out on events because it
    needs an entry, like the following one for UILabelButton:



    UTInput.ini



    [Engine.UIInputConfiguration]

    WidgetInputAliases=(WidgetClassName="Engine.UILabelButton",WidgetStates=((St
    ateClassName="Engine.UIState_Focused",StateInputAliases=((InputAliasName="Ne
    xtControl",LinkedInputKeys=((InputKeyName="Tab"))),(InputAliasName="Clicked"
    ,LinkedInputKeys=((InputKeyName="Enter"),(InputKeyName="SpaceBar"),(InputKey
    Name="XboxTypeS_A"))),(InputAliasName="NavFocusUp",LinkedInputKeys=((InputKe
    yName="Up"),(InputKeyName="XboxTypeS_DPad_Up"),(InputKeyName="Gamepad_LeftSt
    ick_Up"))),(InputAliasName="NavFocusDown",LinkedInputKeys=((InputKeyName="Do
    wn"),(InputKeyName="XboxTypeS_DPad_Down"),(InputKeyName="Gamepad_LeftStick_D
    own"))),(InputAliasName="NavFocusLeft",LinkedInputKeys=((InputKeyName="Left"
    ),(InputKeyName="XboxTypeS_DPad_Left"),(InputKeyName="Gamepad_LeftStick_Left
    "))),(InputAliasName="NavFocusRight",LinkedInputKeys=((InputKeyName="Right")
    ,(InputKeyName="XboxTypeS_DPad_Right"),(InputKeyName="Gamepad_LeftStick_Righ
    t"))))),(StateClassName="Engine.UIState_Active",StateInputAliases=((InputAli
    asName="Clicked",LinkedInputKeys=((InputKeyName="LeftMouseButton")))))))



    Events don't appear to automatically filter down to subclasses. This is one
    of the main reasons why I re-created a few of my UI objects from scratch (eg
    multi-column list) and handled all the input myself for each scene from a
    special input class (another story).



    However, I also wanted to use the UIButton class but change the way it
    looked, so I used Archetypes, as follows:



    Begin Object Class=UILabelButton Name=Button_Blah
    Archetype=MapMixerUI_LabelButton'Default__MapMixerUI_LabelButton'

    ....

    End Object



    This way my button instance will still get events, as it is still a UIButton
    class but setup using an archetype.



    I'm not sure how much help that will be, as I hand-code the entire UI (ie
    don't use the editor).



    Mathew Wilson (sinx)

    mapmixer.oceaniaut.com



    From: UT3 Mods [mailto:UT3MODS (AT) EPICGAMES.COM] On Behalf Of John Melton
    Sent: Sunday, 23 August 2009 6:17 am
    To: UT3MODS (AT) EPICGAMES.COM
    Subject: [ut3mods] Extending UIButton



    Hello,



    I'm trying to extend UIButton and when I do the OnClicked delegate does not
    get called. I've attempted to set the delegate in the extended button class
    and setting it in a custom scene class. I've tried with a standard
    UIButton and the delegate will get called. When I extend UIObject the
    OnClicked delegate does not get called either.





    Code for said button and scene are located here:
    http://utforums.epicgames.com/showthread.php?t=697650



    Thank you for your time,

    John Melton


    ---------------------
    TO LEAVE THE LIST
    ---------------------
    Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    (not the subject line), write: SIGNOFF UT3MODS

    ---------------------
    TO LEAVE THE LIST
    ---------------------
    Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    (not the subject line), write: SIGNOFF UT3MODS
     
  4. Hey John,

    If you go into the editor and press F8 (In the UI scene editor), it brings
    up a DefaultKeyBindingAlias window. It is in this window that you can set
    default key bindings for activating events. Maybe your extended button
    hasn't got the key bindings set to it.

    I'm not exactly sure how it works but I've had to set up key bindings in
    here before in order to get other components working.

    I'm pretty sure this is the GUI equivalent of what Matthew said to do.

    Cheers,
    Andrew

    On Sun, Aug 23, 2009 at 10:38 AM, Map Mixer <mapmixer (AT) com> wrote:

    > Hi John
    >
    >
    >
    > It’s a long story (I don’t have a lot of time atm) and I don’t claim to be
    > an expert but when you extend UIButton, it misses out on events because it
    > needs an entry, like the following one for UILabelButton:
    >
    >
    >
    > UTInput.ini
    >
    >
    >
    > [Engine.UIInputConfiguration]
    >
    > WidgetInputAliases=(WidgetClassName="Engine.UILabelButton",WidgetStates=((StateClassName="Engine.UIState_Focused",StateInputAliases=((InputAliasName="NextControl",LinkedInputKeys=((InputKeyName="Tab"))),(InputAliasName="Clicked",LinkedInputKeys=((InputKeyName="Enter"),(InputKeyName="SpaceBar"),(InputKeyName="XboxTypeS_A"))),(InputAliasName="NavFocusUp",LinkedInputKeys=((InputKeyName="Up"),(InputKeyName="XboxTypeS_DPad_Up"),(InputKeyName="Gamepad_LeftStick_Up"))),(InputAliasName="NavFocusDown",LinkedInputKeys=((InputKeyName="Down"),(InputKeyName="XboxTypeS_DPad_Down"),(InputKeyName="Gamepad_LeftStick_Down"))),(InputAliasName="NavFocusLeft",LinkedInputKeys=((InputKeyName="Left"),(InputKeyName="XboxTypeS_DPad_Left"),(InputKeyName="Gamepad_LeftStick_Left"))),(InputAliasName="NavFocusRight",LinkedInputKeys=((InputKeyName="Right"),(InputKeyName="XboxTypeS_DPad_Right"),(InputKeyName="Gamepad_LeftStick_Right"))))),(StateClassName="Engine.UIState_Active",StateInputAliases=((InputAliasName="Clicked",LinkedInputKeys=((InputKeyName="LeftMouseButton")))))))
    >
    >
    >
    >
    > Events don’t appear to automatically filter down to subclasses. This is
    > one of the main reasons why I re-created a few of my UI objects from scratch
    > (eg multi-column list) and handled all the input myself for each scene from
    > a special input class (another story).
    >
    >
    >
    > However, I also wanted to use the UIButton class but change the way it
    > looked, so I used Archetypes, as follows:
    >
    >
    >
    > Begin Object Class=UILabelButton Name=Button_Blah
    > Archetype=MapMixerUI_LabelButton'Default__MapMixerUI_LabelButton'
    >
    > ...
    >
    > End Object
    >
    >
    >
    > This way my button instance will still get events, as it is still a
    > UIButton class but setup using an archetype.
    >
    >
    >
    > I’m not sure how much help that will be, as I hand-code the entire UI (ie
    > don’t use the editor).
    >
    >
    >
    > Mathew Wilson (sinx)
    >
    > mapmixer.oceaniaut.com
    >
    >
    >
    > *From:* UT3 Mods [mailto:UT3MODS (AT) EPICGAMES.COM] *On Behalf Of *John
    > Melton
    > *Sent:* Sunday, 23 August 2009 6:17 am
    > *To:* UT3MODS (AT) EPICGAMES.COM
    > *Subject:* [ut3mods] Extending UIButton
    >
    >
    >
    > Hello,
    >
    >
    >
    > I’m trying to extend UIButton and when I do the OnClicked delegate does not
    > get called. I’ve attempted to set the delegate in the extended button class
    > and setting it in a custom scene class. I’ve tried with a standard
    > UIButton and the delegate will get called. When I extend UIObject the
    > OnClicked delegate does not get called either.
    >
    >
    >
    >
    >
    > Code for said button and scene are located here:
    > http://utforums.epicgames.com/showthread.php?t=697650
    >
    >
    >
    > Thank you for your time,
    >
    > John Melton
    >
    >
    >
    > ---------------------
    >
    > TO LEAVE THE LIST
    >
    > ---------------------
    >
    > Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    >
    > (not the subject line), write: SIGNOFF UT3MODS
    >
    > ---------------------
    > TO LEAVE THE LIST
    > ---------------------
    > Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    > (not the subject line), write: SIGNOFF UT3MODS
    >
    >


    ---------------------
    TO LEAVE THE LIST
    ---------------------
    Write to LISTSERV (AT) EPICGAMES.COM and, in the text of your message
    (not the subject line), write: SIGNOFF UT3MODS
     

Share This Page

Loading...