local C = Broker_Everything.color
local last_click = 0


local stuff_init = function ()
	--self.obj.text = "Stuff"
end


local stuff_onclick = function(self, btn)
	local shift = IsShiftKeyDown() or -1
	local cv = 0

	if btn == "RightButton" then
		cv = 1 * shift
	elseif btn == "LeftButton" then
		cv = 2 * shift
	end

	if last_click ~= cv then
		last_click = cv
		return
	end

	-- only for windowed mode switching...
	last_click = 0

	if btn == "RightButton" and shift > 0 then
		ReloadUI()
	elseif btn == "RightButton" and shift < 0 then
		Quit()
	elseif btn == "LeftButton" and shift > 0 then
		SetCVar("gxWindow", 1 - GetCVar("gxWindow"))
		RestartGx()
	elseif btn == "LeftButton" and shift < 0 then
		Logout()
	end
end


local stuff_tooltip = function(t)
	t:AddLine(L["STUFF"])
	t:AddLine(" ")
	t:AddLine(C.white(L["WARNING"]))
	t:AddLine(" ")
	t:AddLine(C.dkgreen(L["STUFFHINTLEFT"]))
	t:AddLine(C.dkgreen(L["STUFFHINTRIGHT"]))
	t:AddLine(C.dkgreen(L["STUFFSHIFTLEFT"]))
	t:AddLine(C.dkgreen(L["STUFFSHIFTRIGHT"]))
end


Broker_Everything:Register(L["STUFF"],
	"Interface\\Addons\\Broker_Everything\\media\\stuff",--GetItemIcon(39973),
	stuff_init,
	0,
	0,
	stuff_onclick,
	stuff_tooltip,
	nil,
	nil)

