Quantcast

Remove auto logout code

WildCard_25 [03-24-19 - 06:07]
Remove auto logout code
Filename
GarrisonCommander.lua
MissionControl.lua
ShipControl.lua
ShipYard.lua
quick.lua
diff --git a/GarrisonCommander.lua b/GarrisonCommander.lua
index df5f625..bcdebbc 100644
--- a/GarrisonCommander.lua
+++ b/GarrisonCommander.lua
@@ -1661,7 +1661,7 @@ function addon:AddMenu()
 	local menu,size
 	if GMF.MissionTab:IsVisible() then
 		self.currentmenu=GMF.MissionTab
-		menu,size=self:CreateOptionsLayer(MP and 'CKMP' or nil,'BIGSCREEN','MSORT','MAXRES','MAXRESCHANCE','IGM','IGP','NOFILL','USEFUL','NOTOOLTIP','MOVEPANEL','AUTOLOGOUT')
+		menu,size=self:CreateOptionsLayer(MP and 'CKMP' or nil,'BIGSCREEN','MSORT','MAXRES','MAXRESCHANCE','IGM','IGP','NOFILL','USEFUL','NOTOOLTIP','MOVEPANEL')
 	elseif GMF.FollowerTab:IsVisible() then
 		local missionlist=ns.bigscreen or self:GetBoolean("FOLLOWERMISSIONLIST")
 		self.currentmenu=GMF.FollowerTab
@@ -1674,7 +1674,7 @@ function addon:AddMenu()
 		self:RenderFollowerPageMissionList(nil,GMF.FollowerTab.followerID)
 	elseif GMF.MissionControlTab:IsVisible() then
 		self.currentmenu=GMF.MissionControlTab
-		menu,size=self:CreateOptionsLayer('BIGSCREEN','GCMINLEVEL','GCMINUPGRADE','MINXPLEVEL','MINGOLD','GCSKIPRARE','GCSKIPEPIC','USEFUL','NOTOOLTIP','AUTOLOGOUT')
+		menu,size=self:CreateOptionsLayer('BIGSCREEN','GCMINLEVEL','GCMINUPGRADE','MINXPLEVEL','MINGOLD','GCSKIPRARE','GCSKIPEPIC','USEFUL','NOTOOLTIP')
 	else
 		self.currentmenu=nil
 		menu,size=self:CreateOptionsLayer('BIGSCREEN')
@@ -1754,7 +1754,6 @@ function addon:ScriptGarrisonMissionFrame_OnShow(...)
 	self:Trigger("MSORT")
 	self:Trigger("CKMP")
 	if IsControlKeyDown() then
-		self:EnableAutoLogout()
 		self:ScheduleTimer("RunQuick",0.1,true)
 	end
 	self:RawHook(GMFMissions,"UpdateMissions","OnUpdateMissions",true)
diff --git a/MissionControl.lua b/MissionControl.lua
index e265e22..432cb50 100644
--- a/MissionControl.lua
+++ b/MissionControl.lua
@@ -264,7 +264,6 @@ end
 function module:OnClick_Run(this,button)
 	local GMC=GMF.MissionControlTab
 	this:Disable()
-	--GMC.logoutButton:Disable()
 	do
 		local elapsed=0
 		local co=coroutine.wrap(self.RunMission)
@@ -280,11 +279,6 @@ function module:OnClick_Run(this,button)
 					self:Unhook(GMC.runButton,'OnUpdate')
 					GMC.list.widget:SetTitle(READY)
 					GMC.list.widget:SetTitleColor(C.Green())
-					--GMC.logoutButton:Enable()
-					if not ns.quick and addon:GetBoolean("AUTOLOGOUT") then
-						addon:LogoutPopout(5)
-					end
-					addon:missionDone()
 					ns.quick=false
 				end
 			end
@@ -791,7 +785,6 @@ function module:BuildFlags()
 	addon:AddSlider("MINGOLD",50,1,1000,L["Minimum Gold Value"],L["Gold missions wich returns less than this amount are ignored"])
 	addon:AddToggle("GCSKIPEPIC",settings.skipEpic,L["Ignore epic for xp missions."],L["IF you have a Salvage Yard you probably dont want to have this one checked"])
 	addon:AddToggle("GCSKIPRARE",settings.skipRare,L["Ignore rare missions"],L["Rare missions will not be considered"])
-	--addon:AddToggle("AUTOLOGOUT",false,L["Auto Logout"],L["Automatically logout after sending missions"])
 	addon:SetBoolean("AUTOLOGOUT",false)
 end
 function module:BuildDuration()
@@ -875,16 +868,6 @@ function module:BuildMissionList()
 	GMC.runButton:SetScript('OnClick',function(this,button) self:OnClick_Run(this,button) end)
 	GMC.runButton:Disable()
 	GMC.runButton:SetPoint('TOPRIGHT',-10,25)
---	GMC.logoutButton=CreateFrame('BUTTON', nil,ml.widget.frame, 'GameMenuButtonTemplate')
---	GMC.logoutButton:SetText(LOGOUT)
---	GMC.logoutButton:SetWidth(ns.bigscreen and 148 or 90)
---	GMC.logoutButton:SetScript("OnClick",function()
---		GMF:Hide()
---		module:Popup(LOGOUT)
---		module:ScheduleTimer(Logout,0.5)
---		end
---	)
---	GMC.logoutButton:SetPoint('TOP',0,25)
 	return ml
 end

diff --git a/ShipControl.lua b/ShipControl.lua
index 9a0d5f4..8d644f1 100644
--- a/ShipControl.lua
+++ b/ShipControl.lua
@@ -317,7 +317,6 @@ end
 function module:OnClick_Run(this,button)
 	local GMC=GSF.MissionControlTab
 	this:Disable()
-	--GMC.logoutButton:Disable()
 	do
 		local elapsed=0
 		local co=coroutine.wrap(self.RunMission)
@@ -333,11 +332,6 @@ function module:OnClick_Run(this,button)
 					self:Unhook(GMC.runButton,'OnUpdate')
 					GMC.list.widget:SetTitle(READY)
 					GMC.list.widget:SetTitleColor(C.Green())
-					--GMC.logoutButton:Enable()
-					if not ns.quick and addon:GetBoolean("SAUTOLOGOUT") then
-						addon:LogoutPopup(5)
-					end
-					addon:shipyardDone()
 					ns.quick=false
 				end
 			end
@@ -797,7 +791,7 @@ function module:BuildFlags()
 	addon:AddSlider("SGCMINLEVEL",settings.minLevel,535,715,L["Item minimum level"],L['Minimum requested level for equipment rewards'],15)
 	addon:AddToggle("SGCSKIPEPIC",settings.skipEpic,L["Ignore epic for xp missions."],L["IF you have a Salvage Yard you probably dont want to have this one checked"])
 	addon:AddToggle("SGCRIG",settings.rig,L["Oil Rig."],L["Always send Oil Rig: Pickup mission as last mission if available"])
-	addon:AddToggle("SAUTOLOGOUT",false,L["Auto Logout"],L["Automatically logout after sending missions"])
+	addon:SetBoolean("SAUTOLOGOUT",false)
 	addon:Trigger('SGCMINLEVEL')
 	addon:Trigger('SGCSKIPEPIC')

@@ -883,16 +877,6 @@ function module:BuildMissionList()
 	GMC.runButton:SetScript('OnClick',function(this,button) self:OnClick_Run(this,button) end)
 	GMC.runButton:Disable()
 	GMC.runButton:SetPoint('TOPRIGHT',-10,25)
-	--GMC.logoutButton=CreateFrame('BUTTON', nil,ml.widget.frame, 'GameMenuButtonTemplate')
-	--GMC.logoutButton:SetText(LOGOUT)
-	--GMC.logoutButton:SetWidth(ns.bigscreen and 148 or 90)
-	--GMC.logoutButton:SetScript("OnClick",function()
-	--	GSF:Hide()
-	--	module:Popup(LOGOUT)
-	--	module:ScheduleTimer(Logout,0.5)
-	--	end
-	--)
-	--GMC.logoutButton:SetPoint('TOP',0,25)
 	return ml
 end

diff --git a/ShipYard.lua b/ShipYard.lua
index 97bf66e..ff93390 100644
--- a/ShipYard.lua
+++ b/ShipYard.lua
@@ -346,7 +346,6 @@ function module:ScriptGarrisonShipyardFrame_OnShow()
 	self:RefreshCurrency()
 	self:RefreshFollowerStatus()
 	if IsControlKeyDown() then
-		self:EnableAutoLogout()
 		self:ScheduleTimer("RunQuick",0.1,true)
 	end
 end
diff --git a/quick.lua b/quick.lua
index 8dbc2aa..3136083 100644
--- a/quick.lua
+++ b/quick.lua
@@ -5,15 +5,12 @@ local _G=_G
 local GMF=GMF
 local GSF=GSF
 local qm=addon:NewSubModule("Quick") --#qm
-local missionDone
-local shipyardDone
 local format=format
 local ipairs=ipairs
 local NavalDomination={
 	Alliance=39068,
 	Horde=39246
 }
-local autologout=false
 local questid=NavalDomination[UnitFactionGroup("player")]
 function qm:OnInitialized()
 	ns.step="none"
@@ -22,12 +19,6 @@ local watchdog=0
 local function HasShipTable()
 	return ns.quests[39068] or ns.quests[39246] -- Naval Domination
 end
-function addon:missionDone()
-	missionDone=true
-end
-function addon:shipyardDone()
-	shipyardDone=true
-end

 -- backported from LibInit 41
 function addon:Popup(msg,timeout,OnAccept,OnCancel,data,StopCasting)
@@ -85,45 +76,11 @@ function addon:LogoutTimer(dialog,elapsed)
 		text:SetFormattedText(StaticPopupDialogs[which].text, ceil(timeleft / 60), MINUTES);
 	end
 end
-function addon:LogoutPopup(timeout)
-	local msg=''
-	if addon:HasSalvageYard() then
-		local salvage=0
-		local freeSlots=0
-		for i=0,NUM_BAG_SLOTS do
-			freeSlots=freeSlots+(GetContainerNumFreeSlots(i) or 0)
-		end
-		for _,id in ipairs(ns.allSalvages) do
-			salvage=salvage+(GetItemCount(id) or 0)
-		end
-		if salvage > 5 then
-			timeout=timeout+5
-			msg=format(L["You have %d items to salvage"],salvage)
-			if freeSlots < 5 then
-				msg=msg .. format(L[" and only %d free slots in your bags"],freeSlots)
-			end
-			msg=C(msg,'green').."\n"
-    	local popup=addon:Popup(msg,timeout or 10,
-    		function(dialog,data,data2)
-          StaticPopup_Hide("LIBINIT_POPUP")
-    		end
-    	)
-		end
-	end
-end
 function qm:RunQuick()
 	local completeButton=GMF:IsVisible() and GarrisonCommanderQuickMissionComplete or GCQuickShipMissionCompletionButton
 	local main=GMF:IsVisible() and GMF or GSF
 	if not ns.quick then
 		HideUIPanel(main)
-		if not G.HasShipyard() then
-			shipyardDone=true
-		end
-		if missionDone and shipyardDone then
-			addon:LogoutPopup(5)
-		else
-			autologout=false
-		end
 		return
 	end
 	while not qm.Mission do
@@ -149,9 +106,6 @@ function qm:RunQuick()
 	end

 end
-function addon:EnableAutoLogout()
-	autologout=true
-end
 function addon:RunQuick(force)
 	local main=GMF:IsVisible() and GMF or GSF
 	if main.tabMC:GetChecked() then