This repository was archived by the owner on Nov 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGuildManager-UI.lua
More file actions
60 lines (52 loc) · 2.07 KB
/
GuildManager-UI.lua
File metadata and controls
60 lines (52 loc) · 2.07 KB
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
------------------------------------------------------------------------------------------------
-- GuildManager ver. @project-version@
-- Build @project-hash@
-- Copyright (c) NexusInstruments. All rights reserved
--
-- https://github.com/NexusInstruments/GuildManager
------------------------------------------------------------------------------------------------
-- GuildManager.lua
------------------------------------------------------------------------------------------------
require "Window"
require "Item"
require "GameLib"
local GuildManager = Apollo.GetAddon("GuildManager")
local Info = Apollo.GetAddonInfo("GuildManager")
---------------------------------------------------------------------------------------------------
-- GuildManager General UI Functions
---------------------------------------------------------------------------------------------------
function GuildManager:OnToggleGuildManager()
if self.state.isOpen == true then
self.state.isOpen = false
self:SaveLocation()
self:CloseMain()
else
self.state.isOpen = true
self.state.windows.main:Invoke() -- show the window
end
end
function GuildManager:SaveLocation()
self.settings.positions.main = self.state.windows.main:GetLocation():ToTable()
end
function GuildManager:CloseMain()
self.state.windows.main:Close()
end
function GuildManager:OnGuildManagerClose( wndHandler, wndControl, eMouseButton )
self.state.isOpen = false
self:SaveLocation()
self:CloseMain()
end
function GuildManager:OnGuildManagerClosed( wndHandler, wndControl )
self:SaveLocation()
self.state.isOpen = false
end
---------------------------------------------------------------------------------------------------
-- GuildManager RefreshUI
---------------------------------------------------------------------------------------------------
function GuildManager:RefreshUI()
-- Location Restore
if self.settings.positions.main ~= nil and self.settings.positions.main ~= {} then
locSavedLoc = WindowLocation.new(self.settings.positions.main)
self.state.windows.main:MoveToLocation(locSavedLoc)
end
end