WarsmashModEngine/resources/Scripts/melee.jui
2020-07-05 10:39:43 -04:00

35 lines
1.2 KiB
Plaintext

globals
// Defaults for testing:
constant string SKIN = "NightElf"
// Major UI components
framehandle ROOT_FRAME
framehandle CONSOLE_UI
framehandle RESOURCE_BAR
endglobals
function main takes nothing returns nothing
// =================================
// Load skins and templates
// =================================
set ROOT_FRAME = CreateRootFrame(SKIN)
if not LoadTOCFile("UI\\FrameDef\\FrameDef.toc") then
call LogError("Unable to load FrameDef.toc")
endif
// =================================
// Load major UI components
// =================================
// Console UI is the background with the racial theme
set CONSOLE_UI = CreateSimpleFrame("ConsoleUI", ROOT_FRAME, 0)
// Resource bar is a 3 part bar with Gold, Lumber, and Food.
// Its template does not specify where to put it, so we must
// put it in the "TOPRIGHT" corner.
set RESOURCE_BAR = CreateSimpleFrame("ResourceBarFrame", CONSOLE_UI, 0)
call FrameSetAbsPoint(RESOURCE_BAR, FRAMEPOINT_TOPRIGHT, 0, 0)
// Assemble the UI and resolve the location of every component that
// has Anchors and SetPoints (maybe in future version this call
// wont be necessary!)
call FramePositionBounds(ROOT_FRAME)
endfunction