diff --git a/totalRP3/Locales/enUS.lua b/totalRP3/Locales/enUS.lua index 50ed09fb9..818157528 100644 --- a/totalRP3/Locales/enUS.lua +++ b/totalRP3/Locales/enUS.lua @@ -1402,15 +1402,9 @@ If you wish to report %s's profile and you cannot target them you will need to o NAMEPLATES_CONFIG_DISABLE_IN_COMBAT_HELP = "If checked, disables nameplate customizations while you are in combat.", NAMEPLATES_CONFIG_DISABLE_OUT_OF_CHARACTER = "Disable customizations when OOC", NAMEPLATES_CONFIG_DISABLE_OUT_OF_CHARACTER_HELP = "If checked, disables all nameplate customizations while you are out of character.", - NAMEPLATES_CONFIG_DISABLE_OUT_OF_CHARACTER_UNITS = "Disable customizations on OOC units", - NAMEPLATES_CONFIG_DISABLE_OUT_OF_CHARACTER_UNITS_HELP = "If checked, disables nameplate customizations on units that are out of character.", - NAMEPLATES_CONFIG_HIDE_NON_ROLEPLAY_UNITS = "Hide non-roleplay units", - NAMEPLATES_CONFIG_HIDE_NON_ROLEPLAY_UNITS_HELP = "If checked, hides the nameplates of player and companion units that do not have roleplay profiles.", - NAMEPLATES_CONFIG_HIDE_OUT_OF_CHARACTER_UNITS = "Hide out of character units", - NAMEPLATES_CONFIG_HIDE_OUT_OF_CHARACTER_UNITS_HELP = "If checked, hides the nameplates of units that are currently out of character.", NAMEPLATES_CONFIG_ELEMENT_HEADER = "Customization settings", NAMEPLATES_CONFIG_CUSTOMIZE_NAMES = "Show custom names", - NAMEPLATES_CONFIG_CUSTOMIZE_NAMES_HELP = "If checked, replaces the name shown on nameplates.", + NAMEPLATES_CONFIG_CUSTOMIZE_NAMES_HELP = "Controls how custom names for units will be displayed.", NAMEPLATES_CONFIG_CUSTOMIZE_NAME_COLORS = "Show custom name colors", NAMEPLATES_CONFIG_CUSTOMIZE_NAME_COLORS_HELP = "If checked, overrides the color of name texts with the class color of a units' profile.", NAMEPLATES_CONFIG_CUSTOMIZE_HEALTH_COLORS = "Show custom health colors", @@ -1423,6 +1417,12 @@ If you wish to report %s's profile and you cannot target them you will need to o NAMEPLATES_CONFIG_CUSTOMIZE_ROLEPLAY_STATUS_HELP = "If checked, shows an indicator of a units' roleplay status (IC or OOC) on nameplates.", NAMEPLATES_CONFIG_CUSTOMIZE_ICONS = "Show icons", NAMEPLATES_CONFIG_CUSTOMIZE_ICONS_HELP = "If checked, shows profile icons on nameplates.", + NAMEPLATES_CONFIG_CUSTOMIZE_OOC_UNITS = "Customize OOC units", + NAMEPLATES_CONFIG_CUSTOMIZE_OOC_UNITS_HELP = "Controls the customization of out of character units.", + NAMEPLATES_CONFIG_CUSTOMIZE_NON_ROLEPLAY_UNITS = "Customize non-roleplay units", + NAMEPLATES_CONFIG_CUSTOMIZE_NON_ROLEPLAY_UNITS_HELP = "Controls the customization of units that do not have roleplay profiles.", + NAMEPLATES_CONFIG_CUSTOMIZE_NPC_UNITS = "Customize NPC units", + NAMEPLATES_CONFIG_CUSTOMIZE_NPC_UNITS_HELP = "Controls the customization of NPC units.", NAMEPLATES_CONFIG_ICON_SIZE = "Icon size", NAMEPLATES_CONFIG_ICON_SIZE_HELP = "Configures the size of icons displayed on nameplates if the |cffffff00Show icons|r option is enabled.", NAMEPLATES_CONFIG_ACTIVE_QUERY = "Automatically fetch profiles", @@ -1431,6 +1431,18 @@ If you wish to report %s's profile and you cannot target them you will need to o NAMEPLATES_CONFIG_ENABLE_CLASS_COLOR_FALLBACK_HELP = "If checked, this enables the use of class colors for names and health bars as a fallback for units that do not have a custom class color in their profile.|n|nUnits that do not have roleplay profiles are unaffected by this setting and will not be class-colored.", NAMEPLATES_CONFIG_BLIZZARD_NAME_ONLY = "Hide bars on |cff449fe0Blizzard|r nameplates", NAMEPLATES_CONFIG_BLIZZARD_NAME_ONLY_HELP = "If checked, this enables the use of name-only mode for |cff449fe0Blizzard|r nameplates.|n|nIn this mode, all nameplates will have their health bars hidden, including those of enemy units and other players with or without roleplay profiles.|n|nThis option requires a UI reload to take effect.", + NAMEPLATES_CONFIG_UNIT_STATE_SHOW = "Show", + NAMEPLATES_CONFIG_UNIT_STATE_SHOW_HELP = "Show nameplates for these units with full customizations applied.|n|nVisibility of these nameplates may be overridden by other settings.", + NAMEPLATES_CONFIG_UNIT_STATE_HIDE = "Always hide", + NAMEPLATES_CONFIG_UNIT_STATE_HIDE_HELP = "Always hide nameplates for these units.", + NAMEPLATES_CONFIG_UNIT_STATE_DISABLE = "Do not customize", + NAMEPLATES_CONFIG_UNIT_STATE_DISABLE_HELP = "Ignore nameplates for these units and do not customize them.", + NAMEPLATES_CONFIG_UNIT_NAME_FULL = "Show full name", + NAMEPLATES_CONFIG_UNIT_NAME_FULL_HELP = "Shows the full name of units.", + NAMEPLATES_CONFIG_UNIT_NAME_FIRST = "Show first name", + NAMEPLATES_CONFIG_UNIT_NAME_FIRST_HELP = "Only show first names of players rather than full names.|n|nThis will not work with companion units and profiles received from other roleplay addons.", + NAMEPLATES_CONFIG_UNIT_NAME_ORIGINAL = "Show original name", + NAMEPLATES_CONFIG_UNIT_NAME_ORIGINAL_HELP = "Shows the original unmodified player name of the unit.", BLIZZARD_NAMEPLATES_MODULE_NAME = "Blizzard Nameplates", BLIZZARD_NAMEPLATES_MODULE_DESCRIPTION = "Enables the customization of Blizzard's default nameplates.", @@ -1553,14 +1565,10 @@ If you wish to report %s's profile and you cannot target them you will need to o CO_TOOLBAR_VISIBILITY_2 = "Only show in-character", CO_TOOLBAR_VISIBILITY_3 = "Always hidden", - NAMEPLATES_CONFIG_CUSTOMIZE_FIRST_NAMES = "Show first names only", - NAMEPLATES_CONFIG_CUSTOMIZE_FIRST_NAMES_HELP = "If checked, only show the first names rather than full names.|n|nThis can only be applied to player units, and will not work with profiles received from other roleplay addons.", NAMEPLATES_CONFIG_CUSTOMIZE_GUILD = "Show custom guild names", NAMEPLATES_CONFIG_CUSTOMIZE_GUILD_HELP = "If checked, show custom guild names on nameplates that support them.", NAMEPLATES_CONFIG_DISABLE_IN_INSTANCES = "Disable customizations in instances", NAMEPLATES_CONFIG_DISABLE_IN_INSTANCES_HELP = "If checked, disables nameplate customizations while in instances.|n|nIn instanced content friendly nameplates cannot be customized.", - NAMEPLATES_CONFIG_DISABLE_NON_PLAYABLE_UNITS = "Disable customizations on NPC units", - NAMEPLATES_CONFIG_DISABLE_NON_PLAYABLE_UNITS_HELP = "If checked, disables nameplate customizations on non-playable character units.", NAMEPLATES_CONFIG_MAX_NAME_CHARS = "Maximum name length", NAMEPLATES_CONFIG_MAX_NAME_CHARS_HELP = "The maximum number of characters to display for names and prefix titles. Names exceeding this length will be cropped.", NAMEPLATES_CONFIG_MAX_TITLE_CHARS = "Maximum title length", diff --git a/totalRP3/Modules/Flyway/Flyway.lua b/totalRP3/Modules/Flyway/Flyway.lua index d0b93410d..9d1ae5c61 100644 --- a/totalRP3/Modules/Flyway/Flyway.lua +++ b/totalRP3/Modules/Flyway/Flyway.lua @@ -5,7 +5,7 @@ TRP3_API.flyway = {}; local type, tostring = type, tostring; -local SCHEMA_VERSION = 15; +local SCHEMA_VERSION = 16; if not TRP3_Flyway then TRP3_Flyway = {}; diff --git a/totalRP3/Modules/Flyway/FlywayPatches.lua b/totalRP3/Modules/Flyway/FlywayPatches.lua index a8f4611e9..13bacc77b 100644 --- a/totalRP3/Modules/Flyway/FlywayPatches.lua +++ b/totalRP3/Modules/Flyway/FlywayPatches.lua @@ -198,3 +198,56 @@ TRP3_API.flyway.patches["15"] = function() TRP3_Configuration["increase_color_contrast"] = nil; end end + +TRP3_API.flyway.patches["16"] = function() + -- This patch migrates a few nameplates settings from separated booleans + -- to enums. + + if not TRP3_Configuration then + return; + end + + local customizeNonRoleplayUnits; + local customizeNPCUnits; + local customizeOOCUnits; + local customizeNames; + + if TRP3_Configuration["NamePlates_DisableOutOfCharacterUnits"] then + customizeOOCUnits = TRP3_NamePlateUnitCustomizationState.Disable; + elseif TRP3_Configuration["NamePlates_HideOutOfCharacterUnits"] then + customizeOOCUnits = TRP3_NamePlateUnitCustomizationState.Hide; + else + customizeOOCUnits = TRP3_NamePlateUnitCustomizationState.Show; + end + + if TRP3_Configuration["NamePlates_DisableNonPlayableUnits"] then + customizeNPCUnits = TRP3_NamePlateUnitCustomizationState.Disable; + else + customizeNPCUnits = TRP3_NamePlateUnitCustomizationState.Show; + end + + if TRP3_Configuration["NamePlates_HideNonRoleplayUnits"] then + customizeNonRoleplayUnits = TRP3_NamePlateUnitCustomizationState.Hide; + else + customizeNonRoleplayUnits = TRP3_NamePlateUnitCustomizationState.Show; + end + + if TRP3_Configuration["NamePlates_CustomizeNames"] == false then + customizeNames = TRP3_NamePlateUnitNameDisplayMode.OriginalName; + elseif TRP3_Configuration["NamePlates_CustomizeFirstNames"] then + customizeNames = TRP3_NamePlateUnitNameDisplayMode.FirstName; + else + customizeNames = TRP3_NamePlateUnitNameDisplayMode.FullName; + end + + TRP3_Configuration["NamePlates_CustomizeNonRoleplayUnits"] = customizeNonRoleplayUnits; + TRP3_Configuration["NamePlates_CustomizeNPCUnits"] = customizeNPCUnits; + TRP3_Configuration["NamePlates_CustomizeOOCUnits"] = customizeOOCUnits; + TRP3_Configuration["NamePlates_CustomizeNames"] = customizeNames; + + TRP3_Configuration["NamePlates_DisableNonPlayableUnits"] = nil; + TRP3_Configuration["NamePlates_HideNonRoleplayUnits"] = nil; + TRP3_Configuration["NamePlates_DisableOutOfCharacterUnits"] = nil; + TRP3_Configuration["NamePlates_HideOutOfCharacterUnits"] = nil; + TRP3_Configuration["NamePlates_CustomizeFirstName"] = nil; +end diff --git a/totalRP3/Modules/NamePlates/NamePlates_Core.lua b/totalRP3/Modules/NamePlates/NamePlates_Core.lua index e23788785..6ccf21356 100644 --- a/totalRP3/Modules/NamePlates/NamePlates_Core.lua +++ b/totalRP3/Modules/NamePlates/NamePlates_Core.lua @@ -21,6 +21,7 @@ local function GetOrCreateDisplayInfo(unitToken) displayInfo.guildRank = nil; displayInfo.guildIsCustom = nil; displayInfo.icon = nil; + displayInfo.isRoleplayUnit = false; displayInfo.name = nil; displayInfo.roleplayStatus = nil; displayInfo.shouldColorHealth = nil; @@ -91,44 +92,48 @@ local function IsUnitOutOfCharacter(unitToken) return roleplayStatus == AddOn_TotalRP3.Enums.ROLEPLAY_STATUS.OUT_OF_CHARACTER; end +local function IsNPCUnit(unitToken) + return not UnitIsPlayer(unitToken) and not UnitIsOtherPlayersPet(unitToken); +end + local function ShouldCustomizeUnitNamePlate(unitToken) + local shouldCustomize; + if not TRP3_NamePlates:IsEnabled() then - return false; -- Module is disabled. + shouldCustomize = false; -- Module is disabled. elseif not unitToken then - return false; -- Unit is invalid. + shouldCustomize = false; -- Unit is invalid. elseif UnitIsUnit(unitToken, "player") then - return false; -- Never decorate personal nameplates. + shouldCustomize = false; -- Never decorate personal nameplates. elseif TRP3_NamePlatesSettings.DisableInCombat and isInCombat then - return false; -- Player is in (or about to enter) combat. + shouldCustomize = false; -- Player is in (or about to enter) combat. elseif TRP3_NamePlatesSettings.DisableInInstances and IsInInstance() then - return false; -- Player is in instanced content. + shouldCustomize = false; -- Player is in instanced content. elseif TRP3_NamePlatesSettings.DisableOutOfCharacter and IsUnitOutOfCharacter("player") then - return false; -- Player is currently OOC. - elseif TRP3_NamePlatesSettings.DisableNonPlayableUnits and (not UnitIsPlayer(unitToken) and not UnitIsOtherPlayersPet(unitToken)) then - return false; -- NPC unit decorations are disabled. - elseif TRP3_NamePlatesSettings.DisableOutOfCharacterUnits and IsUnitOutOfCharacter(unitToken) then - return false; -- Unit is currently OOC. + shouldCustomize = false; -- Player is currently OOC. + elseif TRP3_NamePlatesSettings.CustomizeNPCUnits == TRP3_NamePlateUnitCustomizationState.Disable and IsNPCUnit(unitToken) then + shouldCustomize = false; -- NPC unit decorations are disabled. + elseif TRP3_NamePlatesSettings.CustomizeOOCUnits == TRP3_NamePlateUnitCustomizationState.Disable and IsUnitOutOfCharacter(unitToken) then + shouldCustomize = false; -- Unit is currently OOC. else - return true; + shouldCustomize = true; end + + return shouldCustomize; end local function ShouldHideUnitNamePlate(unitToken) - if TRP3_NamePlatesSettings.ShowTargetUnit and UnitIsUnit(unitToken, "target") then - return false; - end - - local roleplayStatus = GetUnitRoleplayStatus(unitToken); - local isNonRoleplayUnit = (roleplayStatus == nil); - local isOutOfCharacter = (roleplayStatus == AddOn_TotalRP3.Enums.ROLEPLAY_STATUS.OUT_OF_CHARACTER); + local shouldHide; - if TRP3_NamePlatesSettings.HideNonRoleplayUnits and isNonRoleplayUnit then - return true; - elseif TRP3_NamePlatesSettings.HideOutOfCharacterUnits and isOutOfCharacter then - return true; + if TRP3_NamePlatesSettings.CustomizeNPCUnits == TRP3_NamePlateUnitCustomizationState.Hide and IsNPCUnit(unitToken) then + shouldHide = true; -- NPC units should be hidden. + elseif TRP3_NamePlatesSettings.CustomizeOOCUnits == TRP3_NamePlateUnitCustomizationState.Hide and IsUnitOutOfCharacter(unitToken) then + shouldHide = true; -- OOC units should be hidden. else - return false; + shouldHide = false; end + + return shouldHide; end local function GetCompanionColorForDisplay(colorHexString) @@ -153,28 +158,29 @@ end local function GetCharacterUnitDisplayInfo(unitToken, characterID) local displayInfo = GetOrCreateDisplayInfo(unitToken); - displayInfo.shouldHide = ShouldHideUnitNamePlate(unitToken); if characterID and TRP3_API.register.isUnitIDKnown(characterID) then local player = GetOrCreatePlayerFromCharacterID(characterID); local classToken = UnitClassBase(unitToken); + displayInfo.isRoleplayUnit = true; + do -- Names/Titles - if TRP3_NamePlatesSettings.CustomizeNames then - if TRP3_NamePlatesSettings.CustomizeFirstNames then - displayInfo.name = player:GetFirstName(); - end + if TRP3_NamePlatesSettings.CustomizeNames == TRP3_NamePlateUnitNameDisplayMode.FirstName then + displayInfo.name = player:GetFirstName(); -- May be nil or empty. + elseif TRP3_NamePlatesSettings.CustomizeNames == TRP3_NamePlateUnitNameDisplayMode.OriginalName then + displayInfo.name = player:GetName(); -- Should never be nil or empty. + end - if not displayInfo.name or displayInfo.name == "" then - displayInfo.name = player:GetRoleplayingName(); - end + if not displayInfo.name or displayInfo.name == "" then + displayInfo.name = player:GetRoleplayingName(); end if TRP3_NamePlatesSettings.CustomizeTitles then local prefix = player:GetTitle(); if prefix then - displayInfo.name = strjoin(" ", prefix, displayInfo.name or player:GetName()); + displayInfo.name = strjoin(" ", prefix, displayInfo.name); end end @@ -246,13 +252,14 @@ end local function GetCompanionUnitDisplayInfo(unitToken, companionFullID) local displayInfo = GetOrCreateDisplayInfo(unitToken); - displayInfo.shouldHide = ShouldHideUnitNamePlate(unitToken); local profile = TRP3_API.companions.register.getCompanionProfile(companionFullID); if profile and profile.data then + displayInfo.isRoleplayUnit = true; + do -- Names/Titles - if TRP3_NamePlatesSettings.CustomizeNames then + if TRP3_NamePlatesSettings.CustomizeNames ~= TRP3_NamePlateUnitNameDisplayMode.OriginalName then displayInfo.name = profile.data.NA; end @@ -300,7 +307,6 @@ end local function GetNonPlayableUnitDisplayInfo(unitToken) local displayInfo = GetOrCreateDisplayInfo(unitToken); - displayInfo.shouldHide = ShouldHideUnitNamePlate(unitToken); return displayInfo; end @@ -474,6 +480,31 @@ function TRP3_NamePlates:GetUnitDisplayInfo(unitToken) end end + -- Apply additional post-filter logic for non-roleplay units. Filters can + -- flag display info as being roleplay related or not, allowing other + -- addons to mark units like NPCs as being roleplay units. + + if displayInfo and not displayInfo.isRoleplayUnit then + if TRP3_NamePlatesSettings.CustomizeNonRoleplayUnits == TRP3_NamePlateUnitCustomizationState.Disable then + displayInfo = nil; + elseif TRP3_NamePlatesSettings.CustomizeNonRoleplayUnits == TRP3_NamePlateUnitCustomizationState.Hide then + displayInfo.shouldHide = true; + end + end + + -- If no explicit visibility was set by any filter, figure out a default + -- based on the unit in question. + + if displayInfo and displayInfo.shouldHide == nil then + displayInfo.shouldHide = ShouldHideUnitNamePlate(unitToken); + end + + -- Target visibility takes priority over everything else and is forced. + + if displayInfo and TRP3_NamePlatesSettings.ShowTargetUnit and UnitIsUnit(unitToken, "target") then + displayInfo.shouldHide = false; + end + return displayInfo; end diff --git a/totalRP3/Modules/NamePlates/NamePlates_Settings.lua b/totalRP3/Modules/NamePlates/NamePlates_Settings.lua index 71d7faee7..a634b918e 100644 --- a/totalRP3/Modules/NamePlates/NamePlates_Settings.lua +++ b/totalRP3/Modules/NamePlates/NamePlates_Settings.lua @@ -13,26 +13,36 @@ local L = TRP3_API.loc; -- is updated each time the LoadSettings function is called. TRP3_NamePlatesSettings = nil; +TRP3_NamePlateUnitCustomizationState = { + Show = 1, + Hide = 2, + Disable = 3, +}; + +TRP3_NamePlateUnitNameDisplayMode = { + FullName = 1, + FirstName = 2, + OriginalName = 3, +}; + local DefaultSettings = { - CustomizeFirstNames = false, CustomizeFullTitles = false, CustomizeGuild = false, CustomizeHealthColors = true, CustomizeIcons = false, CustomizeNameColors = true, - CustomizeNames = true, + CustomizeNonRoleplayUnits = TRP3_NamePlateUnitCustomizationState.Show, + CustomizeOOCUnits = TRP3_NamePlateUnitCustomizationState.Show, + CustomizeNPCUnits = TRP3_NamePlateUnitCustomizationState.Show, + CustomizeNames = TRP3_NamePlateUnitNameDisplayMode.FullName, CustomizeRoleplayStatus = false, CustomizeTitles = true, DisableInCombat = false, DisableInInstances = true, - DisableNonPlayableUnits = false, DisableOutOfCharacter = false, - DisableOutOfCharacterUnits = false, EnableActiveQuery = true, EnableClassColorFallback = true, EnableNameOnlyMode = false, - HideNonRoleplayUnits = false, - HideOutOfCharacterUnits = false, IconSize = 16, MaximumNameLength = 30, MaximumTitleLength = 30, @@ -119,57 +129,71 @@ function TRP3_NamePlatesUtil.RegisterSettings() }, { inherit = "TRP3_ConfigCheck", - title = L.NAMEPLATES_CONFIG_DISABLE_OUT_OF_CHARACTER_UNITS, - help = L.NAMEPLATES_CONFIG_DISABLE_OUT_OF_CHARACTER_UNITS_HELP, - configKey = MapSettingToConfigKey("DisableOutOfCharacterUnits"), - }, - { - inherit = "TRP3_ConfigCheck", - title = L.NAMEPLATES_CONFIG_DISABLE_NON_PLAYABLE_UNITS, - help = L.NAMEPLATES_CONFIG_DISABLE_NON_PLAYABLE_UNITS_HELP, - configKey = MapSettingToConfigKey("DisableNonPlayableUnits"), + title = L.NAMEPLATES_CONFIG_SHOW_TARGET_UNIT, + help = L.NAMEPLATES_CONFIG_SHOW_TARGET_UNIT_HELP, + configKey = MapSettingToConfigKey("ShowTargetUnit"), }, { - inherit = "TRP3_ConfigCheck", - title = L.NAMEPLATES_CONFIG_HIDE_NON_ROLEPLAY_UNITS, - help = L.NAMEPLATES_CONFIG_HIDE_NON_ROLEPLAY_UNITS_HELP, - configKey = MapSettingToConfigKey("HideNonRoleplayUnits"), + inherit = "TRP3_ConfigDropDown", + title = L.NAMEPLATES_CONFIG_CUSTOMIZE_NON_ROLEPLAY_UNITS, + help = L.NAMEPLATES_CONFIG_CUSTOMIZE_NON_ROLEPLAY_UNITS_HELP, + listContent = { + { L.NAMEPLATES_CONFIG_UNIT_STATE_SHOW, TRP3_NamePlateUnitCustomizationState.Show, L.NAMEPLATES_CONFIG_UNIT_STATE_SHOW_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_STATE_HIDE, TRP3_NamePlateUnitCustomizationState.Hide, L.NAMEPLATES_CONFIG_UNIT_STATE_HIDE_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_STATE_DISABLE, TRP3_NamePlateUnitCustomizationState.Disable, L.NAMEPLATES_CONFIG_UNIT_STATE_DISABLE_HELP }, + }, + configKey = MapSettingToConfigKey("CustomizeNonRoleplayUnits"), + listWidth = nil, + listCancel = true, }, { - inherit = "TRP3_ConfigCheck", - title = L.NAMEPLATES_CONFIG_HIDE_OUT_OF_CHARACTER_UNITS, - help = L.NAMEPLATES_CONFIG_HIDE_OUT_OF_CHARACTER_UNITS_HELP, - configKey = MapSettingToConfigKey("HideOutOfCharacterUnits"), + inherit = "TRP3_ConfigDropDown", + title = L.NAMEPLATES_CONFIG_CUSTOMIZE_OOC_UNITS, + help = L.NAMEPLATES_CONFIG_CUSTOMIZE_OOC_UNITS_HELP, + listContent = { + { L.NAMEPLATES_CONFIG_UNIT_STATE_SHOW, TRP3_NamePlateUnitCustomizationState.Show, L.NAMEPLATES_CONFIG_UNIT_STATE_SHOW_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_STATE_HIDE, TRP3_NamePlateUnitCustomizationState.Hide, L.NAMEPLATES_CONFIG_UNIT_STATE_HIDE_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_STATE_DISABLE, TRP3_NamePlateUnitCustomizationState.Disable, L.NAMEPLATES_CONFIG_UNIT_STATE_DISABLE_HELP }, + }, + configKey = MapSettingToConfigKey("CustomizeOOCUnits"), + listWidth = nil, + listCancel = true, }, { - inherit = "TRP3_ConfigCheck", - title = L.NAMEPLATES_CONFIG_SHOW_TARGET_UNIT, - help = L.NAMEPLATES_CONFIG_SHOW_TARGET_UNIT_HELP, - configKey = MapSettingToConfigKey("ShowTargetUnit"), + inherit = "TRP3_ConfigDropDown", + title = L.NAMEPLATES_CONFIG_CUSTOMIZE_NPC_UNITS, + help = L.NAMEPLATES_CONFIG_CUSTOMIZE_NPC_UNITS_HELP, + listContent = { + { L.NAMEPLATES_CONFIG_UNIT_STATE_SHOW, TRP3_NamePlateUnitCustomizationState.Show, L.NAMEPLATES_CONFIG_UNIT_STATE_SHOW_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_STATE_HIDE, TRP3_NamePlateUnitCustomizationState.Hide, L.NAMEPLATES_CONFIG_UNIT_STATE_HIDE_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_STATE_DISABLE, TRP3_NamePlateUnitCustomizationState.Disable, L.NAMEPLATES_CONFIG_UNIT_STATE_DISABLE_HELP }, + }, + configKey = MapSettingToConfigKey("CustomizeNPCUnits"), + listWidth = nil, + listCancel = true, }, { inherit = "TRP3_ConfigH1", title = L.NAMEPLATES_CONFIG_ELEMENT_HEADER, }, { - inherit = "TRP3_ConfigCheck", + inherit = "TRP3_ConfigDropDown", title = L.NAMEPLATES_CONFIG_CUSTOMIZE_NAMES, help = L.NAMEPLATES_CONFIG_CUSTOMIZE_NAMES_HELP, + listContent = { + { L.NAMEPLATES_CONFIG_UNIT_NAME_FULL, TRP3_NamePlateUnitNameDisplayMode.FullName, L.NAMEPLATES_CONFIG_UNIT_NAME_FULL_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_NAME_FIRST, TRP3_NamePlateUnitNameDisplayMode.FirstName, L.NAMEPLATES_CONFIG_UNIT_NAME_FIRST_HELP }, + { L.NAMEPLATES_CONFIG_UNIT_NAME_ORIGINAL, TRP3_NamePlateUnitNameDisplayMode.OriginalName, L.NAMEPLATES_CONFIG_UNIT_NAME_ORIGINAL_HELP }, + }, configKey = MapSettingToConfigKey("CustomizeNames"), - }, - { - inherit = "TRP3_ConfigCheck", - title = L.NAMEPLATES_CONFIG_CUSTOMIZE_FIRST_NAMES, - help = L.NAMEPLATES_CONFIG_CUSTOMIZE_FIRST_NAMES_HELP, - configKey = MapSettingToConfigKey("CustomizeFirstNames"), - dependentOnOptions = { MapSettingToConfigKey("CustomizeNames") }, + listWidth = nil, + listCancel = true, }, { inherit = "TRP3_ConfigSlider", title = L.NAMEPLATES_CONFIG_MAX_NAME_CHARS, help = L.NAMEPLATES_CONFIG_MAX_NAME_CHARS_HELP, configKey = MapSettingToConfigKey("MaximumNameLength"), - dependentOnOptions = { MapSettingToConfigKey("CustomizeNames") }, min = 10, max = 60, step = 1,