Stargrove
December 1st, 2024, 01:53
I have managed to muddle my way through part of creating an extension that will allow a person to enter text into two fields and press a button to pass those values to a function that does a web query for some information.
I have my popup working with some basic instructions and a button at the bottom of the popup. I have been unable to decipher the FGU API docs to figure out how to put some simple labels and the fields for the information I want to capture onto the popup and was hoping someone could help.
Here is my code for this thus far:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<windowclass name="UWPImport">
<frame>utilitybox</frame>
<sizelimits>
<minimum width="400" height="300" />
<dynamic />
</sizelimits>
<sheetdata>
<!-- Title -->
<windowtitlebar_utilitybox name="title">
<text>UWP Import Tool</text>
</windowtitlebar_utilitybox>
<windowmenubar_utilitybox name="menubar" />
<anchor_content_utilitybox_top />
<anchor_content_utilitybox_bottom />
<!-- Instructions -->
<stringc_content_framed_groupbox_top name="instructions">
<static>Enter the Sector and Hex location for the world, then click 'Retrieve'.
</static>
<readonly />
<nodrag />
</stringc_content_framed_groupbox_top>
<!-- Sector Label -->
<label name="sector_label">
<font>emotefont</font>
<bounds left="20" top="100" width="100" height="20" />
<text>Sector:</text>
</label>
<!-- Sector Input -->
<stringfield name="sector_input">
<bounds left="130" top="100" width="200" height="20" />
</stringfield>
<!-- Hex Label -->
<label name="hex_label">
<font>emotefont</font>
<bounds left="20" top="140" width="100" height="20" />
<text>Hex:</text>
</label>
<!-- Hex Input -->
<stringfield name="hex_input">
<bounds left="130" top="140" width="200" height="20" />
</stringfield>
<!-- Retrieve Button -->
<button_text_content_center_bottom name="retrievebutton">
<text>Retrieve</text>
<onClick>
local sector = window.getChild("sector_input").getValue();
local hex = window.getChild("hex_input").getValue();
UWPManager.retrieveWorldData(sector, hex);
</onClick>
</button_text_content_center_bottom>
</sheetdata>
</windowclass>
</root>
I get no errors in the console or anything once the popup comes up, so am not sure where to go. I have also tried <stringcontrol> in place of <stringfield> to no avail.
I have my popup working with some basic instructions and a button at the bottom of the popup. I have been unable to decipher the FGU API docs to figure out how to put some simple labels and the fields for the information I want to capture onto the popup and was hoping someone could help.
Here is my code for this thus far:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<windowclass name="UWPImport">
<frame>utilitybox</frame>
<sizelimits>
<minimum width="400" height="300" />
<dynamic />
</sizelimits>
<sheetdata>
<!-- Title -->
<windowtitlebar_utilitybox name="title">
<text>UWP Import Tool</text>
</windowtitlebar_utilitybox>
<windowmenubar_utilitybox name="menubar" />
<anchor_content_utilitybox_top />
<anchor_content_utilitybox_bottom />
<!-- Instructions -->
<stringc_content_framed_groupbox_top name="instructions">
<static>Enter the Sector and Hex location for the world, then click 'Retrieve'.
</static>
<readonly />
<nodrag />
</stringc_content_framed_groupbox_top>
<!-- Sector Label -->
<label name="sector_label">
<font>emotefont</font>
<bounds left="20" top="100" width="100" height="20" />
<text>Sector:</text>
</label>
<!-- Sector Input -->
<stringfield name="sector_input">
<bounds left="130" top="100" width="200" height="20" />
</stringfield>
<!-- Hex Label -->
<label name="hex_label">
<font>emotefont</font>
<bounds left="20" top="140" width="100" height="20" />
<text>Hex:</text>
</label>
<!-- Hex Input -->
<stringfield name="hex_input">
<bounds left="130" top="140" width="200" height="20" />
</stringfield>
<!-- Retrieve Button -->
<button_text_content_center_bottom name="retrievebutton">
<text>Retrieve</text>
<onClick>
local sector = window.getChild("sector_input").getValue();
local hex = window.getChild("hex_input").getValue();
UWPManager.retrieveWorldData(sector, hex);
</onClick>
</button_text_content_center_bottom>
</sheetdata>
</windowclass>
</root>
I get no errors in the console or anything once the popup comes up, so am not sure where to go. I have also tried <stringcontrol> in place of <stringfield> to no avail.