
if (GetLocale() == "zhCN") then
	BIGFOOTGADGET_TITLE = {"大脚小工具", "dajiaoxiaogongju"};
	BIGFOOTGADGET_ENABLE_CLOCK = "开启时钟";
	BIGFOOTGADGET_CLOSE_DEFAULT_CLOCK = "隐藏小地图下方的时间框";
	BIGFOOTGADGET_ENABLE_GPS = "开启坐标指示";
	BIGFOOTGADGET_ENABLE_MBB = "开启小地图按键包";	
elseif (GetLocale() == "zhTW") then
	BIGFOOTGADGET_TITLE = {"大腳小工具", "dajiaoxiaogongju"};
	BIGFOOTGADGET_ENABLE_CLOCK = "開啟時鐘";
	BIGFOOTGADGET_CLOSE_DEFAULT_CLOCK = "隱藏小地圖下方的時間框";
	BIGFOOTGADGET_ENABLE_GPS = "開啟座標指示";
	BIGFOOTGADGET_ENABLE_MBB = "開啟小地圖按鍵包";	
else
	BIGFOOTGADGET_TITLE = "BigFoot Gadget";
	BIGFOOTGADGET_ENABLE_CLOCK = "Enable Clock";
	BIGFOOTGADGET_CLOSE_DEFAULT_CLOCK = "Hide timebox under minimap";
	BIGFOOTGADGET_ENABLE_GPS = "Enable GPS";
	BIGFOOTGADGET_ENABLE_MBB = "Enable Minimap button bag";	
end

if (IsConfigurableAddOn("BigFootGadget") or IsConfigurableAddOn("MBB")) then
	ModManagement_RegisterMod(
		"BigFootGadget",
		"Interface\\Icons\\INV_Gizmo_HardenedAdamantiteTube",
		BIGFOOTGADGET_TITLE,
		"",
		nil
	);
end

if (IsConfigurableAddOn("BigFootGadget")) then
	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		BIGFOOTGADGET_ENABLE_CLOCK,
		nil,
		"EnableBigFootClock",
		1,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("BigFootGadget")) then
					LoadAddOn("BigFootGadget");
				end

				if (IsAddOnLoaded("BigFootGadget")) then
					BigFootClock_Toggle(true);
				end
			else
				if (IsAddOnLoaded("BigFootGadget")) then
					BigFootClock_Toggle(false);
				end
			end
		end
	);

	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		BIGFOOTGADGET_CLOSE_DEFAULT_CLOCK,
		nil,
		"HideDefaultClock",
		1,
		function (arg)
			if (arg == 1) then
				if (IsAddOnLoaded("BigFootGadget")) then
					BigFootClock_ToggleDefaultClock(false);
				end
			else
				if (IsAddOnLoaded("BigFootGadget")) then
					BigFootClock_ToggleDefaultClock(true);
				end
			end
		end,
		1
	);

	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		BIGFOOTGADGET_ENABLE_GPS,
		nil,
		"EnableBigFootGPS",
		1,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("BigFootGadget")) then
					LoadAddOn("BigFootGadget");
				end

				if (IsAddOnLoaded("BigFootGadget")) then
					BigFootGPS_Toggle(true);
				end
			else
				if (IsAddOnLoaded("BigFootGadget")) then
					BigFootGPS_Toggle(false);
				end
			end
		end
	);
end

if (IsConfigurableAddOn("MBB")) then
	ModManagement_RegisterCheckBox(
		"BigFootGadget",
		BIGFOOTGADGET_ENABLE_MBB,
		nil,
		"EnableBigFootMBB",
		1,
		function (arg)
			if (arg == 1) then
				if (not IsAddOnLoaded("MBB")) then
					LoadAddOn("MBB");
				end

				if (IsAddOnLoaded("MBB")) then
					MBB_Toggle(true);
				end
			else
				if (IsAddOnLoaded("MBB")) then
					MBB_Toggle(false);
				end
			end
		end
	);
end
