def shortcutWnd = xdat.windows["ShortcutWnd"]
shortcutWnd.children.add(makeShortcutWnd(4, true))
shortcutWnd.children.add(makeShortcutWnd(5, true))
shortcutWnd.children.add(makeShortcutWnd(4, false))
shortcutWnd.children.add(makeShortcutWnd(5, false))
def makeShortcutWnd(int num, boolean isVertical)
{
def wnd = new Window()
wnd.name = (isVertical ? "ShortcutWndVertical_" : "ShortcutWndHorizontal_") + num
wnd.parentName = "ShortcutWnd"
// DefaultProperty
wnd.anchored = false
wnd.superChild = true
wnd.size = true
wnd.size_absolute_width = isVertical ? 46 : 512
wnd.size_absolute_height = isVertical ? 506 : 46
wnd.usePosition = true
wnd.relativePoint = isVertical ? Alignment.CENTER_RIGHT : Alignment.BOTTOM_RIGHT
wnd.anchorPoint = isVertical ? Alignment.CENTER_RIGHT : Alignment.BOTTOM_RIGHT
wnd.anchor_y = isVertical ? 39 : 0
// Window
wnd.parent = "undefined"
wnd.script = "undefined"
wnd.state = "undefined"
wnd.backTex = isVertical ? "L2UI_CT1.Windows_DF_Small_Bg" : "L2UI_CT1.Windows_DF_Small_Vertical_Bg"
wnd.frame = true
wnd.stuckable = isVertical
wnd.exitbutton = false
wnd.hidden = true
wnd.alwaysFullAlpha = true
wnd.frameSize = Window.FrameSizeType.Small
wnd.frameDirection = isVertical ? Window.DirectionType.Top : Window.DirectionType.Left
wnd.movable = true
wnd.drawerDirection = isVertical ? Window.DirectionType.Left : Window.DirectionType.Top
wnd.directionFixed = true
wnd.ownerWindow = (isVertical ? "ShortcutWndVertical_" : "ShortcutWndHorizontal_") + (num - 1)
wnd.workingConfiguration = "Game"
wnd.additionalState = javafx.collections.FXCollections.EMPTY_OBSERVABLE_LIST
// children
int prevBtnSize1 = isVertical ? 1 : 32
int prevBtnSize2 = isVertical ? 17 : 17
wnd.children.add(makeButton("PrevBtn" + (num+1), wnd.name, prevBtnSize1, prevBtnSize2, "L2UI_CH3.ShortcutWnd.shortcut_prev" + (isVertical ? "" : "v"), "L2UI_CH3.ShortcutWnd.shortcut_" + (isVertical ? "prev_down" : "nextv_down"), isVertical))
int nextBtnSize1 = isVertical ? 31 : 1
int nextBtnSize2 = isVertical ? 17 : 17
wnd.children.add(makeButton("NextBtn" + (num+1), wnd.name, nextBtnSize1, nextBtnSize2, "L2UI_CH3.ShortcutWnd.shortcut_next" + (isVertical ? "" : "v"), "L2UI_CH3.ShortcutWnd.shortcut_" + (isVertical ? "next_down" : "nextv_down"), isVertical))
int bakdropSize1 = isVertical ? 6 : 7
int bakdropSize2 = isVertical ? 35 : 36
int bakdropSize3 = isVertical ? 5 : 7
for(int i = 0; i < 12; i++)
wnd.children.add(makeTexture("bakdrop" + (i + 1), wnd.name, 36, 36, bakdropSize1, bakdropSize2 + i * 37 + ((int)(i / 4) * bakdropSize3), "l2ui_ct1.ItemWindow_DF_SlotBox_2x2", isVertical))
if(isVertical)
{
def slotGuropeBox = makeTexture("SlotGuropeBox", wnd.name, 46, 256, 0, 184, "l2ui_ct1.ShortCutWnd.ShortcutWnd_df_slotgroupboxv", isVertical);
slotGuropeBox.virtual = true
slotGuropeBox.alwaysOnBack = true
wnd.children.add(slotGuropeBox)
}
else
{
def bakdrop13 = makeTexture("bakdrop13", wnd.name, 46, 156, 0, 187, "l2ui_ct1.ShortcutWnd.ShortcutWnd_DF_SlotGroupBox", isVertical)
bakdrop13.virtual = true
bakdrop13.alwaysOnBack = true
wnd.children.add(bakdrop13 )
}
def numberBG = makeTexture("NumberBG", wnd.name, 47, 17, 0, 15, "l2ui_ct1.ShortCutWnd.ShortcutWnd_DF_NumberGroupBox", isVertical);
numberBG.virtual = true
numberBG.alwaysOnBack = true
numberBG.type = Texture.TextureCtrlType.Stretch
wnd.children.add(numberBG)
wnd.children.add(makeTextBox(wnd.name, isVertical))
int shortcutSize = isVertical ? 35 : 37
int shortcutSize1 = isVertical ? 5 : 7
wnd.children.add(makeShortcut("Shortcut1", "undefined", wnd.name, 36, 36, 7, shortcutSize, isVertical))
for(int i = 1; i < 12; i++)
{
wnd.children.add(makeShortcut("Shortcut" + (i+1), "Shortcut1", wnd.name, 0, 0, 7, shortcutSize + i * 37 + ((int)(i / 4) * shortcutSize1), isVertical))
}
return wnd;
}
def makeTexture(String name, String parentName, int size_absolute_width, int size_absolute_height, int anchor_x, int anchor_y, String file, boolean isVertical)
{
def bakdrop = new Texture()
bakdrop.name = name
bakdrop.parentName = parentName
bakdrop.anchored = true
bakdrop.superChild = true
bakdrop.size = true
bakdrop.size_absolute_values = true
bakdrop.usePosition = true
bakdrop.size_absolute_width = isVertical ? size_absolute_width : size_absolute_height
bakdrop.size_absolute_height = isVertical ? size_absolute_height : size_absolute_width
bakdrop.relativePoint = Alignment.TOP_LEFT
bakdrop.anchorPoint = Alignment.TOP_LEFT
bakdrop.anchor_x = isVertical ? anchor_x : anchor_y
bakdrop.anchor_y = isVertical ? anchor_y : anchor_x
bakdrop.file = file
bakdrop.layer = Texture.TextureLayer.Background
bakdrop.alpha = -9999
return bakdrop;
}
def makeButton(String name, String parentName, int anchor_x, int anchor_y, String normalTex, String pushedTex, boolean isVertical)
{
def btn = new Button()
btn.name = name
btn.parentName = parentName
btn.anchored = true
btn.superChild = true
btn.size = true
btn.size_absolute_values = true
btn.usePosition = true
btn.size_absolute_width = 14
btn.size_absolute_height = 14
btn.relativePoint = Alignment.TOP_LEFT
btn.anchorPoint = Alignment.TOP_LEFT
btn.anchor_x = isVertical ? anchor_x : anchor_y
btn.anchor_y = isVertical ? anchor_y : anchor_x
btn.normalTex = normalTex
btn.pushedTex = pushedTex
btn.buttonNameText = "undefined"
return btn;
}
def makeTextBox(String parentName, boolean isVertical)
{
def prop = new TextBox()
prop.name = "PageNumTextBox"
prop.parentName = parentName
prop.anchored = true
prop.superChild = true
prop.size = true
prop.size_absolute_values = true
prop.size_absolute_width = isVertical ? 20 : 18
prop.size_absolute_height = isVertical ? 14 : 18
prop.usePosition = true
prop.relativePoint = isVertical ? Alignment.TOP_CENTER : Alignment.TOP_LEFT
prop.anchorPoint = isVertical ? Alignment.TOP_CENTER : Alignment.TOP_LEFT
prop.anchor_x = isVertical ? 0 : 15
prop.anchor_y = isVertical ? 17 : 17
prop.text = isVertical ? "1" : "undefined"
prop.textAlign = TextBox.TextAlign.Center
prop.textColor = Color.rgb(220, 220, 220, 0)
return prop;
}
def makeShortcut(String name, String extendsName, String parentName, int size_absolute_width, int size_absolute_height, int anchor_x, int anchor_y, boolean isVertical)
{
def shortcut = new ShortcutItemWindow()
shortcut.name = name
shortcut.extendsName = extendsName
shortcut.parentName = parentName
shortcut.anchored = true
shortcut.superChild = true
shortcut.size_absolute_values = true
shortcut.usePosition = true
shortcut.size_absolute_width = size_absolute_width
shortcut.size_absolute_height = size_absolute_height
shortcut.anchorPoint = Alignment.TOP_LEFT
shortcut.anchor_x = isVertical ? anchor_x : anchor_y
shortcut.anchor_y = isVertical ? anchor_y : anchor_x
shortcut.tooltipType = "Shortcut"
if(size_absolute_width > 0)
{
shortcut.size = true
shortcut.relativePoint = Alignment.TOP_LEFT
}
return shortcut;
}
println "done!"