forked from picocode1/LUA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
[GAMESENSE] - PanoramaButton.lua
47 lines (41 loc) · 1.21 KB
/
[GAMESENSE] - PanoramaButton.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
local js = panorama.loadstring([[
var panel
var _Create = function(layout) {
var parent = $.GetContextPanel().FindChildTraverse("JsMainMenuNavBar")
panel = $.CreatePanel("Panel", parent, "CustomPanel")
if(!panel)
return
if(!panel.BLoadLayoutFromString(layout, false, false))
return
parent.MoveChildBefore(panel, parent.GetChild(14))
}
var _Destroy = function() {
if(panel != null) {
panel.RemoveAndDeleteChildren()
panel.DeleteAsync(0.0)
panel = null
}
}
return {
create: _Create,
destroy: _Destroy,
}
]], "CSGOMainMenu")()
local layout = [[
<root>
<Panel class="vertical-align-middle horizontal-center">
<RadioButton id="CustomPanel"
onactivate="$.DispatchEvent('PlaySoundEffect', 'mainmenu_press_GO', 'MOUSE' );
GameInterfaceAPI.ConsoleCommand('connect 149.202.86.115:27015');"
oncancel="MainMenu.OnEscapeKeyPressed();"
onmouseover="UiToolkitAPI.ShowTextTooltip( 'CustomPanel', 'JOIN PICOWARE HVH');"
onmouseout="UiToolkitAPI.HideTextTooltip();">
<Image textureheight="42" texturewidth="-1" src="file://{images}/icons/ui/servers.svg" />
</RadioButton>
</Panel>
</root>
]]
js.create(layout)
client.set_event_callback("shutdown", function()
js.destroy()
end)