Jump to content

Creating a UI Menu using XML


StealthDick

Recommended Posts

Hello,

I'm taking a crack at adding a one-off menu to the game that allows the player to set up their birthday. The only problem is, I don't have any experience with using XML. So, I've been looking at how other modders have done it in the past and looking over the documentation on the geckwiki.

The documentation I'm using:
https://geckwiki.com/index.php?title=Tutorial:_Understanding_XML

 

The mod I've been looking at (JIP Fast-Travel Anywhere):

https://www.nexusmods.com/newvegas/mods/52129

 

Here is the XML File I have cooked up:

<rect name="PlayerBirthdayMenu">
  <x>0</x>
  <y>0</y>
  <visible>false</visible>
  <width>800</width>
  <height>600</height>
  <systemcolor>nosystemcolor</systemcolor>

  <!-- Background image -->
  <image name="BackgroundImage">
    <filename>StealthDick\interface\background.dds</filename>
    <x>0</x>
    <y>0</y>
    <systemcolor>&hudmain;</systemcolor>
  </image>

  <!-- Title -->
  <text name="TitleText">
    <x>100</x>
    <y>50</y>
    <string>Player's birthday</string>
    <font>3</font>
    <size>24</size>
    <color>#FFFFFF</color>
  </text>

  <!-- Day -->
  <text name="DayText">
    <x>100</x>
    <y>100</y>
    <string>Day: 1</string>
    <font>3</font>
    <size>18</size>
    <color>#FFFFFF</color>
  </text>
  <button name="IncrementDayButton">
    <x>200</x>
    <y>100</y>
    <width>30</width>
    <height>30</height>
    <image>interface\shared\arrow\adjust_increase.dds</image>
    <systemcolor>&hudmain;</systemcolor>
  </button>
  <button name="DecrementDayButton">
    <x>240</x>
    <y>100</y>
    <width>30</width>
    <height>30</height>
    <image>interface\shared\arrow\adjust_decrease.dds</image>
    <systemcolor>&hudmain;</systemcolor>
  </button>

  <!-- Month -->
  <text name="MonthText">
    <x>100</x>
    <y>150</y>
    <string>Month: 1</string>
    <font>3</font>
    <size>18</size>
    <color>#FFFFFF</color>
  </text>
  <button name="IncrementMonthButton">
    <x>200</x>
    <y>150</y>
    <width>30</width>
    <height>30</height>
    <image>interface\shared\arrow\adjust_increase.dds</image>
    <systemcolor>&hudmain;</systemcolor>
  </button>
  <button name="DecrementMonthButton">
    <x>240</x>
    <y>150</y>
    <width>30</width>
    <height>30</height>
    <image>interface\shared\arrow\adjust_decrease.dds</image>
    <systemcolor>&hudmain;</systemcolor>
  </button>

  <!-- Year -->
  <text name="YearText">
    <x>100</x>
    <y>200</y>
    <string>Year: 2260</string>
    <font>3</font>
    <size>18</size>
    <color>#FFFFFF</color>
  </text>
  <button name="IncrementYearButton">
    <x>200</x>
    <y>200</y>
    <width>30</width>
    <height>30</height>
    <image>interface\shared\arrow\adjust_increase.dds</image>
    <systemcolor>&hudmain;</systemcolor>
  </button>
  <button name="DecrementYearButton">
    <x>240</x>
    <y>200</y>
    <width>30</width>
    <height>30</height>
    <image>interface\shared\arrow\adjust_decrease.dds</image>
    <systemcolor>&hudmain;</systemcolor>
  </button>

  <!-- Submit button -->
  <button name="SubmitButton">
    <x>100</x>
    <y>250</y>
    <width>80</width>
    <height>40</height>
    <image>interface\shared\button\frame_idle.dds</image>
    <systemcolor>&hudmain;</systemcolor>
  </button>
</rect>

I'm not sure if it works, mainly because I don't know how I'd toggle in within the game/geck.

I tried using SetUIFloatAlt "HUDMainMenu\PlayerBirthdayMenu\visible" 1, but it doesn't do anything.

 

I did use ChatGPT to make the XML file and I did make some additions to it to try to get it to work, but I'm certain that I've done something wrong somewhere.

If anyone has any idea what I've done wrong please let me know.

 

Thanks!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...