--[[Created by Slothpala]]--
local addonName, addonTable = ...
local addon = addonTable.addon
local L = LibStub("AceLocale-3.0"):GetLocale(addonName)

local locale_frame_points = {
  [1] = L["frame_point_top_left"],
  [2] = L["frame_point_top_right"],
  [3] = L["frame_point_bottom_left"],
  [4] = L["frame_point_bottom_right"],
  [5] = L["frame_point_top"],
  [6] = L["frame_point_bottom"],
  [7] = L["frame_point_left"],
  [8] = L["frame_point_right"],
  [9] = L["frame_point_center"],
}

local locale_font_flags = {
  [1] = L["font_flag_monochrome"],
  [2] = L["font_flag_monochrome_outline"],
  [3] = L["font_flag_monochrome_thick_outline"],
  [4] = L["font_flag_none"],
  [5] = L["font_flag_outline"],
  [6] = L["font_flag_thick_outline"],
}

local locale_horizontal_justification = {
  [1] = L["font_justification_left"],
  [2] = L["font_justification_center"],
  [3] = L["font_justification_right"],
}

local locale_vertical_justification = {
  [1] = L["font_justification_top"],
  [2] = L["font_justification_middle"],
  [3] = L["font_justification_bottom"],
}



local fonts = LibStub("LibSharedMedia-3.0"):List("font")

local options = {
  name = "", -- required field but will never be shown.
  handler = addon,
  type = "group",
  childGroups = "tab",
  args = {
    Fonts = {
      order = 1,
      hidden = function()
        return not addon:IsModuleEnabled("Font")
      end,
      name = L["module_font_name"],
      type = "group",
      childGroups = "tab",
      args = {
        NameFont = {
          order = 1,
          name = L["font_name_header"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.NameFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.NameFont.font = fonts[value]
                addon:ReloadModule("Font")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 40,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            show_server = {
              hidden = true,
              order = 20.2,
              name = L["font_name_show_server_name"],
              desc = L["font_name_show_server_desc"],
              type = "toggle",
              get = "GetStatus",
              set = "SetStatus",
              width = 0.7,
            },
            class_colored = {
              order = 20.3,
              name = L["font_name_class_colored_name"],
              desc = L["font_name_class_colored_desc"],
              type = "toggle",
              get = "GetStatus",
              set = "SetStatus",
              width = 0.7,
            },
            text_color = {
              hidden = function()
                return addon.db.profile.NameFont.class_colored
              end,
              order = 20.4,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.5,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.6,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.7,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
        StatusFont = {
          order = 2,
          name = L["font_status_header"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.StatusFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.StatusFont.font = fonts[value]
                addon:ReloadModule("Font")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            class_colored = {
              order = 20.3,
              name = L["font_name_class_colored_name"],
              desc = L["font_name_class_colored_desc"],
              type = "toggle",
              get = "GetStatus",
              set = "SetStatus",
              width = 0.7,
            },
            text_color = {
              hidden = function()
                return addon.db.profile.StatusFont.class_colored
              end,
              order = 20.4,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.5,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.6,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.7,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
        Nicknames = {
          hidden = true, --@TODO implement
          order = 3,
          name = L["font_nicknames_header"],
          desc = "",
          type = "group",
          args = {}
        },
      },
    },
    DefensiveOverlay = {
      order = 2,
      hidden = function()
        return not addon:IsModuleEnabled("DefensiveOverlay")
      end,
      name = L["module_defensive_overlay_name"],
      type = "group",
      childGroups = "tab",
      args = {
        DefensiveOverlayDurationFont = {
          order = 1,
          name = L["font_duration_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.DefensiveOverlayDurationFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.DefensiveOverlayDurationFont.font = fonts[value]
                addon:ReloadModule("DefensiveOverlay")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
        DefensiveOverlayStackFont = {
          order = 1,
          name = L["font_stack_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.DefensiveOverlayStackFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.DefensiveOverlayStackFont.font = fonts[value]
                addon:ReloadModule("DefensiveOverlay")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
      },
    },
    BuffFrame = {
      order = 3,
      hidden = function()
        return not addon:IsModuleEnabled("BuffFrame")
      end,
      name = L["module_buff_frame_name"],
      type = "group",
      childGroups = "tab",
      args = {
        BuffFrameDurationFont = {
          order = 1,
          name = L["font_duration_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.BuffFrameDurationFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.BuffFrameDurationFont.font = fonts[value]
                addon:ReloadModule("BuffFrame")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
        BuffFrameStackFont = {
          order = 1,
          name = L["font_stack_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.BuffFrameStackFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.BuffFrameStackFont.font = fonts[value]
                addon:ReloadModule("BuffFrame")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
      },
    },
    DebuffFrame = {
      order = 4,
      hidden = function()
        return not addon:IsModuleEnabled("DebuffFrame")
      end,
      name = L["module_debuff_frame_name"],
      type = "group",
      childGroups = "tab",
      args = {
        DebuffFrameDurationFont = {
          order = 1,
          name = L["font_duration_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.DebuffFrameDurationFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.DebuffFrameDurationFont.font = fonts[value]
                addon:ReloadModule("DebuffFrame")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
        DebuffFrameStackFont = {
          order = 1,
          name = L["font_stack_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.DebuffFrameStackFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.DebuffFrameStackFont.font = fonts[value]
                addon:ReloadModule("DebuffFrame")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
      },
    },
    AuraGroups = {
      order = 5,
      hidden = function()
        return not addon:IsModuleEnabled("AuraGroups")
      end,
      name = L["module_aura_groups_name"],
      type = "group",
      childGroups = "tab",
      args = {
        AuraGroupsDurationFont = {
          order = 1,
          name = L["font_duration_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.AuraGroupsDurationFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.AuraGroupsDurationFont.font = fonts[value]
                addon:ReloadModule("AuraGroups")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
        AuraGroupsStackFont = {
          order = 1,
          name = L["font_stack_name"],
          desc = "",
          type = "group",
          args = {
            font = {
              order = 1,
              type = "select",
              name = L["font_dropdown_name"],
              desc = L["font_dropdown_desc"],
              values = fonts,
              get = function()
                for i, v in next, fonts do
                  if v == addon.db.profile.AuraGroupsStackFont.font then
                    return i
                  end
                end
              end,
              set = function(_, value)
                addon.db.profile.AuraGroupsStackFont.font = fonts[value]
                addon:ReloadModule("AuraGroups")
              end,
              itemControl = "DDI-Font",
              width = 1.5,
            },
            point = {
              order = 2,
              name = L["point_name"],
              desc = L["point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            relative_point = {
              order = 3,
              name = L["relative_point_name"],
              desc = L["relative_point_desc"],
              type = "select",
              values = locale_frame_points,
              get = "GetFramePoint",
              set = "SetFramePoint",
              width = 0.8,
            },
            offset_x = {
              order = 4,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            offset_y = {
              order = 5,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            font_size = {
              order = 6,
              name = L["font_slider_name"],
              desc = L["font_slider_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = 1,
              max = 30,
              step = 1,
              width = 1.5,
            },
            font_outlinemode = {
              order = 7,
              name = L["outlinemode_name"],
              desc = L["outlinemode_desc"],
              type = "select",
              values = locale_font_flags,
              get = "GetFontFlag",
              set = "SetFontFlag",
              width = 1.6,
            },
            horizontal_justification = {
              order = 8,
              name = L["font_horizontal_justification_name"],
              desc = L["font_horizontal_justification_desc"],
              type = "select",
              values = locale_horizontal_justification,
              get = "GetHorizontalJustification",
              set = "SetHorizontalJustification",
              width = 0.8,
            },
            vertical_justification = {
              hidden = true,
              order = 9,
              name = L["font_vertical_justification_name"],
              desc = L["font_vertical_justification_desc"],
              type = "select",
              values = locale_vertical_justification,
              get = "GetVerticalJustification",
              set = "SetVerticalJustification",
              width = 0.8,
            },
            new_line_1 = {
              order = 20,
              name = "",
              type = "description",
            },
            text_color = {
              order = 20.1,
              name = L["font_text_color_name"],
              desc = L["font_text_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.6,
            },
            shadow_color = {
              order = 20.2,
              name = L["font_shadow_color_name"],
              desc = L["font_shadow_color_desc"],
              type = "color",
              get = "GetColor",
              set = "SetColor",
              width = 0.8,
            },
            shadow_offset_x = {
              order = 20.3,
              name = L["offset_x_name"],
              desc = L["offset_x_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
            shadow_offset_y = {
              order = 20.4,
              name = L["offset_y_name"],
              desc = L["offset_y_desc"],
              type = "range",
              get = "GetStatus",
              set = "SetStatus",
              min = -10,
              max = 10,
              step = 1,
              width = 0.8,
            },
          },
        },
      },
    },
  },
}


function addon:GetFontOptions()
  return options
end
