Skip to content

Commit 8f1d4a5

Browse files
committed
Added empty lobby list text label and code to drive it's visibility (#567)
1 parent 18566e3 commit 8f1d4a5

File tree

2 files changed

+151
-4
lines changed

2 files changed

+151
-4
lines changed

Assets/BossRoom/Prefabs/UI/LobbyUI.prefab

Lines changed: 140 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,6 +2650,7 @@ RectTransform:
26502650
m_LocalPosition: {x: 0, y: 0, z: 0}
26512651
m_LocalScale: {x: 1, y: 1, z: 1}
26522652
m_Children:
2653+
- {fileID: 5444621218174688333}
26532654
- {fileID: 3902557823681792741}
26542655
m_Father: {fileID: 5226752220064165541}
26552656
m_RootOrder: 0
@@ -3164,6 +3165,140 @@ MonoBehaviour:
31643165
m_FillOrigin: 0
31653166
m_UseSpriteMesh: 0
31663167
m_PixelsPerUnitMultiplier: 1
3168+
--- !u!1 &5870055767430500199
3169+
GameObject:
3170+
m_ObjectHideFlags: 0
3171+
m_CorrespondingSourceObject: {fileID: 0}
3172+
m_PrefabInstance: {fileID: 0}
3173+
m_PrefabAsset: {fileID: 0}
3174+
serializedVersion: 6
3175+
m_Component:
3176+
- component: {fileID: 5444621218174688333}
3177+
- component: {fileID: 5318024624199095249}
3178+
- component: {fileID: 785373375347833033}
3179+
m_Layer: 5
3180+
m_Name: EmptyLobbyList (TMP)
3181+
m_TagString: Untagged
3182+
m_Icon: {fileID: 0}
3183+
m_NavMeshLayer: 0
3184+
m_StaticEditorFlags: 0
3185+
m_IsActive: 1
3186+
--- !u!224 &5444621218174688333
3187+
RectTransform:
3188+
m_ObjectHideFlags: 0
3189+
m_CorrespondingSourceObject: {fileID: 0}
3190+
m_PrefabInstance: {fileID: 0}
3191+
m_PrefabAsset: {fileID: 0}
3192+
m_GameObject: {fileID: 5870055767430500199}
3193+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
3194+
m_LocalPosition: {x: 0, y: 0, z: 0}
3195+
m_LocalScale: {x: 1, y: 1, z: 1}
3196+
m_Children: []
3197+
m_Father: {fileID: 9204749279882807884}
3198+
m_RootOrder: 0
3199+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
3200+
m_AnchorMin: {x: 0.5, y: 0.5}
3201+
m_AnchorMax: {x: 0.5, y: 0.5}
3202+
m_AnchoredPosition: {x: 0, y: -78}
3203+
m_SizeDelta: {x: 300, y: 50}
3204+
m_Pivot: {x: 0.5, y: 0.5}
3205+
--- !u!222 &5318024624199095249
3206+
CanvasRenderer:
3207+
m_ObjectHideFlags: 0
3208+
m_CorrespondingSourceObject: {fileID: 0}
3209+
m_PrefabInstance: {fileID: 0}
3210+
m_PrefabAsset: {fileID: 0}
3211+
m_GameObject: {fileID: 5870055767430500199}
3212+
m_CullTransparentMesh: 1
3213+
--- !u!114 &785373375347833033
3214+
MonoBehaviour:
3215+
m_ObjectHideFlags: 0
3216+
m_CorrespondingSourceObject: {fileID: 0}
3217+
m_PrefabInstance: {fileID: 0}
3218+
m_PrefabAsset: {fileID: 0}
3219+
m_GameObject: {fileID: 5870055767430500199}
3220+
m_Enabled: 1
3221+
m_EditorHideFlags: 0
3222+
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
3223+
m_Name:
3224+
m_EditorClassIdentifier:
3225+
m_Material: {fileID: 0}
3226+
m_Color: {r: 1, g: 1, b: 1, a: 1}
3227+
m_RaycastTarget: 0
3228+
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
3229+
m_Maskable: 1
3230+
m_OnCullStateChanged:
3231+
m_PersistentCalls:
3232+
m_Calls: []
3233+
m_text: no lobbies
3234+
m_isRightToLeft: 0
3235+
m_fontAsset: {fileID: 11400000, guid: 1a8c97d4cbe5134499b26527f8609c7e, type: 2}
3236+
m_sharedMaterial: {fileID: -466885322316925189, guid: 1a8c97d4cbe5134499b26527f8609c7e, type: 2}
3237+
m_fontSharedMaterials: []
3238+
m_fontMaterial: {fileID: 0}
3239+
m_fontMaterials: []
3240+
m_fontColor32:
3241+
serializedVersion: 2
3242+
rgba: 4294967295
3243+
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
3244+
m_enableVertexGradient: 1
3245+
m_colorMode: 2
3246+
m_fontColorGradient:
3247+
topLeft: {r: 0.92156863, g: 1, b: 0.17254902, a: 1}
3248+
topRight: {r: 0.92156863, g: 1, b: 0.17254902, a: 1}
3249+
bottomLeft: {r: 1, g: 0.6666667, b: 0.078431375, a: 1}
3250+
bottomRight: {r: 1, g: 0.6666667, b: 0.078431375, a: 1}
3251+
m_fontColorGradientPreset: {fileID: 0}
3252+
m_spriteAsset: {fileID: 0}
3253+
m_tintAllSprites: 0
3254+
m_StyleSheet: {fileID: 0}
3255+
m_TextStyleHashCode: -1183493901
3256+
m_overrideHtmlColors: 1
3257+
m_faceColor:
3258+
serializedVersion: 2
3259+
rgba: 4294967295
3260+
m_fontSize: 34.3
3261+
m_fontSizeBase: 24
3262+
m_fontWeight: 400
3263+
m_enableAutoSizing: 1
3264+
m_fontSizeMin: 18
3265+
m_fontSizeMax: 34.3
3266+
m_fontStyle: 0
3267+
m_HorizontalAlignment: 2
3268+
m_VerticalAlignment: 512
3269+
m_textAlignment: 65535
3270+
m_characterSpacing: 0
3271+
m_wordSpacing: 0
3272+
m_lineSpacing: 0
3273+
m_lineSpacingMax: 0
3274+
m_paragraphSpacing: 0
3275+
m_charWidthMaxAdj: 0
3276+
m_enableWordWrapping: 1
3277+
m_wordWrappingRatios: 0.4
3278+
m_overflowMode: 0
3279+
m_linkedTextComponent: {fileID: 0}
3280+
parentLinkedComponent: {fileID: 0}
3281+
m_enableKerning: 1
3282+
m_enableExtraPadding: 0
3283+
checkPaddingRequired: 0
3284+
m_isRichText: 1
3285+
m_parseCtrlCharacters: 1
3286+
m_isOrthographic: 1
3287+
m_isCullingEnabled: 0
3288+
m_horizontalMapping: 0
3289+
m_verticalMapping: 0
3290+
m_uvLineOffset: 0
3291+
m_geometrySortingOrder: 0
3292+
m_IsTextObjectScaleStatic: 0
3293+
m_VertexBufferAutoSizeReduction: 1
3294+
m_useMaxVisibleDescender: 1
3295+
m_pageToDisplay: 1
3296+
m_margin: {x: 0, y: 0, z: 0, w: 0}
3297+
m_isUsingLegacyAnimationComponent: 0
3298+
m_isVolumetricText: 0
3299+
m_hasFontAssetChanged: 0
3300+
m_baseMaterial: {fileID: 0}
3301+
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
31673302
--- !u!1 &5892968726015345847
31683303
GameObject:
31693304
m_ObjectHideFlags: 0
@@ -4056,6 +4191,7 @@ MonoBehaviour:
40564191
m_LobbyListItemPrototype: {fileID: 6844302749700945984}
40574192
m_JoinCodeField: {fileID: 8248007993983070476}
40584193
m_CanvasGroup: {fileID: 5782144806807453527}
4194+
m_EmptyLobbyListLabel: {fileID: 785373375347833033}
40594195
--- !u!225 &5782144806807453527
40604196
CanvasGroup:
40614197
m_ObjectHideFlags: 0
@@ -4162,7 +4298,7 @@ MonoBehaviour:
41624298
m_faceColor:
41634299
serializedVersion: 2
41644300
rgba: 4294967295
4165-
m_fontSize: 33
4301+
m_fontSize: 20.3
41664302
m_fontSizeBase: 36
41674303
m_fontWeight: 400
41684304
m_enableAutoSizing: 1
@@ -4324,7 +4460,7 @@ MonoBehaviour:
43244460
m_TargetGraphic: {fileID: 6773627913577560496}
43254461
m_HandleRect: {fileID: 2234904744820987572}
43264462
m_Direction: 2
4327-
m_Value: 1
4463+
m_Value: 0
43284464
m_Size: 1
43294465
m_NumberOfSteps: 0
43304466
m_OnValueChanged:
@@ -4361,7 +4497,7 @@ RectTransform:
43614497
m_Children:
43624498
- {fileID: 3632019498769524828}
43634499
m_Father: {fileID: 9204749279882807884}
4364-
m_RootOrder: 0
4500+
m_RootOrder: 1
43654501
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
43664502
m_AnchorMin: {x: 0, y: 1}
43674503
m_AnchorMax: {x: 1, y: 1}
@@ -4969,7 +5105,7 @@ MonoBehaviour:
49695105
m_faceColor:
49705106
serializedVersion: 2
49715107
rgba: 4294967295
4972-
m_fontSize: 33
5108+
m_fontSize: 20.3
49735109
m_fontSizeBase: 36
49745110
m_fontWeight: 400
49755111
m_enableAutoSizing: 1

Assets/BossRoom/Scripts/Client/UI/Lobby/LobbyJoiningUI.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ public class LobbyJoiningUI : MonoBehaviour
1515
[SerializeField] LobbyListItemUI m_LobbyListItemPrototype;
1616
[SerializeField] InputField m_JoinCodeField;
1717
[SerializeField] CanvasGroup m_CanvasGroup;
18+
[SerializeField] Graphic m_EmptyLobbyListLabel;
19+
1820
IInstanceResolver m_Container;
1921
LobbyUIMediator m_LobbyUIMediator;
2022
UpdateRunner m_UpdateRunner;
@@ -80,6 +82,15 @@ void UpdateUI(LobbyListFetchedMessage message)
8082
var localLobby = message.LocalLobbies[i];
8183
m_LobbyListItems[i].SetData(localLobby);
8284
}
85+
86+
if (message.LocalLobbies.Count == 0)
87+
{
88+
m_EmptyLobbyListLabel.enabled = true;
89+
}
90+
else
91+
{
92+
m_EmptyLobbyListLabel.enabled = false;
93+
}
8394
}
8495

8596
void EnsureNumberOfActiveUISlots(int requiredNumber)

0 commit comments

Comments
 (0)