-
Notifications
You must be signed in to change notification settings - Fork 1
/
no-useless-mods-party.lua
69 lines (60 loc) · 1.9 KB
/
no-useless-mods-party.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
GroupWindow = {MAX_GROUP_MEMBERS=6}
NoUselessMods = NoUselessMods or {}
NoUselessMods.Party = {}
NoUselessMods.Party.Initialize = function()
RegisterEventHandler(SystemData.Events.GROUP_UPDATED, "NoUselessMods.Party.GroupChange")
NoUselessMods.Party.GroupChange()
end
function NoUselessMods.Party.GroupChange()
GroupWindow.groupData = PartyUtils.GetPartyData()
for i=1,GroupWindow.MAX_GROUP_MEMBERS do
if GroupWindow.groupData[i] == nil then
GroupWindow.groupData[i] = {name=L""}
end
end
end
function GroupWindow.IsPlayerInGroup( playerName )
return GroupWindow.GetGroupMember( playerName ) ~= nil
end
function GroupWindow.GetGroupMember( playerName )
for _, member in ipairs( GroupWindow.groupData ) do
if member and member.name and member.name == playerName then
return member
end
end
return nil
end
function GroupWindow.GetMainAssist()
return nil
end
function GroupWindow.OnFormWarparty()
SendChatText( L"/warbandconvert", L"" )
if( EA_Window_OpenParty )
then
EA_Window_OpenParty.OpenToManageTab()
end
end
function GroupWindow.OnMakeLeader()
if( ButtonGetDisabledFlag(SystemData.ActiveWindow.name ) == true ) then
return
end
BroadcastEvent( SystemData.Events.GROUP_SET_LEADER )
end
function GroupWindow.OnMakeMainAssist()
if( ButtonGetDisabledFlag(SystemData.ActiveWindow.name ) == true ) then
return
end
BroadcastEvent( SystemData.Events.GROUP_SET_MAIN_ASSIST )
end
function GroupWindow.OnLeaveGroup()
if( ButtonGetDisabledFlag(SystemData.ActiveWindow.name ) == true ) then
return
end
BroadcastEvent( SystemData.Events.GROUP_LEAVE )
end
function GroupWindow.OnGroupKick()
if( ButtonGetDisabledFlag( SystemData.ActiveWindow.name ) == true ) then
return
end
BroadcastEvent( SystemData.Events.GROUP_KICK_PLAYER )
end