Skip to content

Commit b956e5d

Browse files
added IP button to main menu (#535)
1 parent 9e68691 commit b956e5d

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

Assets/BossRoom/Scenes/MainMenu.unity

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:15103b3bc112b4f77c6bbb6d466fed06b3d55663ed94c89644ebd88d256d3454
3-
size 72582
2+
oid sha256:a19c8354d1b4f8323bda3fdabc60b4d1f26faf395196546ff67da590e56fded1
3+
size 78835

Assets/BossRoom/Scripts/Client/Game/State/ClientMainMenuState.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public class ClientMainMenuState : GameStateBehaviour
2929

3030
[SerializeField] NameGenerationData m_NameGenerationData;
3131
[SerializeField] LobbyUIMediator m_LobbyUIMediator;
32+
[SerializeField] IPUIMediator m_IPUIMediator;
3233

3334
[SerializeField] CanvasGroup m_MainMenuButtonsCanvasGroup;
3435
[SerializeField] GameObject m_SignInSpinner;
@@ -47,6 +48,7 @@ void InjectDependenciesAndInitialize(AuthenticationServiceFacade authServiceFaca
4748

4849
m_Scope.BindInstanceAsSingle(m_NameGenerationData);
4950
m_Scope.BindInstanceAsSingle(m_LobbyUIMediator);
51+
m_Scope.BindInstanceAsSingle(m_IPUIMediator);
5052

5153
var unityAuthenticationInitOptions = new InitializationOptions();
5254

@@ -115,5 +117,11 @@ public void OnStartClicked()
115117
m_LobbyUIMediator.ToggleJoinLobbyUI();
116118
m_LobbyUIMediator.Show();
117119
}
120+
121+
public void OnDirectIPClicked()
122+
{
123+
m_LobbyUIMediator.Hide();
124+
m_IPUIMediator.Show();
125+
}
118126
}
119127
}

Assets/BossRoom/Scripts/Client/UI/IPUIMediator.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class IPUIMediator : MonoBehaviour
2929
[SerializeField] UITinter m_JoinTabButtonBorderTinter;
3030

3131
[SerializeField] UITinter m_HostTabButtonTinter;
32-
32+
3333
[SerializeField] UITinter m_HostTabButtonBorderTinter;
3434

3535
[SerializeField] GameObject m_SignInSpinner;
@@ -63,22 +63,6 @@ void Start()
6363
ToggleCreateIPUI();
6464
}
6565

66-
void Update()
67-
{
68-
if (Input.touchCount == k_NbTouchesToOpenWindow && AnyTouchDown() ||
69-
m_OpenIPWindowKeyCode != KeyCode.None && Input.GetKeyDown(m_OpenIPWindowKeyCode))
70-
{
71-
if (m_CanvasGroup.interactable)
72-
{
73-
Hide();
74-
}
75-
else
76-
{
77-
Show();
78-
}
79-
}
80-
}
81-
8266
static bool AnyTouchDown()
8367
{
8468
foreach (var touch in Input.touches)

0 commit comments

Comments
 (0)