-- This file is part of AutoInvite -- -- (C) 2014 Scott Yeskie (Sasky) -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. AutoInviteUI = AutoInviteUI or {} local ui = AutoInviteUI local wm = WINDOW_MANAGER function AutoInviteUI:CreateOptionFragment() ui.main = wm:CreateTopLevelWindow("AutoInviteOptionsFragment") ui.main:SetAnchor(TOPRIGHT, ZO_GroupList, TOPRIGHT, -40, 60) ui.main:SetHidden(true) ui.scroll = ui.main -- For using LAM controls ui.data = {} ui.refreshList = wm:CreateControlFromVirtual(nil, ui.main, "ZO_DefaultButton") ui.refreshList:SetAnchor(TOPRIGHT, ui.main, TOPRIGHT, -365, 5) ui.refreshList:SetWidth(160) ui.refreshList:SetText("Refresh List") -- ui.refreshList:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) -- ui.refreshList:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) ui.refreshList:SetHandler("OnClicked", function() MINI_GROUP_LIST:RefreshData() end) ui.max = LAMCreateControl.slider(ui, { type = "slider", name = "Max group size", tooltip = "Maximum number of players to invite to group", min = 4, max = 24, getFunc = function() return AutoInvite.cfg.maxSize end, setFunc = function(val) AutoInvite.cfg.maxSize = val end, default = 24, --width = "half" }) ui.max:SetAnchor(TOPRIGHT, ui.main, TOPRIGHT, 0, 55) ui.restart = LAMCreateControl.checkbox(ui, { type = "checkbox", name = "Restart", tooltip = "Restart AutoInvite if drop below max", getFunc = function() return AutoInvite.cfg.restart end, setFunc = function(val) AutoInvite.cfg.restart = val end, --width = "half" }) ui.restart:SetAnchor(TOPLEFT, ui.max, BOTTOMLEFT, 0, 25) ui.cyr = LAMCreateControl.checkbox(ui, { type = "checkbox", name = "Cyrodiil Check", tooltip = "Only invite players that are in Cyrodiil.\n(This only runs if you are in Cyrodiil yourself.)", getFunc = function() return AutoInvite.cfg.cyrCheck end, setFunc = function(val) AutoInvite.cfg.cyrCheck = val end, --width = "half" }) ui.cyr:SetAnchor(TOPLEFT, ui.restart, BOTTOMLEFT, 0, 25) ui.kick = LAMCreateControl.checkbox(ui, { type = "checkbox", name = "Auto kick", tooltip = "Kick players that go offline", getFunc = function() return AutoInvite.cfg.autoKick end, setFunc = function(val) AutoInvite.cfg.autoKick = val end, --width = "half" }) ui.kick:SetAnchor(TOPLEFT, ui.cyr, BOTTOMLEFT, 0, 25) ui.kickTime = LAMCreateControl.slider(ui, { type = "slider", name = "Time before kick", tooltip = "Number of seconds to wait before kicking an offline player", min = 5, max = 600, getFunc = function() return AutoInvite.cfg.kickDelay end, setFunc = function(val) AutoInvite.cfg.kickDelay = val end, default = 300, --width = "half" }) ui.kickTime:SetAnchor(TOPLEFT, ui.kick, BOTTOMLEFT, 0, 25) ui.regroup = wm:CreateControlFromVirtual(nil, ui.main, "ZO_DefaultButton") ui.regroup:SetAnchor(TOPLEFT, ui.kickTime, BOTTOMLEFT, 70, 70) ui.regroup:SetWidth(160) ui.regroup:SetText("Re-form Group") -- ui.regroup:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) -- ui.regroup:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) ui.regroup:SetHandler("OnClicked", function() AutoInvite:resetGroup() end) -- ui.queueTrigger = wm:CreateControlFromVirtual(nil, ui.main, "ZO_DefaultButton") -- ui.queueTrigger:SetAnchor(TOPLEFT, ui.regroup, TOPRIGHT, 20, 0) -- ui.queueTrigger:SetWidth(160) -- ui.queueTrigger:SetText("Trigger Queue") -- ui.queueTrigger:SetHandler("OnMouseEnter", ZO_Options_OnMouseEnter) -- ui.queueTrigger:SetHandler("OnMouseExit", ZO_Options_OnMouseExit) -- ui.queueTrigger:SetHandler("OnClicked", function() AutoInvite:processQueue() end) ui.note = LAMCreateControl.description(ui, { type = "description", title = "Slash Commands", text = "/ai foo - start listening on 'foo'\n/ai - stop listening", --width = "half" }) ui.note:SetAnchor(BOTTOMRIGHT, ZO_GroupList, BOTTOMRIGHT, -40, -40) ui.note.desc:SetColor(.7,.7,.7,1) AUTO_INVITE_OPTIONS_FRAGMENT = ZO_FadeSceneFragment:New(ui.main) end