Commit 2fa3922b authored by mercury233's avatar mercury233

add ready button

parent 5165fc04
......@@ -341,14 +341,16 @@ public class Room : WindowServantSP
}
UIHelper.shiftButton(startButton(), true);
lazyRoom.start.localScale = Vector3.one;
lazyRoom.ready.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f + 30f, 0);
lazyRoom.duelist.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f, 0);
lazyRoom.observer.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f-30f, 0);
lazyRoom.observer.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f, 0);
lazyRoom.start.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f, 0);
}
else
{
UIHelper.shiftButton(startButton(), false);
lazyRoom.start.localScale = Vector3.zero;
lazyRoom.ready.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f, 0);
lazyRoom.duelist.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f, 0);
lazyRoom.observer.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f, 0);
lazyRoom.start.localPosition = new Vector3(lazyRoom.duelist.localPosition.x, -94.2f - 30f - 30f - 30f, 0);
......@@ -832,6 +834,7 @@ public class Room : WindowServantSP
UIHelper.registUIEventTriggerForClick(exitButton().gameObject, listenerForClicked);
UIHelper.registUIEventTriggerForClick(duelistButton().gameObject, listenerForClicked);
UIHelper.registUIEventTriggerForClick(observerButton().gameObject, listenerForClicked);
UIHelper.registUIEventTriggerForClick(readyButton().gameObject, listenerForClicked);
realize();
superScrollView.refreshForOneFrame();
}
......@@ -878,12 +881,32 @@ public class Room : WindowServantSP
return UIHelper.getByName<UIButton>(gameObject, "observer_");
}
private UIButton readyButton()
{
return UIHelper.getByName<UIButton>(gameObject, "ready_");
}
void listenerForClicked(GameObject gameObjectListened)
{
if (gameObjectListened.name == "exit_")
{
Program.I().ocgcore.onExit();
}
if (gameObjectListened.name == "ready_")
{
if (selftype < realPlayers.Length && realPlayers[selftype] != null)
{
if (realPlayers[selftype].getIfPreped())
{
TcpHelper.CtosMessage_HsNotReady();
}
else
{
TcpHelper.CtosMessage_UpdateDeck(new YGOSharp.Deck("deck/" + Config.Get("deckInUse", "wizard") + ".ydk"));
TcpHelper.CtosMessage_HsReady();
}
}
}
if (gameObjectListened.name == "duelist_")
{
TcpHelper.CtosMessage_HsToDuelist();
......
......@@ -2,6 +2,7 @@
using System.Collections;
public class lazyRoom : MonoBehaviour {
public Transform ready;
public Transform duelist;
public Transform observer;
public Transform start;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment