Announcement

Collapse
No announcement yet.

GUIComponent help needed

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

    GUIComponent help needed

    Hi guys, its been a long time since i had to post on a forum asking for scripting help! but here goes.

    I have a custom page setup

    class GoldeneyeCharacterSelect extends UT2K4GUIPage;

    on that page i have
    var automated GUIVertImageListBox CharList[4];

    I have coded the vert boxes to be dynamic.

    The CharList works out the "goldeneye players" using class'xUtil'.static.GetPlayerList(PlayerList); and dynamically updates the
    CharList[1].WinWidth = CharList[1].WinWidth * CharList[1].ItemCount(); by the number of returned "goldeneye players"

    The problem i have is this obviously makes the width of this vert box huge, and it grows off the screen.

    I want to stick this control into a windowed control (like a panel in .net) that basically acts like an imagebox setting the x and y bounds of the visible area but allowing the vert box to keep its size.

    the vert box that is outside of these bounds however is hidden.

    to the point, i can't see any classes that do this in unreal tournament 2k4.

    Does anyone have any code/samples where this sort of behavor happens?

    Thanks in advance

    #2
    I happen to be working on something similar. While I may not have a definitive answer to give you. I'll be glad to work with you to solve it.

    If I understand you correctly, you'd like a panel in your GUIPage, definable in screensize, where within you can have your vertical list of players and if the list goes beyond the size of the panel, they are not seen. Is that the goal? If not, can you revise that description?

    An example of something similar in UT: Off the top of my head, I'm thinking of the gametype options screens (Game Rules tab), where various gametypes can specify a number of different config elements. They're grouped into sections like Bots, Game, Rules, etc. and the user can click "Advanced Options" to show more/less. When the list grows too big for the screen, a scoll bar appears. (as it does for maplists, etc) If I've got your goal description correct, did I hit on an example that can relate to it?

    Comment


      #3
      yes; only i want it to be horizontal not vertical...

      Comment


        #4
        ok well im excited, i looked at it in ut2k4, it sizes properly, its called GUIMultiOptionListBox...

        gonna be a codemonkey for a while..

        Comment


          #5
          Oh "width". Well, I probably would've pointed out a different UT2k4 config menu as an example then: the Bot selection, character selection screens where you have left/right arrows, not a scroll bar.

          Okay, yeah. GUI2k4.GUIMultiOptionListBox, an eventual subclass of XInterface.GUIVertList. Luckily, there's also an XInterface.GUIHorzList.

          I'm not "up to speed" on GUI stuff yet; that's my weak point atm. But, from what I saw in the class tree, there's a few "Multi"-named classes that looked most like what you should be going for. (I just didn't feel confident enough to suggest that right off) I'd be interested to hear progress. Once I get through that point in the project I'm on, I'll do the same.

          Good luck, intrepid code monkey!

          Comment


            #6
            ok since its now annoying me il post what i have. i have added the control into a panel, i hope it will hide when i try and hide parts of my listbox...


            // ================================================== ==================
            // Class: Goldeneye.GoldeneyeImagePanel
            // Parent: UT2K4UI.GUIMenuOption
            //
            // Image Panel designed to be a window for a control
            // ================================================== ==================

            class GoldeneyeImagePanel extends GUIMenuOption;

            var(GUIVertImageListBox) editconst noexport GUIVertImageListBox MyGUIVertImageListBox;

            function InitComponent(GUIController MyController, GUIComponent MyOwner)
            {
            Super.Initcomponent(MyController, MyOwner);
            }

            function Initalise(GUIVertImageListBox myListBox, GUIVertImageList myImageList)
            {
            MyGUIVertImageListBox = GUIVertImageListBox(MyComponent);
            MyGUIVertImageListBox.Hint = myListBox.Hint;
            MyGUIVertImageListBox.CellStyle = myListBox.CellStyle;
            MyGUIVertImageListBox.HorzBorder = myListBox.HorzBorder;
            MyGUIVertImageListBox.VertBorder = myListBox.VertBorder;
            MyGUIVertImageListBox.ImageScale = myListBox.ImageScale;
            MyGUIVertImageListBox.NoVisibleCols = myListBox.NoVisibleCols;
            MyGUIVertImageListBox.NoVisibleRows = myListBox.NoVisibleRows;
            MyGUIVertImageListBox.List.LoadFrom(myImageList, true);
            }

            defaultproperties
            {
            ComponentClassName="XInterface.GUIVertImageListBox "
            }




            instantiate an automated version of the above in your code

            create var automated GUIVertImageListBox CharList and set it up accordingly


            add this line

            PlayerOnePanel.Initalise(CharList, CharList.List);


            seems to pass everything though, but the image size seems huge. im betting its unreal code going on there...

            Comment


              #7
              Originally posted by TOP-Proto View Post
              ...seems to pass everything though, but the image size seems huge. im betting its unreal code going on there...
              I'd have to see how MyGUIVertImageListBox.List.LoadFrom() actually loads.

              ...

              It all seems to go back to XInterface.GUITreeList, where it does an AddItem(). I don't see any parameters to scale the image. And come to think of it, I'm not sure I've seen too much image resizing in the UT2004 menus. What images there are (IIRC) are displayed at res.

              Sorry, I'm just starting to look at this now. I'll report back when I find more useful info.

              Comment


                #8
                The instances I can think of where images are scaled (not counting the use of MipMaps, of course) are the level screenshot and gametype screenshot images in the UT2k4 menus. IIRC, those two are resized to fit that image space. I don't have time to look at that code atm, but I thought I'd mention it to you.

                Comment


                  #9
                  XInterface.GUIComponent (the original actor you asked about) has some scaling code, if you're still looking for that. Specifically in GUIComponent, I see bScaleToParent. (Actually, I saw some more Java-like stuff in the custom code of the project I'm "inheriting", which has very easy U and V properties. I might be able to recreate it outside of work.)

                  How's it going?

                  Comment


                    #10
                    the scaling is for the control or for images, it stretches the control (and image) or it gives you a letterbox of part of an image. since the vertpicbox is a listbox array of images, both methods are useless for this task

                    resizing the imagelistbox is a hack at best and it doesnt work too well anyway.

                    i am going to have to code this another way.. i will probably use 3 image boxes and do some manual animation. thing is i already coded the animation onto the list box so it smooth scrolled for me. means i got to rewrite that now hehe

                    Comment


                      #11
                      I wonder if UT2K4UI.GUISplitter would be any help in your situation.
                      Code:
                      //	GUISplitters allow the user to size two other controls (usually Panels)

                      Comment

                      Working...
                      X