
if (GetLocale() == "zhCN") then
	BF_ACTION_BUTTON_TITLE = {"动作按钮", "dongzuoanniu"};
	COOLDOWN_HELPER_COOLDOWN_COUNT = "显示详细的冷却时间";
	COOLDOWN_HELPER_COOLDOWN_SHOW_TARGET = "显示小图标的冷却时间";
	COOLDOWN_HELPER_SHINE_TYPE_TITLE = "闪光类型：";
	COOLDOWN_HELPER_SHINE_TYPE = {"标准", "大闪光", "雷达"};
	BF_DISTANCE_ALERT = "超出技能范围时图标为红色";
elseif (GetLocale() == "zhTW") then
	BF_ACTION_BUTTON_TITLE = {"動作按鈕", "dongzuoanniu"};
	COOLDOWN_HELPER_COOLDOWN_COUNT = "顯示詳細的冷卻時間";
	COOLDOWN_HELPER_COOLDOWN_SHOW_TARGET = "顯示小圖示的冷卻時間";
	COOLDOWN_HELPER_SHINE_TYPE_TITLE = "閃光類型：";
	COOLDOWN_HELPER_SHINE_TYPE = {"標準", "大閃光", "雷達"};
	BF_DISTANCE_ALERT = "超出技能範圍時圖標為紅色";
else
	BF_ACTION_BUTTON_TITLE = "Action Button";
	COOLDOWN_HELPER_COOLDOWN_COUNT = "Show detail of cooldown";
	COOLDOWN_HELPER_COOLDOWN_SHOW_TARGET = "Show small icon cooldown";
	COOLDOWN_HELPER_SHINE_TYPE_TITLE = "Shine type:";
	COOLDOWN_HELPER_SHINE_TYPE = {"Standard", "Big Shine", "Radar"};
	BF_DISTANCE_ALERT = "Show red icon when out of range";
end

ModManagement_RegisterMod(
	"ActionButton",
	"Interface\\Icons\\INV_Jewelry_Necklace_15",
	BF_ACTION_BUTTON_TITLE,
	"",
	nil
);

ModManagement_RegisterCheckBox(
	"ActionButton",
	BF_DISTANCE_ALERT,
	nil,
	"EnableDistanceAlert",
	1,
	function (arg)
		if (arg == 1) then
			DistanceAlert_Toggle(true);
		else
			DistanceAlert_Toggle(nil);
		end
	end
);

if (IsConfigurableAddOn("CooldownHelper")) then
	ModManagement_RegisterCheckBox(
		"ActionButton",
		COOLDOWN_HELPER_COOLDOWN_COUNT,
		nil,
		"EnableCooldownCount",
		0,
		function (arg)
			if (arg == 1) then
				if (BigFoot_LoadAddOn("CooldownHelper")) then
					CooldownHelper_Toggle(true);
				end
			else
				if (BigFoot_IsAddOnLoadedFromBigFoot("CooldownHelper")) then
					CooldownHelper_Toggle(false);
				elseif (BigFoot_IsAddOnLoadedFromOther("CooldownHelper")) then
					CooldownHelper_Toggle(true);
				end
			end
		end
	);

	ModManagement_RegisterSpinBox(
		"ActionButton",
		COOLDOWN_HELPER_SHINE_TYPE_TITLE,
		nil,
		"ShineType",
		"list",
		COOLDOWN_HELPER_SHINE_TYPE,
		COOLDOWN_HELPER_SHINE_TYPE[1],
		function (arg)
			if (BigFoot_IsAddOnLoaded("CooldownHelper")) then
				CooldownHelper_SetShineTheme(arg);
			end
		end,
		1
	);

	ModManagement_RegisterCheckBox(
		"ActionButton",
		COOLDOWN_HELPER_COOLDOWN_SHOW_TARGET,
		nil,
		"ShowTargetCooldown",
		0,
		function (arg)
			if (arg == 1) then
				if (BigFoot_IsAddOnLoaded("CooldownHelper")) then
					CooldownHelper_ShowTargetCooldown(true);
				end
			else
				if (BigFoot_IsAddOnLoaded("CooldownHelper")) then
					CooldownHelper_ShowTargetCooldown(nil);
				end
			end
		end,
		1
	);
end
