Skip to content

feat: empty lobby list text #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 140 additions & 4 deletions Assets/BossRoom/Prefabs/UI/LobbyUI.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -2650,6 +2650,7 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5444621218174688333}
- {fileID: 3902557823681792741}
m_Father: {fileID: 5226752220064165541}
m_RootOrder: 0
Expand Down Expand Up @@ -3164,6 +3165,140 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5870055767430500199
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5444621218174688333}
- component: {fileID: 5318024624199095249}
- component: {fileID: 785373375347833033}
m_Layer: 5
m_Name: EmptyLobbyList (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5444621218174688333
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5870055767430500199}
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_Children: []
m_Father: {fileID: 9204749279882807884}
m_RootOrder: 0
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: 0, y: -78}
m_SizeDelta: {x: 300, y: 50}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5318024624199095249
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5870055767430500199}
m_CullTransparentMesh: 1
--- !u!114 &785373375347833033
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5870055767430500199}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: no lobbies
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 1a8c97d4cbe5134499b26527f8609c7e, type: 2}
m_sharedMaterial: {fileID: -466885322316925189, guid: 1a8c97d4cbe5134499b26527f8609c7e, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4294967295
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
m_enableVertexGradient: 1
m_colorMode: 2
m_fontColorGradient:
topLeft: {r: 0.92156863, g: 1, b: 0.17254902, a: 1}
topRight: {r: 0.92156863, g: 1, b: 0.17254902, a: 1}
bottomLeft: {r: 1, g: 0.6666667, b: 0.078431375, a: 1}
bottomRight: {r: 1, g: 0.6666667, b: 0.078431375, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 1
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 34.3
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 34.3
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 1
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &5892968726015345847
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4056,6 +4191,7 @@ MonoBehaviour:
m_LobbyListItemPrototype: {fileID: 6844302749700945984}
m_JoinCodeField: {fileID: 8248007993983070476}
m_CanvasGroup: {fileID: 5782144806807453527}
m_EmptyLobbyListLabel: {fileID: 785373375347833033}
--- !u!225 &5782144806807453527
CanvasGroup:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -4162,7 +4298,7 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 33
m_fontSize: 20.3
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
Expand Down Expand Up @@ -4324,7 +4460,7 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 6773627913577560496}
m_HandleRect: {fileID: 2234904744820987572}
m_Direction: 2
m_Value: 1
m_Value: 0
m_Size: 1
m_NumberOfSteps: 0
m_OnValueChanged:
Expand Down Expand Up @@ -4361,7 +4497,7 @@ RectTransform:
m_Children:
- {fileID: 3632019498769524828}
m_Father: {fileID: 9204749279882807884}
m_RootOrder: 0
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1}
Expand Down Expand Up @@ -4969,7 +5105,7 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 33
m_fontSize: 20.3
m_fontSizeBase: 36
m_fontWeight: 400
m_enableAutoSizing: 1
Expand Down
11 changes: 11 additions & 0 deletions Assets/BossRoom/Scripts/Client/UI/Lobby/LobbyJoiningUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class LobbyJoiningUI : MonoBehaviour
[SerializeField] LobbyListItemUI m_LobbyListItemPrototype;
[SerializeField] InputField m_JoinCodeField;
[SerializeField] CanvasGroup m_CanvasGroup;
[SerializeField] Graphic m_EmptyLobbyListLabel;

IInstanceResolver m_Container;
LobbyUIMediator m_LobbyUIMediator;
UpdateRunner m_UpdateRunner;
Expand Down Expand Up @@ -80,6 +82,15 @@ void UpdateUI(LobbyListFetchedMessage message)
var localLobby = message.LocalLobbies[i];
m_LobbyListItems[i].SetData(localLobby);
}

if (message.LocalLobbies.Count == 0)
{
m_EmptyLobbyListLabel.enabled = true;
}
else
{
m_EmptyLobbyListLabel.enabled = false;
}
}

void EnsureNumberOfActiveUISlots(int requiredNumber)
Expand Down