Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOProUnity_V2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
perfectdicky
YGOProUnity_V2
Commits
8266c93c
Commit
8266c93c
authored
Aug 31, 2022
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GameMessage.SelectPlace support cancel
parent
f3cfdd59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
2 deletions
+36
-2
Assets/SibylSystem/Ocgcore/Ocgcore.cs
Assets/SibylSystem/Ocgcore/Ocgcore.cs
+36
-2
No files found.
Assets/SibylSystem/Ocgcore/Ocgcore.cs
View file @
8266c93c
...
@@ -3484,8 +3484,12 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -3484,8 +3484,12 @@ public class Ocgcore : ServantWithCardDescription
binaryMaster = new BinaryMaster();
binaryMaster = new BinaryMaster();
player = r.ReadByte();
player = r.ReadByte();
min = r.ReadByte();
min = r.ReadByte();
//TODO: can cancel
bool cancelable = false;
if (min == 0) min = 1;
if (min == 0)
{
cancelable = true;
min = 1;
}
var _field = ~r.ReadUInt32();
var _field = ~r.ReadUInt32();
if (Program.I().setting.setting.hand.value || Program.I().setting.setting.handm.value ||
if (Program.I().setting.setting.hand.value || Program.I().setting.setting.handm.value ||
currentMessage == GameMessage.SelectDisfield)
currentMessage == GameMessage.SelectDisfield)
...
@@ -3581,6 +3585,10 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -3581,6 +3585,10 @@ public class Ocgcore : ServantWithCardDescription
else
else
gameField.setHint(GameStringManager.get_unsafe(570));
gameField.setHint(GameStringManager.get_unsafe(570));
}
}
if (cancelable)
{
gameInfo.addHashedButton("cancelPlace", -1, superButtonType.no, InterString.Get("取消操作@ui"));
}
}
}
else
else
{
{
...
@@ -7054,6 +7062,12 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -7054,6 +7062,12 @@ public class Ocgcore : ServantWithCardDescription
return;
return;
}
}
if (btn.hashString == "cancelPlace")
{
cancelSelectPlace();
return;
}
switch (currentMessage)
switch (currentMessage)
{
{
case GameMessage.SelectBattleCmd:
case GameMessage.SelectBattleCmd:
...
@@ -7115,6 +7129,18 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -7115,6 +7129,18 @@ public class Ocgcore : ServantWithCardDescription
if (realized) realize(true);
if (realized) realize(true);
}
}
private void cancelSelectPlace()
{
clearAllSelectPlace();
BinaryMaster binaryMaster = new BinaryMaster();
byte[] resp = new byte[3];
resp[0] = (byte)localPlayer(0);
resp[1] = 0;
resp[2] = 0;
binaryMaster.writer.Write(resp);
sendReturn(binaryMaster.get());
}
private void clearAllShowed()
private void clearAllShowed()
{
{
for (var i = 0; i < cards.Count; i++)
for (var i = 0; i < cards.Count; i++)
...
@@ -7561,6 +7587,7 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -7561,6 +7587,7 @@ public class Ocgcore : ServantWithCardDescription
if (flagForTimeConfirm)
if (flagForTimeConfirm)
return;
return;
if (gameInfo.queryHashedButton("cancleSelected")) return;
if (gameInfo.queryHashedButton("cancleSelected")) return;
if (gameInfo.queryHashedButton("cancelPlace")) return;
rightExcited = true;
rightExcited = true;
//gameInfo.ignoreChain_set(true);
//gameInfo.ignoreChain_set(true);
base.ES_mouseDownRight();
base.ES_mouseDownRight();
...
@@ -7659,6 +7686,13 @@ public class Ocgcore : ServantWithCardDescription
...
@@ -7659,6 +7686,13 @@ public class Ocgcore : ServantWithCardDescription
var binaryMaster = new BinaryMaster();
var binaryMaster = new BinaryMaster();
binaryMaster.writer.Write(-1);
binaryMaster.writer.Write(-1);
sendReturn(binaryMaster.get());
sendReturn(binaryMaster.get());
return;
}
if (gameInfo.queryHashedButton("cancelPlace"))
{
cancelSelectPlace();
return;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment