Skip to content

Commit

Permalink
status text
Browse files Browse the repository at this point in the history
  • Loading branch information
noescape00 committed Jan 28, 2022
1 parent 6ec9eaa commit 28a6cd8
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 20 deletions.
Expand Up @@ -17,6 +17,8 @@ public class MyCollectionWindow : WindowBase
{
public GameObject ContentGameObject;

public Text StatusText;

public CollectionItem CollectionCopyFromItem;

public ScrollRect ScrollRect;
Expand All @@ -34,6 +36,7 @@ void Awake()

public override async UniTask ShowAsync(bool hideOtherWindows = true)
{
this.StatusText.text = "loading collection";
ScrollRect.verticalNormalizedPosition = this.defaultScrollRectVerticalPosition;

// Disable prev spawned items.
Expand All @@ -58,6 +61,7 @@ public override async UniTask ShowAsync(bool hideOtherWindows = true)
// Create item for each owned ID or enable already spawned item
for (int i = 0; i < ownedIds.Count; i++)
{
this.StatusText.text = contractAddr.Substring(0, 20) + "... " + (i + 1).ToString() + " / " + ownedIds.Count;
long currentId = ownedIds[i];

var alreadySpawnedItem = SpawnedItems.SingleOrDefault(x => x.ContractAddr == contractAddr && x.NFTID == currentId);
Expand Down Expand Up @@ -102,6 +106,8 @@ public override async UniTask ShowAsync(bool hideOtherWindows = true)

for (int i = 0; i < notLoaded.Count; i++)
{
this.StatusText.text = "loading textures " + (i + 1).ToString() + " / " + notLoaded.Count;

try
{
string uri = notLoaded[i].NFTUri;
Expand Down Expand Up @@ -139,6 +145,8 @@ public override async UniTask ShowAsync(bool hideOtherWindows = true)
notLoaded[i].NFTImage.sprite = sprite;
notLoaded[i].ImageLoaded = true;
}

this.StatusText.text = string.Empty;
}

private async UniTask<Texture2D> GetRemoteTextureAsync(string url)
Expand Down
122 changes: 102 additions & 20 deletions Src/NFTWallet/Assets/Scenes/NFTWallet.unity
Expand Up @@ -5125,6 +5125,85 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 226367856}
m_CullTransparentMesh: 1
--- !u!1 &230582718
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 230582719}
- component: {fileID: 230582721}
- component: {fileID: 230582720}
m_Layer: 5
m_Name: Status_Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &230582719
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 230582718}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.7999683, y: 0.7999683, z: 0.7999683}
m_Children: []
m_Father: {fileID: 712493001}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.6606541, y: 0.9137778}
m_AnchorMax: {x: 0.9434635, y: 0.9588151}
m_AnchoredPosition: {x: -1.3916016, y: 3.769989}
m_SizeDelta: {x: 102.06299, y: 4.9640007}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &230582720
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 230582718}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.07058824, g: 0.14117648, b: 0.29803923, 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_FontData:
m_Font: {fileID: 12800000, guid: 653e2fd78293f4941a834ab753d2da83, type: 3}
m_FontSize: 32
m_FontStyle: 0
m_BestFit: 1
m_MinSize: 10
m_MaxSize: 90
m_Alignment: 5
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!222 &230582721
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 230582718}
m_CullTransparentMesh: 1
--- !u!1 &236093002
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6275,7 +6354,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.00002193451, y: 0.0000010337988}
m_AnchoredPosition: {x: -0.00002193451, y: 0.000049810336}
m_SizeDelta: {x: 0.0001, y: 432.3357}
m_Pivot: {x: 0, y: 1}
--- !u!114 &291465010
Expand Down Expand Up @@ -8676,7 +8755,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.716, y: 0.9064598}
m_AnchorMax: {x: 0.95900005, y: 0.9665403}
m_AnchoredPosition: {x: -1.0310059, y: 0.3580017}
m_AnchoredPosition: {x: -1.0310059, y: 0.35803223}
m_SizeDelta: {x: -3.580017, y: -4.458}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &425407166
Expand Down Expand Up @@ -9642,7 +9721,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.8057682, y: 0.015000001}
m_AnchorMax: {x: 0.9267682, y: 0.127}
m_AnchoredPosition: {x: -0.49160767, y: 0.43450928}
m_AnchoredPosition: {x: -0.49157715, y: 0.43450928}
m_SizeDelta: {x: 0.79999924, y: 0.1459961}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &454889231
Expand Down Expand Up @@ -10136,7 +10215,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &479682299
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -11991,7 +12070,7 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0.8556704}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -12437,7 +12516,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.018000001, y: 0.26200002}
m_AnchorMax: {x: 0.9895022, y: 0.772539}
m_AnchoredPosition: {x: 2.7160034, y: -0.14299965}
m_AnchoredPosition: {x: 2.7160034, y: -0.14300156}
m_SizeDelta: {x: 135.33, y: 10.441}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &600041314
Expand Down Expand Up @@ -14570,7 +14649,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
m_IsActive: 1
--- !u!224 &712493001
RectTransform:
m_ObjectHideFlags: 0
Expand All @@ -14585,6 +14664,7 @@ RectTransform:
- {fileID: 927952777}
- {fileID: 274665317}
- {fileID: 1757792255}
- {fileID: 230582719}
m_Father: {fileID: 924735924}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand All @@ -14606,6 +14686,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
ContentGameObject: {fileID: 291465008}
StatusText: {fileID: 230582720}
CollectionCopyFromItem: {fileID: 1981213269}
ScrollRect: {fileID: 1757792256}
SpawnedItems: []
Expand Down Expand Up @@ -16538,6 +16619,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
ContentGameObject: {fileID: 251542382}
StatusText: {fileID: 0}
CollectionCopyFromItem: {fileID: 2060506376}
ScrollRect: {fileID: 1531790165}
SpawnedItems: []
Expand Down Expand Up @@ -16774,7 +16856,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.036000002, y: 0.65168965}
m_AnchorMax: {x: 0.46600002, y: 0.7234598}
m_AnchoredPosition: {x: -0.1317749, y: 0.28948975}
m_AnchoredPosition: {x: -0.13171387, y: 0.28948975}
m_SizeDelta: {x: -0.28601074, y: -0.5790024}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &802207016
Expand Down Expand Up @@ -26014,7 +26096,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.758, y: 0.6252299}
m_AnchorMax: {x: 0.95900005, y: 0.7234598}
m_AnchoredPosition: {x: -0.7925415, y: -0.5}
m_AnchoredPosition: {x: -0.79260254, y: -0.5}
m_SizeDelta: {x: 1.5849915, y: 3.1289978}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1339787309
Expand Down Expand Up @@ -28971,7 +29053,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.018000001, y: 0.26200002}
m_AnchorMax: {x: 0.9902511, y: 0.772539}
m_AnchoredPosition: {x: 2.270996, y: -0.14299965}
m_AnchoredPosition: {x: 2.270996, y: -0.14300156}
m_SizeDelta: {x: 134.44, y: 10.441}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1464513155
Expand Down Expand Up @@ -31072,7 +31154,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.063, y: 0.19100001}
m_AnchorMax: {x: 0.93000007, y: 0.809}
m_AnchoredPosition: {x: 0.5000076, y: 0.0000047683716}
m_AnchoredPosition: {x: 0.5, y: 0.0000038146973}
m_SizeDelta: {x: 0.8809967, y: -0.74900055}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1568895004
Expand Down Expand Up @@ -32749,7 +32831,7 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.99999994, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: 20}
m_Pivot: {x: 0.5, y: 0.5}
Expand Down Expand Up @@ -35458,7 +35540,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.102612294, y: 0.294}
m_AnchorMax: {x: 0.89038736, y: 0.374}
m_AnchoredPosition: {x: 3.7000732, y: 4.0902176}
m_AnchoredPosition: {x: 3.7000732, y: 4.090004}
m_SizeDelta: {x: 10.687988, y: -0.35299683}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1806811932
Expand Down Expand Up @@ -36449,9 +36531,9 @@ RectTransform:
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 20, y: -17}
m_SizeDelta: {x: 20, y: 0}
m_Pivot: {x: 1, y: 1}
--- !u!114 &1847042158
MonoBehaviour:
Expand Down Expand Up @@ -36497,7 +36579,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 586048794}
m_Direction: 2
m_Value: 0
m_Size: 0.8556704
m_Size: 0.99963397
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
Expand Down Expand Up @@ -36962,9 +37044,9 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: -17}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 1}
--- !u!114 &1856518863
MonoBehaviour:
Expand Down Expand Up @@ -41837,9 +41919,9 @@ RectTransform:
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -17, y: 20}
m_SizeDelta: {x: 0, y: 20}
m_Pivot: {x: 0, y: 0}
--- !u!114 &2081270791
MonoBehaviour:
Expand Down

0 comments on commit 28a6cd8

Please sign in to comment.