Skip to content

Commit

Permalink
Merge pull request #6323 from planetarium/feature/summon-text-branching
Browse files Browse the repository at this point in the history
Summon description text branching
  • Loading branch information
sonohoshi authored Nov 13, 2024
2 parents 185571b + 4e1095a commit 011e6be
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 164 deletions.
178 changes: 18 additions & 160 deletions nekoyume/Assets/Resources/UI/Prefabs/UI_Summon.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -3257,22 +3257,26 @@ MonoBehaviour:
enableObj:
- {fileID: 543786998197747225}
bottomImageColor: {r: 0.7254902, g: 1, b: 0.72156864, a: 1}
descL10nKey: UI_SUMMON_GRIMORE_PHRASE_NEW
- summonResult: 0
tabToggle: {fileID: 454514871044782777}
enableObj:
- {fileID: 8901089498572354511}
bottomImageColor: {r: 1, g: 1, b: 1, a: 1}
descL10nKey: UI_SUMMON_AURA_PHRASE_NEW
- summonResult: 2
tabToggle: {fileID: 8417508641502258821}
enableObj:
- {fileID: 3095810823935262297}
bottomImageColor: {r: 1, g: 1, b: 1, a: 1}
descL10nKey: UI_SUMMON_RUNE_PHRASE_NEW
closeButton: {fileID: 241345997775891456}
catRectTransform: {fileID: 6939644925556165784}
countToggles:
- {fileID: 7304620260917869337}
- {fileID: 4403768214894282462}
- {fileID: 3684862463247581992}
descriptionText: {fileID: 330119708345414754}
--- !u!1 &1889813540128101133
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -11651,163 +11655,6 @@ RectTransform:
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 568.4922, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &6182984444228734276
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8373579150852097259}
- component: {fileID: 5097474162241341184}
- component: {fileID: 7469728294704218380}
- component: {fileID: 7998362494925497879}
- component: {fileID: 8621323714322004004}
- component: {fileID: 2025538247775355399}
m_Layer: 5
m_Name: DetailButton
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8373579150852097259
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6182984444228734276}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1478835999298889222}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 85, y: 299}
m_SizeDelta: {x: 44, y: 44}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5097474162241341184
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6182984444228734276}
m_CullTransparentMesh: 0
--- !u!114 &7469728294704218380
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6182984444228734276}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 14f95dd0f7fd6144f8da2013afeded48, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &7998362494925497879
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6182984444228734276}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 3
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 7469728294704218380}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!95 &8621323714322004004
Animator:
serializedVersion: 5
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6182984444228734276}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 22100000, guid: 2db93b3f45b9c144f9d5d985f2a95adf, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_StabilizeFeet: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorStateOnDisable: 0
m_WriteDefaultValuesOnDisable: 0
--- !u!114 &2025538247775355399
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6182984444228734276}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5a31d2fe1de140e1b55dcc96e488b751, type: 3}
m_Name:
m_EditorClassIdentifier:
type: 0
--- !u!1 &6353310059303529930
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -13643,7 +13490,6 @@ RectTransform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 529691119765606608}
- {fileID: 8373579150852097259}
m_Father: {fileID: 6939644925556165784}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down Expand Up @@ -19680,7 +19526,7 @@ PrefabInstance:
- target: {fileID: 2793420628978180384, guid: 53746e77bf093f04ab7301d07111ce65,
type: 3}
propertyPath: m_SizeDelta.x
value: 110
value: 90
objectReference: {fileID: 0}
- target: {fileID: 2793420628978180384, guid: 53746e77bf093f04ab7301d07111ce65,
type: 3}
Expand All @@ -19705,7 +19551,7 @@ PrefabInstance:
- target: {fileID: 2793420628978180384, guid: 53746e77bf093f04ab7301d07111ce65,
type: 3}
propertyPath: m_AnchoredPosition.x
value: -5
value: -15
objectReference: {fileID: 0}
- target: {fileID: 2793420628978180384, guid: 53746e77bf093f04ab7301d07111ce65,
type: 3}
Expand Down Expand Up @@ -19933,6 +19779,18 @@ PrefabInstance:
m_RemovedComponents:
- {fileID: 4214294061450366436, guid: 53746e77bf093f04ab7301d07111ce65, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: 53746e77bf093f04ab7301d07111ce65, type: 3}
--- !u!114 &330119708345414754 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4157151736857880919, guid: 53746e77bf093f04ab7301d07111ce65,
type: 3}
m_PrefabInstance: {fileID: 4406201977634512181}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &529691119765606608 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 4214294061450366437, guid: 53746e77bf093f04ab7301d07111ce65,
Expand Down
3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/Localization/common.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2093,3 +2093,6 @@ UI_EVENT_DESCRIPTION_2,Shop Package Description,기념 패키지 관련 설명,,
UI_EVENT_DESCRIPTION_3,Double Contents Rewards Description,컨텐츠 보상 2배 관련 설명,,,,,,,,,,
UI_EVENT_DESCRIPTION_4,Growth Boost Description,성장 지원 관련 설명,,,,,,,,,,
UI_MAIN_MENU_EVENT_REWARD,1st Anniversary,1주년 기념,,,,,,,,,,
UI_SUMMON_GRIMORE_PHRASE_NEW,Grimore summon desc,그리모어 소환 설명,,,,,,,,,,,
UI_SUMMON_AURA_PHRASE_NEW,Aura summon desc,아우라 소환 설명,,,,,,,,,,,
UI_SUMMON_RUNE_PHRASE_NEW,Rune summon desc,룬 소환 설명,,,,,,,,,,,
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ public void Show(SummonSheet.Row summonRow,
animator.SetTrigger(AnimatorHashHide);

var bonus = summonCount == 10 ? 1 : 0;
summonItemViews.First().transform.parent.parent.gameObject.SetActive(false);
manySummonItemViews.First().transform.parent.gameObject.SetActive(false);
summonItemViewParentObject.SetActive(false);
manySummonItemViewParentObject.SetActive(false);
singleSummonItemView.Hide();

if (summonCount == 1)
Expand All @@ -170,7 +170,7 @@ public void Show(SummonSheet.Row summonRow,
}
else if (summonCount == 10)
{
summonItemViews.First().transform.parent.parent.gameObject.SetActive(true);
summonItemViewParentObject.SetActive(true);
for (var i = 0; i < summonItemViews.Length; i++)
{
var view = summonItemViews[i];
Expand All @@ -187,7 +187,7 @@ public void Show(SummonSheet.Row summonRow,
}
else
{
manySummonItemViews.First().transform.parent.gameObject.SetActive(true);
manySummonItemViewParentObject.SetActive(true);
for (var i = 0; i < manySummonItemViews.Length; i++)
{
var view = manySummonItemViews[i];
Expand Down
6 changes: 6 additions & 0 deletions nekoyume/Assets/_Scripts/UI/Widget/Summon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using Nekoyume.TableData.Summon;
using Nekoyume.UI.Model;
using Nekoyume.UI.Module;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

Expand All @@ -34,6 +35,7 @@ public class SummonObject
public Toggle tabToggle;
public GameObject[] enableObj;
public Color bottomImageColor;
public string descL10nKey;
}

[SerializeField]
Expand All @@ -60,6 +62,9 @@ public class SummonObject
[SerializeField]
private Toggle[] countToggles;

[SerializeField]
private TextMeshProUGUI descriptionText;

private SummonObject _selectedSummonObj;
private readonly List<IDisposable> _disposables = new();
private int _selectedSummonCount = 10;
Expand Down Expand Up @@ -123,6 +128,7 @@ private void OnClickSummonTabToggle(SummonObject summonObject)
}

_selectedSummonObj.tabToggle.isOn = true;
descriptionText.SetText(L10nManager.Localize(summonObject.descL10nKey));
}

private void SetBySummonResult(SummonResult resultType)
Expand Down

0 comments on commit 011e6be

Please sign in to comment.