Staredit Network > Forums > SC2 Assistance > Topic: Custom UI as default?
Custom UI as default?
Nov 29 2013, 11:29 pm
By: payne  

Nov 29 2013, 11:29 pm payne Post #1

:payne:

www.galaxywiki.net/Custom_UI

How can I make my Custom UI default?
As it is, here is my code:
Code
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Desc>
   <Frame type="CommandPanel" name="GameUI/UIContainer/ConsoleUIContainer/CommandPanel" file="GameUI">
     <BatchImages val="true"/>
     <BatchText val="true"/>        
     <Anchor side="Bottom" relative="$parent" pos="Max" offset="0"/>
     <Anchor side="Left" relative="$parent" pos="Mid" offset="-600"/>
     <Anchor side="Right" relative="$parent" pos="Mid" offset="600"/>
     <Width val="385"/>
     <Height val="130"/>
        <Frame type="CommandTooltip" name="CommandTooltip">
            <Anchor side="Bottom" relative="$parent" pos="Max" offset="-130"/>
            <Anchor side="Right" relative="$parent" pos="Mid" offset="220"/>
        </Frame>
        <Frame type="CommandButton" name="CommandButton00" template="CommandButton/CommandButtonTemplate">
            <Anchor side="Top" relative="$parent" pos="Min" offset="30"/>
            <Anchor side="Left" relative="$parent" pos="Min" offset="#CommandButtonGap"/>
        </Frame>
        <Frame type="CommandButton" name="CommandButton05" template="CommandButton/CommandButtonTemplate">
            <Visible val='False'/>
            <Anchor side="Top" relative="$parent/CommandButton00" pos="Min" offset="0"/>
            <Anchor side="Left" relative="$parent/CommandButton00" pos="Max" offset="#CommandButtonGap"/>
        </Frame>
        <Frame type="CommandButton" name="CommandButton10" template="CommandButton/CommandButtonTemplate">
            <Visible val='False'/>
            <Anchor side="Top" relative="$parent/CommandButton05" pos="Min" offset="0"/>
            <Anchor side="Left" relative="$parent/CommandButton05" pos="Max" offset="#CommandButtonGap"/>
        </Frame>
   </Frame>

   <Frame type="Frame" name="GameUI/UIContainer/ConsoleUIContainer/MenuBarConsoleAnchor">
       <Anchor side="Top" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Left" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Bottom" relative="$parent/$parent/$parent" pos="Max" offset="-600"/>
       <Anchor side="Right" relative="$parent/$parent/$parent" pos="Max" offset="-50"/>
   </Frame>

   <Frame type="ChatBar" name="GameUI/UIContainer/ConsoleUIContainer/ChatBar" template="ChatBar/ChatBarTemplate">
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="-280"/>
       <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       <Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
   </Frame>

   <Frame type="MessageDisplay" name="GameUI/UIContainer/ConsoleUIContainer/ChatDisplay" template="StandardTemplates/StandardMessageDisplayTemplate">
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="-380"/>
       <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       <Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
       <Width val="720"/>
       <Height val="300"/>
       <Style val="ChatDisplay"/>
   </Frame>
</Desc>


It isn't really what I actually want, but it is a draft that I used to do some testings. And when I load the map, the GameUI is still the one used. How do I make mine the default one?

What I would actually like to have would be certain Command Card's buttons, the chat message box and the chat message-entry box. The HP and the Energy would also have to be displayed. All the rest is pretty much superfluous.



None.

Nov 30 2013, 2:41 am Ahli Post #2

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

You are missing the following code in every outer frame that should edit the original frames:
Code
file="GameUI"


UI modification is only indirectly possible. That's why you need to use an existing path for your frame and a file as an entry point.
For example, the following code opens the CommandPanel which can be edited then.
Code
<Frame type="CommandPanel" name="GameUI/UIContainer/ConsoleUIContainer/CommandPanel" file="GameUI">


If you don't specify a file, you are creating a template. Templates can be used by other frames which receive a copy of the code of the template.

-------------

Btw, applying the default templates again usually has no effect. The elements that the template alters usually already have the values from the template as your own modifications are processed after the default UI has been constructed. So, you only need to apply your changes from the default and not re-apply values the default UI uses. Well, you can, but it doesn't make any difference.
So, in your code, you can delete all template="..." occurrences.




Nov 30 2013, 4:14 am payne Post #3

:payne:

It seems like this needs an update then: http://www.galaxywiki.net/Custom_UI#UI_Editor
It doesn't mention the "file=..." thing, and includes the "template=..." thing. :/

Anyways. Current code:
Code
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Desc>
  <Frame type="CommandPanel" name="GameUI/UIContainer/ConsoleUIContainer/CommandPanel" file="GameUI">
    <BatchImages val="true"/>
    <BatchText val="true"/>        
    <Anchor side="Bottom" relative="$parent" pos="Max" offset="0"/>
    <Anchor side="Left" relative="$parent" pos="Mid" offset="-600"/>
    <Anchor side="Right" relative="$parent" pos="Mid" offset="600"/>
    <Width val="385"/>
    <Height val="130"/>
       <Frame type="CommandTooltip" name="CommandTooltip">
           <Anchor side="Bottom" relative="$parent" pos="Max" offset="-130"/>
           <Anchor side="Right" relative="$parent" pos="Mid" offset="220"/>
       </Frame>
       <Frame type="CommandButton" name="CommandButton00" template="CommandButton/CommandButtonTemplate">
           <Anchor side="Top" relative="$parent" pos="Min" offset="30"/>
           <Anchor side="Left" relative="$parent" pos="Min" offset="#CommandButtonGap"/>
       </Frame>
       <Frame type="CommandButton" name="CommandButton05" template="CommandButton/CommandButtonTemplate">
           <Visible val='False'/>
           <Anchor side="Top" relative="$parent/CommandButton00" pos="Min" offset="0"/>
           <Anchor side="Left" relative="$parent/CommandButton00" pos="Max" offset="#CommandButtonGap"/>
       </Frame>
       <Frame type="CommandButton" name="CommandButton10" template="CommandButton/CommandButtonTemplate">
           <Visible val='False'/>
           <Anchor side="Top" relative="$parent/CommandButton05" pos="Min" offset="0"/>
           <Anchor side="Left" relative="$parent/CommandButton05" pos="Max" offset="#CommandButtonGap"/>
       </Frame>
  </Frame>

  <Frame type="Frame" name="GameUI/UIContainer/ConsoleUIContainer/MenuBarConsoleAnchor" file="GameUI">
      <Anchor side="Top" relative="$this" pos="Min" offset="0"/>
      <Anchor side="Left" relative="$this" pos="Min" offset="0"/>
      <Anchor side="Bottom" relative="$parent/$parent/$parent" pos="Max" offset="-600"/>
      <Anchor side="Right" relative="$parent/$parent/$parent" pos="Max" offset="-50"/>
  </Frame>

  <Frame type="ChatBar" name="GameUI/UIContainer/ConsoleUIContainer/ChatBar" file="GameUI">
      <Anchor side="Bottom" relative="$parent" pos="Max" offset="-280"/>
      <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
      <Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
  </Frame>

  <Frame type="MessageDisplay" name="GameUI/UIContainer/ConsoleUIContainer/ChatDisplay" file="GameUI">
      <Anchor side="Bottom" relative="$parent" pos="Max" offset="-380"/>
      <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
      <Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
      <Width val="720"/>
      <Height val="300"/>
      <Style val="ChatDisplay"/>
  </Frame>
</Desc>


Errors that I get:
Code
[11/29/2013 10:59:47 PM] UI: File [DescIndex.SC2Layout] Line [3] Column [5]. Failed to load included Desc File [UI/Layout/NewUI.SC2Layout].
[11/29/2013 11:06:08 PM] UI: File [NewUI.SC2Layout] Line [36] Column [4]. Failed to locate specified Desc [GameUI/UIContainer/ConsoleUIContainer/MenuBarConsoleAnchor].
[11/29/2013 11:06:08 PM] UI: File [NewUI.SC2Layout] Line [36] Column [4]. Could not find Frame Desc [GameUI/UIContainer/ConsoleUIContainer/MenuBarConsoleAnchor] in File Desc [GameUI].
[11/29/2013 11:06:08 PM] UI: File [NewUI.SC2Layout] Line [42] Column [4]. Failed to locate specified Desc [GameUI/UIContainer/ConsoleUIContainer/ChatBar].
[11/29/2013 11:06:08 PM] UI: File [NewUI.SC2Layout] Line [42] Column [4]. Could not find Frame Desc [GameUI/UIContainer/ConsoleUIContainer/ChatBar] in File Desc [GameUI].
[11/29/2013 11:06:08 PM] UI: File [NewUI.SC2Layout] Line [51] Column [4]. Failed to locate specified Desc [GameUI/UIContainer/ConsoleUIContainer/ChatDisplay].
[11/29/2013 11:06:08 PM] UI: File [NewUI.SC2Layout] Line [51] Column [4]. Could not find Frame Desc [GameUI/UIContainer/ConsoleUIContainer/ChatDisplay] in File Desc [GameUI].
[11/29/2013 11:06:08 PM] UI: File [NewUI.SC2Layout] Line [2] Column [1]. Attempting to add a desc named [NewUI] to [] with the same as an already existing child.

The first line appeared as an error in the "Messages" box that comes from the Editor. The last line appeared as an Error Message classified as UI during the test of the game. All the lines in-between showed up in both those windows.
Also, it seems like I can only open the chat entry-box, type in it, but not send the message itself: I can only close the box by cancelling with the Esc button.

And other question: does the structure matter? That is, if I'd write a code like that, would it mess it all up (missing spaces at the beginning of lines):
Code
  <Frame type="ChatBar" name="GameUI/UIContainer/ConsoleUIContainer/ChatBar" file="GameUI">
<Anchor side="Bottom" relative="$parent" pos="Max" offset="-280"/>
<Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
<Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
  </Frame>


EDIT: I had forgotten to remove certain "tempplate=...", and now that I did, I don't get any UI-errors anymore. Which is weird because the errors were related to the frames that already didn't have the "template=..." in them.
EDIT: Even weirder: retesting with the same code again, I then get the same errors once again. And then re-re-testing gave me only 2 errors (saying "Failed to load included Desc file").

EDIT: This is getting very frustrating. After over an hour of messing around with different values for positioning the frame and trying to make some of them invisible, nothing's been working like I've intended it to.
Here is the code as it is now:
Code
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Desc>
   <Frame type="CommandPanel" name="GameUI/UIContainer/ConsoleUIContainer/CommandPanel" file="GameUI">
       <BatchImages val="true"/>
       <BatchText val="true"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="0"/>
       <Anchor side="Left" relative="$parent" pos="Mid" offset="-600"/>
       <Anchor side="Right" relative="$parent" pos="Mid" offset="600"/>
       <Width val="1700"/>
       <Height val="250"/>
       <Frame type="CommandTooltip" name="CommandTooltip">
           <Anchor side="Bottom" relative="$parent" pos="Max" offset="-130"/>
           <Anchor side="Right" relative="$parent" pos="Mid" offset="220"/>
       </Frame>

       <Frame type="CommandButton" name="CommandButton00">
           <Visible val="false"/>
           <Anchor side="Top" relative="$parent" pos="Min" offset="0"/>
           <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       </Frame>

       <Frame type="CommandButton" name="CommandButton05">
           <Anchor side="Top" relative="$parent" pos="Min" offset="100"/>
           <Anchor side="Left" relative="$parent" pos="Mid" offset="200"/>
       </Frame>

       <Frame type="CommandButton" name="CommandButton10">
           <Anchor side="Top" relative="$parent" pos="Min" offset="100"/>
           <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       </Frame>
   </Frame>

   <Frame type="Frame" name="GameUI/UIContainer/ConsoleUIContainer/MenuBarConsoleAnchor" file="GameUI">
       <Visible val="false"/>
       <Anchor side="Top" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Left" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Bottom" relative="$parent/$parent/$parent" pos="Max" offset="-450"/>
       <Anchor side="Right" relative="$parent/$parent/$parent" pos="Max" offset="-30"/>
   </Frame>

   <Frame type="ChatBar" name="GameUI/UIContainer/ConsoleUIContainer/ChatBar" file="GameUI">
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="-370"/>
       <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       <Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
   </Frame>

   <Frame type="MessageDisplay" name="GameUI/UIContainer/ConsoleUIContainer/ChatDisplay" file="GameUI">
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="-250"/>
       <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       <Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
       <Width val="720"/>
       <Height val="300"/>
       <Style val="ChatDisplay"/>
   </Frame>
</Desc>


All I am trying to do is hide the first line of the command card (Move, Stop, etc.), and center the 2 other lines at the bottom of the screen, both next to each other horizontally, with the second line being to the right and the third line to the left.
After that, I want everything else gone, except for the Health and the Energy, which I'd like to see displayed centered just overtop of that 'rearranged command card'.
Lastly, I want the whole chat thing to be moved toward the bottom as well.

Goal of it all: create more space in the screen so players can see more of the field.
This means that that damn black bar that seems to stay when you Hide 'Game UI' with triggers must go too (bare in mind, 'Game UI' will not be hidden anymore once that new Layout is done since it is overwriting Game UI and I want it to be seen... which means the Layout itself should make all the rest of the UIs invisible).

Post has been edited 3 time(s), last time on Nov 30 2013, 5:42 am by payne.



None.

Nov 30 2013, 9:27 pm payne Post #4

:payne:

Here is what I am trying to do, basically:



The X's are just players on the field, and the black dot is the ball (it's a soccer game).

The bigger squares are abilities from the Command Card: 'ZXCV' are the ones on the third line of the Command Card, 'FG' are on the last (and the only) two buttons of the second line, and 'H' is the Hold Position (third button on the first line I think?).
The Red/Blue numbers are Health and Energy values. The smaller squares (to the left) and the rectangles (to the right) are all Dialog Items, so we don't need to worry about them in terms of the UI Layout: they'll be moved via Triggers.



None.

Nov 30 2013, 10:02 pm Ahli Post #5

I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.

"MenuBarConsoleAnchor" is part of "FullscreenUpperContainer" and not "ConsoleUIContainer".
It's the same problem for the others.

The black bar information in the wiki is plain wrong. The black bar on the screen is removed like this:
Code
   <Frame type="GameUI" name="GameUI" file="GameUI">
       <ConsoleWorldBottomOffset val="0"/>
   </Frame>


For the command buttons, you might need to move the first buttons offscreen. But you can just edit the anchors of the other buttons to make them appear where you want.

Life and Energy values is hardcoded to be below the wireframe, if the unit has no shields. So, you need to make the wireframe invisible and move that around instead of the labels as that won't work properly. The reason for that behavior is "old code" according to Blizzard's editor programmer. So, one day that might change.

Also, you cannot hide everything from the default ConsoleUIContainer, but don't forget that you can always move things offscreen that you can't hide. For example, I had problems hiding the "stubs" and the portrait panel in the past. So, these were elements that I just moved offscreen.




Nov 30 2013, 11:58 pm payne Post #6

:payne:

Solved! Thanks to Ahli!

Here is the code I currently have, with comments.

Code
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Desc>
   <!-- Gets rid of the black bar at the bottom of the screen -->
   <Frame type="GameUI" name="GameUI" file="GameUI">
       <ConsoleWorldBottomOffset val="0"/>
   </Frame>

   <!-- Gets rid of the unclickable region which is left when the black bar is removed -->
   <Frame type="ConsolePanel" name="GameUI/UIContainer/ConsolePanel" file="GameUI">
       <Anchor side="Left" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Top" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Right" relative="$parent" pos="Max" offset="9999"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="9999"/>
   </Frame>

   <!-- Gets rid of the Minimap -->
   <Frame type="MinimapPanel" name="GameUI/UIContainer/ConsoleUIContainer/MinimapPanel" file="GameUI">
       <Anchor side="Left" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Right" relative="$this" pos="Min" offset="9999"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="9999"/>
   </Frame>

   <!-- Gets rid of the Mission Time that is usually just above the minimap -->
   <Frame type="MissionTimePanel" name="GameUI/UIContainer/ConsoleUIContainer/MissionTimePanel" file="GameUI">
       <Anchor side="Right" relative="$parent" pos="Max" offset="9999"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="9999"/>
   </Frame>

   <!-- Gets rid of the Resources -->
   <Frame type="ResourcePanel" name="GameUI/UIContainer/FullscreenUpperContainer/ResourcePanel" file="GameUI">
       <Anchor side="Right" relative="$parent" pos="Max" offset="9999"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="9999"/>
   </Frame>

   <!-- Gets rid of the Unit Info -->
   <Frame type="InfoPanel" name="GameUI/UIContainer/ConsoleUIContainer/InfoPanel" file="GameUI">
       <Anchor side="Left" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Top" relative="$this" pos="Min" offset="0"/>
       <Anchor side="Right" relative="$parent" pos="Max" offset="9999"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="9999"/>
       <Width val="700"/>
   </Frame>

   <!-- Moves the Menu/Friends buttons to the Bottom-Right of the screen -->
   <Frame type="Frame" name="GameUI/UIContainer/FullscreenUpperContainer/MenuBarConsoleAnchor" file="GameUI">
       <Anchor side="Right" relative="$parent" pos="Max" offset="0"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="0"/>
   </Frame>

   <!-- Moves the buttons of the command card -->
   <Frame type="CommandPanel" name="GameUI/UIContainer/ConsoleUIContainer/CommandPanel" file="GameUI">
       <BatchImages val="true"/>
       <BatchText val="true"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="0"/>
       <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       <Anchor side="Right" relative="$parent" pos="Mid" offset="0"/>
       <Width val="1700"/>
       <Height val="200"/>
       <Frame type="CommandTooltip" name="CommandTooltip">
           <Anchor side="Bottom" relative="$parent" pos="Max" offset="-130"/>
           <Anchor side="Right" relative="$parent" pos="Mid" offset="220"/>
       </Frame>

       <Frame type="Image" name="CommandTargetImage">
           <Anchor side="Bottom" relative="$parent" pos="Max" offset="9999"/>
           <Anchor side="Right" relative="$parent" pos="Mid" offset="9999"/>
       </Frame>

       <Frame type="CommandButton" name="CommandButton00">
           <Anchor side="Top" relative="$parent" pos="Min" offset="9999"/>
           <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       </Frame>

       <Frame type="CommandButton" name="CommandButton05">
           <Anchor side="Top" relative="$parent" pos="Min" offset="50"/>
           <Anchor side="Left" relative="$parent" pos="Mid" offset="-140"/>
       </Frame>

       <Frame type="CommandButton" name="CommandButton10">
           <Anchor side="Top" relative="$parent" pos="Min" offset="50"/>
           <Anchor side="Left" relative="$parent" pos="Mid" offset="-240"/>
       </Frame>

       <Frame type="CommandButton" name="CommandButton14">
           <Anchor side="Top" relative="$parent" pos="Min" offset="9999"/>
           <Anchor side="Left" relative="$parent" pos="Mid" offset="-285"/>
       </Frame>
   </Frame>

   <!-- Moves the Chat area -->
   <Frame type="MessageDisplay" name="GameUI/UIContainer/FullscreenUpperContainer/ChatDisplay" file="GameUI">
       <Anchor side="Left" relative="$parent" pos="Mid" offset="0"/>
       <Anchor side="Bottom" relative="$parent" pos="Max" offset="-170"/>
   </Frame>
</Desc>




EDIT: As a result, I quickly updated the GalaxyEditor's page, but somehow there is a bug that prevents the code from showing properly.
http://www.galaxywiki.net/Custom_UI#MOBA_Command_Card

Post has been edited 3 time(s), last time on Dec 1 2013, 3:34 am by payne.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[11:56 pm]
Vrael -- Slyence
Slyence shouted: Hello world.
He stared into the Void, and the Void said "no u"
[2021-11-28. : 5:29 pm]
lil-Inferno -- ya
[2021-11-28. : 1:17 pm]
Slyence -- Hello world.
[2021-11-27. : 8:19 pm]
UndeadStar -- 🌱 :wob: :wob: :wob: 🌱
[2021-11-27. : 5:32 pm]
Slyence -- I'd say I'd have to agree.
[2021-11-26. : 10:44 pm]
Ultraviolet -- 1337 ejaculator
[2021-11-26. : 10:29 pm]
ejac1337 -- derp
[2021-11-26. : 7:08 pm]
Slyence -- Well shucks ..
[2021-11-26. : 4:02 am]
O)FaRTy1billion[MM] -- Slyence
Slyence shouted: I could've swore I used to have a colored username.
probably, they did get reset at some point
[2021-11-26. : 4:02 am]
Apos -- :wob:
Please log in to shout.


Members Online: Roy, DaMnUFo0