Skip to content

Commit

Permalink
All dropdowns get consistent + Some delete relation stuff (#1050)
Browse files Browse the repository at this point in the history
* All dropdowns get consistent

Dropdowns will generally be: Change nothing > Do not show > Change something > Change all (the bigger/more permissive the change, the lower in the list. Where applicable!).

* Make "Delete Relations" option red as it is destructive

Deleting relations can also hurt your feelings maybe. :(

* Relation in use means greyed out

Mind you, due to how the menu list works.. If you disable an option it has no "hover" state so the tooltip doesn't actually trigger.

* Don't lose the element data reference before setting tooltips

---------

Co-authored-by: Daniel Yates <[email protected]>
  • Loading branch information
Raenore and Meorawr authored Jul 20, 2024
1 parent 9f20d3d commit 2d9598e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 27 deletions.
1 change: 1 addition & 0 deletions totalRP3/Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ Class: 50 characters|r]],
CO_RELATIONS_NEW_COLOR_TT = "This will determine the relation color.",
CO_RELATIONS_MENU_EDIT = "Edit relation",
CO_RELATIONS_MENU_DELETE = "Delete relation",
CO_RELATIONS_MENU_DELETE_DISABLED_TT = "You cannot delete relations that are currently associated with a profile.",
CO_CURSOR_TITLE = "Cursor interactions",
CO_CURSOR_RIGHT_CLICK = "Right-click to open profile",
CO_CURSOR_RIGHT_CLICK_TT = [[Right-click on a player in the 3D world to open their profile, if they have one.
Expand Down
26 changes: 13 additions & 13 deletions totalRP3/Modules/Dashboard/StatusPanel.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,34 +76,34 @@ local function SetWalkup(walkup)
end

local function GenerateRPStatusMenu(_, rootDescription)
do -- In character
local status = AddOn_TotalRP3.Enums.ROLEPLAY_STATUS.IN_CHARACTER;
local elementDescription = rootDescription:CreateRadio(L.DB_STATUS_RP_IC, IsRoleplayStatus, SetRoleplayStatus, status);
TRP3_MenuUtil.AttachTexture(elementDescription, [[Interface\COMMON\Indicator-Green]]);
TRP3_MenuUtil.SetElementTooltip(elementDescription, L.DB_STATUS_RP_IC_TT);
end

do -- Out of character
local status = AddOn_TotalRP3.Enums.ROLEPLAY_STATUS.OUT_OF_CHARACTER;
local elementDescription = rootDescription:CreateRadio(L.DB_STATUS_RP_OOC, IsRoleplayStatus, SetRoleplayStatus, status);
TRP3_MenuUtil.AttachTexture(elementDescription, [[Interface\COMMON\Indicator-Red]]);
TRP3_MenuUtil.SetElementTooltip(elementDescription, L.DB_STATUS_RP_OOC_TT);
end

do -- In character
local status = AddOn_TotalRP3.Enums.ROLEPLAY_STATUS.IN_CHARACTER;
local elementDescription = rootDescription:CreateRadio(L.DB_STATUS_RP_IC, IsRoleplayStatus, SetRoleplayStatus, status);
TRP3_MenuUtil.AttachTexture(elementDescription, [[Interface\COMMON\Indicator-Green]]);
TRP3_MenuUtil.SetElementTooltip(elementDescription, L.DB_STATUS_RP_IC_TT);
end
end

local function GenerateWalkupMenu(_, rootDescription)
do -- Walkup No
local walkup = AddOn_TotalRP3.Enums.WALKUP.NO;
local elementDescription = rootDescription:CreateRadio(L.CM_DO_NOT_SHOW, IsWalkupFriendly, SetWalkup, walkup);
TRP3_MenuUtil.AttachTexture(elementDescription);
end

do -- Walkup Yes
local walkup = AddOn_TotalRP3.Enums.WALKUP.YES;
local elementDescription = rootDescription:CreateRadio(L.CM_YES, IsWalkupFriendly, SetWalkup, walkup);
TRP3_MenuUtil.AttachTexture(elementDescription, [[Interface\AddOns\totalRP3\Resources\UI\ui-icon-walkup.tga]]);
TRP3_MenuUtil.SetElementTooltip(elementDescription, L.DB_STATUS_WU_YES_TT);
end

do -- Walkup No
local walkup = AddOn_TotalRP3.Enums.WALKUP.NO;
local elementDescription = rootDescription:CreateRadio(L.CM_DO_NOT_SHOW, IsWalkupFriendly, SetWalkup, walkup);
TRP3_MenuUtil.AttachTexture(elementDescription);
end
end

local function GenerateXPStatusMenu(_, rootDescription)
Expand Down
24 changes: 12 additions & 12 deletions totalRP3/Modules/Register/Characters/RegisterMisc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,64 +36,64 @@ local function buildStyleStructure()
name = loc.REG_PLAYER_STYLE_INJURY,
tooltipText = loc.REG_PLAYER_STYLE_INJURY_TT,
values = {
{YES, 1},
{loc.CM_DO_NOT_SHOW, 0},
{NO, 2},
{loc.REG_PLAYER_STYLE_PERMI, 3},
{loc.CM_DO_NOT_SHOW, 0},
{YES, 1},
}
},
{
id = "3",
name = loc.REG_PLAYER_STYLE_DEATH,
tooltipText = loc.REG_PLAYER_STYLE_DEATH_TT,
values = {
{YES, 1},
{loc.CM_DO_NOT_SHOW, 0},
{NO, 2},
{loc.REG_PLAYER_STYLE_PERMI, 3},
{loc.CM_DO_NOT_SHOW, 0},
{YES, 1},
}
},
{
id = "4",
name = loc.REG_PLAYER_STYLE_ROMANCE,
tooltipText = loc.REG_PLAYER_STYLE_ROMANCE_TT,
values = {
{YES, 1},
{loc.CM_DO_NOT_SHOW, 0},
{NO, 2},
{loc.REG_PLAYER_STYLE_PERMI, 3},
{loc.CM_DO_NOT_SHOW, 0},
{YES, 1},
}
},
{
id = "7",
name = loc.REG_PLAYER_STYLE_CRIME,
tooltipText = loc.REG_PLAYER_STYLE_CRIME_TT,
values = {
{YES, 1},
{loc.CM_DO_NOT_SHOW, 0},
{NO, 2},
{loc.REG_PLAYER_STYLE_PERMI, 3},
{loc.CM_DO_NOT_SHOW, 0},
{YES, 1},
}
},
{
id = "8",
name = loc.REG_PLAYER_STYLE_LOSSOFCONTROL,
tooltipText = loc.REG_PLAYER_STYLE_LOSSOFCONTROL_TT,
values = {
{YES, 1},
{loc.CM_DO_NOT_SHOW, 0},
{NO, 2},
{loc.REG_PLAYER_STYLE_PERMI, 3},
{loc.CM_DO_NOT_SHOW, 0},
{YES, 1},
}
},
{
id = "6",
name = loc.REG_PLAYER_STYLE_GUILD,
tooltipText = loc.REG_PLAYER_STYLE_GUILD_TT,
values = {
{loc.REG_PLAYER_STYLE_GUILD_IC, 1},
{loc.REG_PLAYER_STYLE_GUILD_OOC, 2},
{loc.CM_DO_NOT_SHOW, 0},
{loc.REG_PLAYER_STYLE_GUILD_OOC, 2},
{loc.REG_PLAYER_STYLE_GUILD_IC, 1},
}
},
};
Expand Down
8 changes: 6 additions & 2 deletions totalRP3/Modules/Register/Characters/RegisterRelations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,12 @@ function updateRelationsList()
TRP3_MenuUtil.CreateContextMenu(button, function(_, description)
description:CreateButton(loc.CO_RELATIONS_MENU_EDIT, onActionSelected, ACTIONS.EDIT..relation.id);
checkRelationUse();
if not relation.inUse then
description:CreateButton(loc.CO_RELATIONS_MENU_DELETE, onActionSelected, ACTIONS.DELETE..relation.id);
if relation.inUse then
local deleteOption = description:CreateButton(loc.CO_RELATIONS_MENU_DELETE);
deleteOption:SetEnabled(false);
TRP3_MenuUtil.SetElementTooltip(deleteOption, loc.CO_RELATIONS_MENU_DELETE_DISABLED_TT);
else
description:CreateButton("|cnRED_FONT_COLOR:" ..loc.CO_RELATIONS_MENU_DELETE.. "|r", onActionSelected, ACTIONS.DELETE..relation.id);
end
end);
end);
Expand Down

0 comments on commit 2d9598e

Please sign in to comment.