SelfGUI = {
staticimage = {}
}
function hideall ()
if isElement ( SelfGUI.staticimage[1] ) then
guiSetVisible ( SelfGUI.staticimage[1], false )
end
if isElement ( gWindow["handybg"] ) then
guiSetVisible ( gWindow["handybg"], false )
end
if isElement ( gWindow["plistadmin"] ) then
guiSetVisible ( gWindow["plistadmin"], false )
end
if isElement ( gWindow["rtext"] ) then
guiSetVisible ( gWindow["rtext"], false )
end
if isElement ( gWindow["bonusmenue"] ) then
guiSetVisible ( gWindow["bonusmenue"], false )
end
if isElement ( gWindow["anrufen"] ) then
guiSetVisible ( gWindow["anrufen"], false )
end
if isElement ( gWindow["sms"] ) then
guiSetVisible ( gWindow["sms"], false )
end
if isElement ( gWindow["handybg"] ) then
guiSetVisible ( gWindow["handybg"], false )
end
if isElement ( gWindow["friendlistMenue"] ) then
guiSetVisible ( gWindow["friendlistMenue"], false )
end
if isElement ( gWindow["stats"] ) then
guiSetVisible ( gWindow["stats"], false )
end
if isElement ( gWindow["settings"] ) then
guiSetVisible ( gWindow["settings"], false )
end
if isElement ( gWindow["selfAnimations"] ) then
guiSetVisible ( gWindow["selfAnimations"], false )
end
if isElement ( SelfGUI.staticimage[4] ) then
guiSetVisible ( SelfGUI.staticimage[4], false )
end
if isElement ( gWindow["suchtInfo"] ) then
guiSetVisible ( gWindow["suchtInfo"], false )
end
if isElement ( gWindow["socialRankSelection"] ) then
guiSetVisible ( gWindow["socialRankSelection"], false )
end
if isElement ( gWindow["spawnPointSelection"] ) then
guiSetVisible ( gWindow["spawnPointSelection"], false )
end
if isElement ( gWindow["achievmentList"] ) then
guiSetVisible ( gWindow["achievmentList"], false )
end
if isElement ( gWindow["radioOptions"] ) then
guiSetVisible ( gWindow["radioOptions"], false )
end
if isElement ( gWindow["radioOptions"] ) then
destroyElement ( gWindow["radioOptions"] )
end
--guiSetVisible ( optionsWindow, false )
guiSetInputEnabled ( true )
guiSetInputEnabled ( true )
saveNotes ()
end
function SelfAdminBtn ()
if getElementData ( lp, "adminlvl" ) >= 1 then
hideall ()
guiSetInputEnabled ( false )
showAdminMenue ()
end
end
function SelfOptionBtn ()
--hideall ()
--triggerEvent ( "_createOptionmenue", getLocalPlayer() )
showSettingsMenue ()
end
function SelfCancelBtn ()
hideall ()
showCursor(false)
triggerServerEvent ( "cancel_gui_server", getLocalPlayer() )
end
function SelfStateBtn ()
hideall ()
showStats()
end
-- Buttons
function showNotes ()
hideall ()
if not gWindow["selfNotes"] then
gWindow["selfNotes"] = guiCreateWindow(screenwidth/2-214/2,120,214,214,"Notizen",false)
guiSetAlpha(gWindow["selfNotes"],1)
guiWindowSetMovable(gWindow["selfNotes"],false)
guiWindowSetSizable(gWindow["selfNotes"],false)
gMemo["selfNotes"] = guiCreateMemo(10,30,195,174,"",false,gWindow["selfNotes"])
guiSetAlpha(gMemo["selfNotes"],1)
loadNotes ()
else
guiSetVisible ( gWindow["selfNotes"], true )
end
end
function showEmoteList ()
hideall ()
if not gWindow["selfEmotes"] then
gWindow["selfAnimations"] = guiCreateWindow(screenwidth/2-256/2,120,256,201,"Animationen",false)
guiWindowSetMovable(gWindow["selfAnimations"],false)
guiWindowSetSizable(gWindow["selfAnimations"],false)
guiSetAlpha(gWindow["selfAnimations"],1)
gGrid["selfAnimations"] = guiCreateGridList(10,29,135,160,false,gWindow["selfAnimations"])
guiGridListSetSelectionMode(gGrid["selfAnimations"],2)
gColumn["selfAnimation"] = guiGridListAddColumn(gGrid["selfAnimations"],"Animation",0.8)
guiSetAlpha(gGrid["selfAnimations"],1)
gButton["selfStartEmote"] = guiCreateButton(150,29,95,44,"Animation ausfuehren",false,gWindow["selfAnimations"])
guiSetAlpha(gButton["selfStartEmote"],1)
addEventHandler("onClientGUIClick", gButton["selfStartEmote"],
function()
local cmd = guiGridListGetItemText ( gGrid["selfAnimations"], guiGridListGetSelectedItem ( gGrid["selfAnimations"] ), gColumn["selfAnimation"] )
triggerServerEvent ( "executeCommandHandlerServer", lp, lp, cmd, guiGetText ( gMemo["selfEmoteDanceStyle"] ) )
end, false
)
gButton["selfStopEmote"] = guiCreateButton(151,80,94,44,"Animation stoppen",false,gWindow["selfAnimations"])
guiSetAlpha(gButton["selfStopEmote"],1)
addEventHandler("onClientGUIClick", gButton["selfStopEmote"],
function()
triggerServerEvent ( "executeCommandHandlerServer", lp, lp, "stopanim", guiGetText ( gMemo["selfEmoteDanceStyle"] ) )
end, false
)
gLabel["selfEmoteInfo"] = guiCreateLabel(169,139,70,24,"Tanzstil:",false,gWindow["selfAnimations"])
guiSetAlpha(gLabel["selfEmoteInfo"],1)
guiLabelSetColor(gLabel["selfEmoteInfo"],125,125,255)
guiLabelSetVerticalAlign(gLabel["selfEmoteInfo"],"top")
guiLabelSetHorizontalAlign(gLabel["selfEmoteInfo"],"left",false)
guiSetFont(gLabel["selfEmoteInfo"],"default-bold-small")
gMemo["selfEmoteDanceStyle"] = guiCreateMemo(151,156,85,31,"",false,gWindow["selfAnimations"])
guiSetAlpha(gMemo["selfEmoteDanceStyle"],1)
addEmotesToList ( gGrid["selfAnimations"], gColumn["selfAnimation"] )
else
guiSetVisible ( gWindow["selfEmotes"], true )
end
end
function addEmotesToList ( grid, column )
for key, animation in ipairs ( animationCMDs ) do
local row = guiGridListAddRow ( grid )
guiGridListSetItemText ( grid, row, column, animation, false, false )
end
end
function loadNotes ()
local noteList = xmlLoadFile ( ":vio/notes/notes.xml" )
if not noteList then
local noteList = xmlCreateFile ( ":vio/notes/notes.xml", "notes" )
local notes = xmlCreateChild ( noteList, "noteText" )
xmlNodeSetValue ( notes, "" )
xmlSaveFile ( noteList )
guiSetText ( gMemo["selfNotes"], notes )
else
local notes = xmlNodeGetChildren ( noteList, 0 )
local notes = xmlNodeGetValue ( notes )
guiSetText ( gMemo["selfNotes"], notes )
end
end
function saveNotes ()
if gMemo["selfNotes"] then
local noteText = guiGetText ( gMemo["selfNotes"] )
local file = xmlLoadFile ( ":vio/notes/notes.xml" )
local node = xmlNodeGetChildren ( file, 0 )
xmlNodeSetValue ( node, noteText )
xmlSaveFile ( file )
end
end
---
function ShowSelfClickMenue_func()
if vioGetElementData ( getLocalPlayer(), "loggedin" ) == 0 then
return
end
guiSetInputEnabled ( false )
if SelfGUI.staticimage[1] then
guiSetVisible ( SelfGUI.staticimage[1], true )
else
SelfGUI.staticimage[1] = guiCreateStaticImage(658, 936, 600, 100, ":vio/images/Self/Background.png", false)
SelfGUI.staticimage[2] = guiCreateStaticImage(25, 17, 64, 64, ":vio/images/Self/status.png", false, SelfGUI.staticimage[1])
SelfGUI.staticimage[3] = guiCreateStaticImage(99, 17, 64, 64, ":vio/images/Self/handy.png", false, SelfGUI.staticimage[1])
SelfGUI.staticimage[4] = guiCreateStaticImage(139+30, 17, 64, 64, ":vio/images/Self/notizen.png", false, SelfGUI.staticimage[1])
SelfGUI.staticimage[5] = guiCreateStaticImage(239, 17, 64, 64, ":vio/images/Self/optionen.png", false, SelfGUI.staticimage[1])
SelfGUI.staticimage[6] = guiCreateStaticImage(307, 17, 64, 64, ":vio/images/Self/friend.png", false, SelfGUI.staticimage[1])
SelfGUI.staticimage[7] = guiCreateStaticImage(377, 17, 64, 64, ":vio/images/Self/anim.png", false, SelfGUI.staticimage[1])
SelfGUI.staticimage[8] = guiCreateStaticImage(445, 17, 64, 64, ":vio/images/Self/admin.png", false, SelfGUI.staticimage[1])
SelfGUI.staticimage[9] = guiCreateStaticImage(513, 17, 64, 64, ":vio/images/Self/cancel.png", false, SelfGUI.staticimage[1])
addEventHandler("onClientGUIClick", SelfGUI.staticimage[8], SelfAdminBtn, false)
addEventHandler("onClientGUIClick", SelfGUI.staticimage[9], SelfCancelBtn, false)
addEventHandler("onClientGUIClick", SelfGUI.staticimage[5], SelfOptionBtn, false)
addEventHandler("onClientGUIClick", SelfGUI.staticimage[2], SelfStateBtn, false)
addEventHandler("onClientGUIClick", SelfGUI.staticimage[3],
function()
hideall()
showHandy()
end,
false )
addEventHandler("onClientGUIClick", SelfGUI.staticimage[6],
function()
if getElementData ( getLocalPlayer(), "premium" ) then
hideall ()
showFriendlistSelf()
else
outputChatBox ( "Nur fuer Premium Benutzer!", 125, 0, 0 )
end
end,
false )
addEventHandler("onClientGUIClick", SelfGUI.staticimage[4],
function()
showNotes ()
end, false
)
addEventHandler("onClientGUIClick", SelfGUI.staticimage[7],
function()
showEmoteList ()
end, false
)
end
SelfGUI.staticimage[4] = guiCreateStaticImage(139+30, 17, 64, 64, ":vio/images/Self/notizen.png", false, SelfGUI.staticimage[1])
end
addEvent ( "ShowSelfClickMenue", true)
addEventHandler ( "ShowSelfClickMenue", getLocalPlayer(), ShowSelfClickMenue_func)
---
Alles anzeigen