Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Equipment Row 상태일 때 커스텀 장비를 구분할 수 없음 -> 커스텀 장비가 표시되는 케이스를 잘 처리하고 상황별 테스트를 다 해봐야 함
  • Loading branch information
tyrosine1153 committed Sep 13, 2024
1 parent 7519f4f commit 1362644
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
2 changes: 1 addition & 1 deletion nekoyume/Assets/_Scripts/Blockchain/ActionRenderHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ private void ResponseRapidCombination(

NotificationSystem.CancelReserve(result.itemUsable.ItemId);
NotificationSystem.Push(
result.itemUsable is Equipment e && e.IconId != 0 && e.Id != e.IconId
result.itemUsable is Equipment { ByCustomCraft: true }
? MailType.CustomCraft
: MailType.Workshop,
L10nManager.Localize(formatKey, result.itemUsable.GetLocalizedName()),
Expand Down
23 changes: 19 additions & 4 deletions nekoyume/Assets/_Scripts/Extensions/LocalizationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,11 +519,24 @@ public static string GetLocalizedFavName(string ticker)
public static string GetLocalizedNonColoredName(this ItemBase item,
bool useElementalIcon = true)
{
var equipmentId = item is Equipment equipment ? equipment.IconId : item.Id;
int equipmentId;
bool byCustomCraft;
if (item is Equipment equipment)
{
equipmentId = equipment.IconId;
byCustomCraft = equipment.ByCustomCraft;
}
else
{
equipmentId = item.Id;
byCustomCraft = false;
}

return GetLocalizedNonColoredName(
item.ElementalType,
equipmentId,
useElementalIcon && item.ItemType.HasElementType());
useElementalIcon && item.ItemType.HasElementType(),
byCustomCraft);
}

public static string GetLocalizedName(this EquipmentItemSheet.Row equipmentRow, int level,
Expand All @@ -550,10 +563,12 @@ public static string GetLocalizedName(this ConsumableItemSheet.Row consumableRow
}

public static string GetLocalizedNonColoredName(ElementalType elementalType,
int equipmentId, bool useElementalIcon)
int equipmentId, bool useElementalIcon, bool byCustomCraft = false)
{
var elemental = useElementalIcon ? GetElementalIcon(elementalType) : string.Empty;
var name = L10nManager.Localize($"ITEM_NAME_{equipmentId}");
var name = L10nManager.Localize(byCustomCraft
? $"ITEM_NAME_CUSTOM_{equipmentId}"
: $"ITEM_NAME_{equipmentId}");
return $"{name}{elemental}";
}

Expand Down

0 comments on commit 1362644

Please sign in to comment.