Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
a8a12587
Commit
a8a12587
authored
Sep 19, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
parents
8a0bdc06
4db73567
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
25 deletions
+101
-25
gframe/client_field.cpp
gframe/client_field.cpp
+34
-4
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/event_handler.cpp
gframe/event_handler.cpp
+6
-0
gframe/gframe.cpp
gframe/gframe.cpp
+59
-19
No files found.
gframe/client_field.cpp
View file @
a8a12587
...
...
@@ -1457,8 +1457,23 @@ void ClientField::UpdateDeclarableCodeType(bool enter) {
ancard
.
push_back
(
trycode
);
return
;
}
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
return
;
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
{
std
::
vector
<
int
>
cache
;
cache
.
swap
(
ancard
);
int
sel
=
mainGame
->
lstANCard
->
getSelected
();
int
selcode
=
(
sel
==
-
1
)
?
0
:
cache
[
sel
];
mainGame
->
lstANCard
->
clear
();
for
(
const
auto
&
trycode
:
cache
)
{
if
(
dataManager
.
GetString
(
trycode
,
&
cstr
)
&&
dataManager
.
GetData
(
trycode
,
&
cd
)
&&
is_declarable
(
cd
,
declarable_type
))
{
ancard
.
push_back
(
trycode
);
mainGame
->
lstANCard
->
addItem
(
cstr
.
name
.
c_str
());
if
(
trycode
==
selcode
)
mainGame
->
lstANCard
->
setSelected
(
cstr
.
name
.
c_str
());
}
}
if
(
!
ancard
.
empty
())
return
;
}
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
for
(
auto
cit
=
dataManager
.
_strings
.
begin
();
cit
!=
dataManager
.
_strings
.
end
();
++
cit
)
{
...
...
@@ -1489,8 +1504,23 @@ void ClientField::UpdateDeclarableCodeOpcode(bool enter) {
ancard
.
push_back
(
trycode
);
return
;
}
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
return
;
if
((
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
&&
!
enter
)
{
std
::
vector
<
int
>
cache
;
cache
.
swap
(
ancard
);
int
sel
=
mainGame
->
lstANCard
->
getSelected
();
int
selcode
=
(
sel
==
-
1
)
?
0
:
cache
[
sel
];
mainGame
->
lstANCard
->
clear
();
for
(
const
auto
&
trycode
:
cache
)
{
if
(
dataManager
.
GetString
(
trycode
,
&
cstr
)
&&
dataManager
.
GetData
(
trycode
,
&
cd
)
&&
is_declarable
(
cd
,
opcode
))
{
ancard
.
push_back
(
trycode
);
mainGame
->
lstANCard
->
addItem
(
cstr
.
name
.
c_str
());
if
(
trycode
==
selcode
)
mainGame
->
lstANCard
->
setSelected
(
cstr
.
name
.
c_str
());
}
}
if
(
!
ancard
.
empty
())
return
;
}
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
for
(
auto
cit
=
dataManager
.
_strings
.
begin
();
cit
!=
dataManager
.
_strings
.
end
();
++
cit
)
{
...
...
gframe/duelclient.cpp
View file @
a8a12587
...
...
@@ -3478,7 +3478,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
ebANCard
->
setText
(
L""
);
mainGame
->
wANCard
->
setText
(
textBuffer
);
mainGame
->
dField
.
UpdateDeclarableCode
(
tru
e
);
mainGame
->
dField
.
UpdateDeclarableCode
(
fals
e
);
mainGame
->
PopupElement
(
mainGame
->
wANCard
);
mainGame
->
gMutex
.
Unlock
();
return
false
;
...
...
@@ -3517,7 +3517,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
gMutex
.
Lock
();
mainGame
->
ebANCard
->
setText
(
L""
);
mainGame
->
wANCard
->
setText
(
textBuffer
);
mainGame
->
dField
.
UpdateDeclarableCode
(
tru
e
);
mainGame
->
dField
.
UpdateDeclarableCode
(
fals
e
);
mainGame
->
PopupElement
(
mainGame
->
wANCard
);
mainGame
->
gMutex
.
Unlock
();
return
false
;
...
...
gframe/event_handler.cpp
View file @
a8a12587
...
...
@@ -1472,6 +1472,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mcard
->
position
&
POS_FACEDOWN
)
mcard
=
0
;
}
}
else
if
(
hovered_location
==
LOCATION_EXTRA
)
{
if
(
extra
[
hovered_controler
].
size
())
{
mcard
=
extra
[
hovered_controler
].
back
();
if
(
mcard
->
position
&
POS_FACEDOWN
)
mcard
=
0
;
}
}
else
if
(
hovered_location
==
LOCATION_DECK
)
{
if
(
deck
[
hovered_controler
].
size
())
mcard
=
deck
[
hovered_controler
].
back
();
...
...
gframe/gframe.cpp
View file @
a8a12587
...
...
@@ -12,21 +12,8 @@ bool open_file = false;
wchar_t
open_file_name
[
256
]
=
L""
;
bool
bot_mode
=
false
;
void
GetParameter
(
char
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
wchar_t
arg1
[
260
];
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
arg1
,
260
);
BufferIO
::
EncodeUTF8
(
arg1
,
param
);
#else
strcpy
(
param
,
arg
);
#endif
}
void
GetParameterW
(
wchar_t
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
param
,
260
);
#else
BufferIO
::
DecodeUTF8
(
arg
,
param
);
#endif
}
void
ClickButton
(
irr
::
gui
::
IGUIElement
*
btn
)
{
irr
::
SEvent
event
;
...
...
@@ -72,19 +59,72 @@ int main(int argc, char* argv[]) {
if
(
!
ygo
::
mainGame
->
Initialize
())
return
0
;
#ifdef _WIN32
wchar_t
*
command
=
GetCommandLineW
();
char
buffer
[
2048
];
BufferIO
::
EncodeUTF8
(
command
,
buffer
);
char
*
p
=
buffer
;
argc
=
0
;
int
j
=
0
;
bool
in_QM
=
false
,
in_TEXT
=
false
,
in_SPACE
=
true
;
while
(
*
p
)
{
if
(
in_QM
)
{
if
(
*
p
==
'\"'
)
in_QM
=
false
;
else
++
j
;
}
else
{
switch
(
*
p
)
{
case
'\"'
:
{
in_QM
=
true
;
in_TEXT
=
true
;
if
(
in_SPACE
)
{
argv
[
argc
]
=
p
+
1
;
j
=
0
;
}
in_SPACE
=
FALSE
;
break
;
}
case
' '
:
case
'\t'
:
case
'\n'
:
case
'\r'
:
{
if
(
in_TEXT
)
{
argv
[
argc
][
j
]
=
'\0'
;
++
argc
;
}
in_TEXT
=
FALSE
;
in_SPACE
=
TRUE
;
break
;
}
default:
{
in_TEXT
=
TRUE
;
if
(
in_SPACE
)
{
argv
[
argc
]
=
p
;
j
=
1
;
}
else
++
j
;
in_SPACE
=
FALSE
;
break
;
}
}
}
++
p
;
}
argv
[
argc
][
j
]
=
'\0'
;
++
argc
;
argv
[
argc
]
=
NULL
;
#endif // _WIN32
bool
keep_on_return
=
false
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
argv
[
i
][
0
]
==
'-'
&&
argv
[
i
][
1
]
==
'e'
)
{
char
param
[
128
];
GetParameter
(
param
,
&
argv
[
i
][
2
]);
ygo
::
dataManager
.
LoadDB
(
param
);
ygo
::
dataManager
.
LoadDB
(
&
argv
[
i
][
2
]);
continue
;
}
if
(
!
strcmp
(
argv
[
i
],
"-e"
))
{
// extra database
++
i
;
char
param
[
128
];
GetParameter
(
param
,
&
argv
[
i
][
0
]);
ygo
::
dataManager
.
LoadDB
(
param
);
ygo
::
dataManager
.
LoadDB
(
&
argv
[
i
][
0
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-n"
))
{
// nickName
++
i
;
...
...
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