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
0a025936
Commit
0a025936
authored
Nov 17, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fh' into resize
parents
a32b127d
b565e865
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
111 additions
and
36 deletions
+111
-36
gframe/client_card.cpp
gframe/client_card.cpp
+3
-5
gframe/client_card.h
gframe/client_card.h
+1
-2
gframe/deck_con.cpp
gframe/deck_con.cpp
+57
-14
gframe/drawing.cpp
gframe/drawing.cpp
+2
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+6
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+11
-0
gframe/game.cpp
gframe/game.cpp
+8
-0
gframe/game.h
gframe/game.h
+3
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+6
-7
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+6
-7
strings.conf
strings.conf
+8
-0
No files found.
gframe/client_card.cpp
View file @
0a025936
...
...
@@ -18,7 +18,7 @@ ClientCard::ClientCard() {
is_showtarget
=
false
;
is_showchaintarget
=
false
;
is_highlighting
=
false
;
is_disabled
=
false
;
status
=
0
;
is_reversed
=
false
;
cmdFlag
=
0
;
code
=
0
;
...
...
@@ -164,10 +164,8 @@ void ClientCard::UpdateInfo(char* buf) {
}
if
(
flag
&
QUERY_OWNER
)
owner
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_IS_DISABLED
)
is_disabled
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_IS_PUBLIC
)
is_public
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_STATUS
)
status
=
BufferIO
::
ReadInt32
(
buf
);
if
(
flag
&
QUERY_LSCALE
)
{
lscale
=
BufferIO
::
ReadInt32
(
buf
);
myswprintf
(
lscstring
,
L"%d"
,
lscale
);
...
...
gframe/client_card.h
View file @
0a025936
...
...
@@ -89,8 +89,7 @@ public:
u8
location
;
u8
sequence
;
u8
position
;
u8
is_disabled
;
u8
is_public
;
u32
status
;
u8
cHint
;
u32
chValue
;
u32
opParam
;
...
...
gframe/deck_con.cpp
View file @
0a025936
...
...
@@ -778,6 +778,34 @@ void DeckBuilder::StartFilter() {
void
DeckBuilder
::
FilterCards
()
{
results
.
clear
();
const
wchar_t
*
pstr
=
mainGame
->
ebCardName
->
getText
();
std
::
wstring
str
=
std
::
wstring
(
pstr
);
std
::
vector
<
std
::
wstring
>
query_elements
;
std
::
vector
<
std
::
vector
<
std
::
wstring
>::
iterator
>
query_elements_track
;
size_t
element_start
=
0
;
while
(
mainGame
->
gameConf
.
search_multiple_keywords
)
{
size_t
element_end
=
str
.
find_first_of
(
mainGame
->
gameConf
.
search_multiple_keywords
==
1
?
L' '
:
L'+'
,
element_start
);
if
(
element_end
==
std
::
wstring
::
npos
)
break
;
size_t
length
=
element_end
-
element_start
;
if
(
length
>
0
)
{
query_elements
.
push_back
(
str
.
substr
(
element_start
,
length
));
element_start
=
element_end
+
1
;
}
else
element_start
++
;
}
query_elements
.
push_back
(
str
.
substr
(
element_start
));
std
::
unordered_map
<
std
::
wstring
,
unsigned
int
>
set_code_map
;
for
(
auto
elements_iterator
=
query_elements
.
begin
();
elements_iterator
!=
query_elements
.
end
();
elements_iterator
++
)
{
const
wchar_t
*
element_pointer
=
elements_iterator
->
c_str
();
if
(
element_pointer
[
0
]
==
L'@'
)
set_code_map
[
*
elements_iterator
]
=
dataManager
.
GetSetCode
(
&
element_pointer
[
1
]);
else
set_code_map
[
*
elements_iterator
]
=
dataManager
.
GetSetCode
(
&
element_pointer
[
0
]);
if
(
element_pointer
[
0
]
==
0
||
(
element_pointer
[
0
]
==
L'$'
&&
element_pointer
[
1
]
==
0
)
||
(
element_pointer
[
0
]
==
L'@'
&&
element_pointer
[
1
]
==
0
))
query_elements_track
.
push_back
(
elements_iterator
);
}
for
(
auto
elements_track_iterator
=
query_elements_track
.
begin
();
elements_track_iterator
!=
query_elements_track
.
end
();
elements_track_iterator
++
)
query_elements
.
erase
(
*
elements_track_iterator
);
unsigned
int
set_code
=
0
;
if
(
pstr
[
0
]
==
L'@'
)
set_code
=
dataManager
.
GetSetCode
(
&
pstr
[
1
]);
...
...
@@ -858,24 +886,39 @@ void DeckBuilder::FilterCards() {
if
(
filter_lm
==
7
&&
data
.
ot
!=
4
)
continue
;
}
if
(
pstr
)
{
if
(
pstr
[
0
]
==
L'$'
)
{
if
(
!
CardNameContains
(
text
.
name
.
c_str
(),
&
pstr
[
1
]))
continue
;
}
else
if
(
pstr
[
0
]
==
L'@'
&&
set_code
)
{
if
(
!
check_set_code
(
data
,
set_code
))
continue
;
bool
is_target
=
true
;
for
(
auto
elements_iterator
=
query_elements
.
begin
();
elements_iterator
!=
query_elements
.
end
();
elements_iterator
++
)
{
const
wchar_t
*
element_pointer
=
elements_iterator
->
c_str
();
if
(
element_pointer
[
0
]
==
L'$'
)
{
if
(
!
CardNameContains
(
text
.
name
.
c_str
(),
&
element_pointer
[
1
])){
is_target
=
false
;
break
;
}
}
else
if
(
element_pointer
[
0
]
==
L'@'
&&
set_code_map
[
*
elements_iterator
])
{
if
(
!
check_set_code
(
data
,
set_code_map
[
*
elements_iterator
]))
{
is_target
=
false
;
break
;
}
}
else
{
int
trycode
=
BufferIO
::
GetVal
(
pstr
);
int
trycode
=
BufferIO
::
GetVal
(
elements_iterator
->
c_str
()
);
bool
tryresult
=
dataManager
.
GetData
(
trycode
,
0
);
if
(
!
tryresult
&&
!
CardNameContains
(
text
.
name
.
c_str
(),
pstr
)
&&
text
.
text
.
find
(
pstr
)
==
std
::
wstring
::
npos
&&
(
!
set_code
||
!
check_set_code
(
data
,
set_code
)))
continue
;
if
(
tryresult
&&
data
.
code
!=
trycode
&&
!
(
data
.
alias
==
trycode
&&
(
data
.
alias
-
data
.
code
<
CARD_ARTWORK_VERSIONS_OFFSET
||
data
.
code
-
data
.
alias
<
CARD_ARTWORK_VERSIONS_OFFSET
)))
continue
;
if
(
!
tryresult
&&
!
CardNameContains
(
text
.
name
.
c_str
(),
elements_iterator
->
c_str
())
&&
text
.
text
.
find
(
elements_iterator
->
c_str
())
==
std
::
wstring
::
npos
&&
(
!
set_code_map
[
*
elements_iterator
]
||
!
check_set_code
(
data
,
set_code_map
[
*
elements_iterator
])))
{
is_target
=
false
;
break
;
}
if
(
tryresult
&&
data
.
code
!=
trycode
&&
!
(
data
.
alias
==
trycode
&&
(
data
.
alias
-
data
.
code
<
CARD_ARTWORK_VERSIONS_OFFSET
||
data
.
code
-
data
.
alias
<
CARD_ARTWORK_VERSIONS_OFFSET
)))
{
is_target
=
false
;
break
;
}
}
}
results
.
push_back
(
ptr
);
if
(
is_target
)
results
.
push_back
(
ptr
);
else
continue
;
}
myswprintf
(
result_string
,
L"%d"
,
results
.
size
());
if
(
results
.
size
()
>
7
)
{
...
...
gframe/drawing.cpp
View file @
0a025936
...
...
@@ -382,7 +382,8 @@ void Game::DrawCard(ClientCard* pcard) {
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tChainTarget
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vSymbol
,
4
,
matManager
.
iRectangle
,
2
);
}
else
if
(
pcard
->
is_disabled
&&
(
pcard
->
location
&
LOCATION_ONFIELD
)
&&
(
pcard
->
position
&
POS_FACEUP
))
{
}
else
if
((
pcard
->
status
&
(
STATUS_DISABLED
|
STATUS_FORBIDDEN
))
&&
(
pcard
->
location
&
LOCATION_ONFIELD
)
&&
(
pcard
->
position
&
POS_FACEUP
))
{
matManager
.
mTexture
.
setTexture
(
0
,
imageManager
.
tNegated
);
driver
->
setMaterial
(
matManager
.
mTexture
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vNegate
,
4
,
matManager
.
iRectangle
,
2
);
...
...
gframe/duelclient.cpp
View file @
0a025936
...
...
@@ -1304,6 +1304,10 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
wchar_t
ynbuf
[
256
];
myswprintf
(
ynbuf
,
dataManager
.
GetSysString
(
200
),
dataManager
.
FormatLocation
(
l
,
s
),
dataManager
.
GetName
(
code
));
myswprintf
(
textBuffer
,
L"%ls
\n
%ls"
,
event_string
,
ynbuf
);
}
else
if
(
desc
==
221
)
{
wchar_t
ynbuf
[
256
];
myswprintf
(
ynbuf
,
dataManager
.
GetSysString
(
221
),
dataManager
.
FormatLocation
(
l
,
s
),
dataManager
.
GetName
(
code
));
myswprintf
(
textBuffer
,
L"%ls
\n
%ls
\n
%ls"
,
event_string
,
ynbuf
,
dataManager
.
GetSysString
(
223
));
}
else
if
(
desc
<
2048
)
{
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
desc
),
dataManager
.
GetName
(
code
));
}
else
{
...
...
@@ -1558,6 +1562,8 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
if
(
!
forced
)
{
if
(
count
==
0
)
myswprintf
(
textBuffer
,
L"%ls
\n
%ls"
,
dataManager
.
GetSysString
(
201
),
dataManager
.
GetSysString
(
202
));
else
if
(
select_trigger
)
myswprintf
(
textBuffer
,
L"%ls
\n
%ls
\n
%ls"
,
event_string
,
dataManager
.
GetSysString
(
222
),
dataManager
.
GetSysString
(
223
));
else
myswprintf
(
textBuffer
,
L"%ls
\n
%ls"
,
event_string
,
dataManager
.
GetSysString
(
203
));
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
guiFont
,
(
wchar_t
*
)
textBuffer
);
...
...
gframe/event_handler.cpp
View file @
0a025936
...
...
@@ -1819,6 +1819,15 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
switch
(
id
)
{
case
CHECKBOX_AUTO_SEARCH
:
{
mainGame
->
gameConf
.
auto_search_limit
=
mainGame
->
chkAutoSearch
->
isChecked
()
?
0
:
-
1
;
if
(
mainGame
->
is_building
&&
!
mainGame
->
is_siding
)
mainGame
->
deckBuilder
.
InstantSearch
();
return
true
;
break
;
}
case
CHECKBOX_MULTI_KEYWORDS
:
{
mainGame
->
gameConf
.
search_multiple_keywords
=
mainGame
->
chkMultiKeywords
->
isChecked
()
?
1
:
0
;
if
(
mainGame
->
is_building
&&
!
mainGame
->
is_siding
)
mainGame
->
deckBuilder
.
InstantSearch
();
return
true
;
break
;
}
...
...
@@ -2276,6 +2285,8 @@ void ClientField::ShowCardInfoInList(ClientCard* pcard, irr::gui::IGUIElement* e
if
(
pcard
->
code
)
{
str
.
append
(
dataManager
.
GetName
(
pcard
->
code
));
}
if
(
pcard
->
status
&
STATUS_PROC_COMPLETE
)
str
.
append
(
L"
\n
"
).
append
(
dataManager
.
GetSysString
(
224
));
for
(
size_t
i
=
0
;
i
<
chains
.
size
();
++
i
)
{
wchar_t
formatBuffer
[
2048
];
auto
chit
=
chains
[
i
];
...
...
gframe/game.cpp
View file @
0a025936
...
...
@@ -318,6 +318,9 @@ bool Game::Initialize() {
chkAutoSearch
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_AUTO_SEARCH
,
dataManager
.
GetSysString
(
1358
));
chkAutoSearch
->
setChecked
(
gameConf
.
auto_search_limit
>=
0
);
posY
+=
30
;
chkMultiKeywords
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabSystem
,
CHECKBOX_MULTI_KEYWORDS
,
dataManager
.
GetSysString
(
1378
));
chkMultiKeywords
->
setChecked
(
gameConf
.
search_multiple_keywords
>
0
);
posY
+=
30
;
env
->
addStaticText
(
dataManager
.
GetSysString
(
1282
),
rect
<
s32
>
(
posX
+
23
,
posY
+
3
,
posX
+
120
,
posY
+
28
),
false
,
false
,
tabSystem
);
btnWinResizeS
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
115
,
posY
,
posX
+
145
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_S
,
dataManager
.
GetSysString
(
1283
));
btnWinResizeM
=
env
->
addButton
(
rect
<
s32
>
(
posX
+
150
,
posY
,
posX
+
180
,
posY
+
25
),
tabSystem
,
BUTTON_WINDOW_RESIZE_M
,
dataManager
.
GetSysString
(
1284
));
...
...
@@ -1013,6 +1016,7 @@ void Game::LoadConfig() {
gameConf
.
draw_field_spell
=
1
;
gameConf
.
separate_clear_button
=
1
;
gameConf
.
auto_search_limit
=
-
1
;
gameConf
.
search_multiple_keywords
=
1
;
gameConf
.
chkIgnoreDeckChanges
=
0
;
gameConf
.
defaultOT
=
1
;
gameConf
.
enable_bot_mode
=
0
;
...
...
@@ -1083,6 +1087,8 @@ void Game::LoadConfig() {
gameConf
.
separate_clear_button
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"auto_search_limit"
))
{
gameConf
.
auto_search_limit
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"search_multiple_keywords"
))
{
gameConf
.
search_multiple_keywords
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"ignore_deck_changes"
))
{
gameConf
.
chkIgnoreDeckChanges
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"default_ot"
))
{
...
...
@@ -1170,6 +1176,8 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"separate_clear_button = %d
\n
"
,
gameConf
.
separate_clear_button
);
fprintf
(
fp
,
"#auto_search_limit >= 0: Start search automatically when the user enters N chars
\n
"
);
fprintf
(
fp
,
"auto_search_limit = %d
\n
"
,
gameConf
.
auto_search_limit
);
fprintf
(
fp
,
"#search_multiple_keywords = 0: Disable. 1: Search mutiple keywords with separator
\"
\"
. 2: with separator
\"
+
\"\n
"
);
fprintf
(
fp
,
"search_multiple_keywords = %d
\n
"
,
gameConf
.
search_multiple_keywords
);
fprintf
(
fp
,
"ignore_deck_changes = %d
\n
"
,
(
chkIgnoreDeckChanges
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"default_ot = %d
\n
"
,
gameConf
.
defaultOT
);
fprintf
(
fp
,
"enable_bot_mode = %d
\n
"
,
gameConf
.
enable_bot_mode
);
...
...
gframe/game.h
View file @
0a025936
...
...
@@ -39,6 +39,7 @@ struct Config {
int
draw_field_spell
;
int
separate_clear_button
;
int
auto_search_limit
;
int
search_multiple_keywords
;
int
chkIgnoreDeckChanges
;
int
defaultOT
;
int
enable_bot_mode
;
...
...
@@ -279,6 +280,7 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkHideHintButton
;
irr
::
gui
::
IGUICheckBox
*
chkIgnoreDeckChanges
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSearch
;
irr
::
gui
::
IGUICheckBox
*
chkMultiKeywords
;
irr
::
gui
::
IGUICheckBox
*
chkEnableSound
;
irr
::
gui
::
IGUICheckBox
*
chkEnableMusic
;
irr
::
gui
::
IGUIScrollBar
*
scrSoundVolume
;
...
...
@@ -673,6 +675,7 @@ extern Game* mainGame;
#define SCROLL_TAB_HELPER 350
#define SCROLL_TAB_SYSTEM 351
#define CHECKBOX_AUTO_SEARCH 360
#define CHECKBOX_MULTI_KEYWORDS 372
#define CHECKBOX_ENABLE_SOUND 361
#define CHECKBOX_ENABLE_MUSIC 362
#define SCROLL_VOLUME 363
...
...
gframe/single_duel.cpp
View file @
0a025936
...
...
@@ -1487,18 +1487,17 @@ void SingleDuel::RefreshHand(int player, int flag, int use_cache) {
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_HAND
);
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_HAND
,
flag
|
QUERY_
IS_PUBLIC
,
(
unsigned
char
*
)
qbuf
,
use_cache
);
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_HAND
,
flag
|
QUERY_
POSITION
,
(
unsigned
char
*
)
qbuf
,
use_cache
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
query_buffer
,
len
+
3
);
int
qlen
=
0
;
while
(
qlen
<
len
)
{
int
slen
=
BufferIO
::
ReadInt32
(
qbuf
);
int
qflag
=
*
(
int
*
)
qbuf
;
int
pos
=
slen
-
8
;
if
(
qflag
&
QUERY_LSCALE
)
pos
-=
4
;
if
(
qflag
&
QUERY_RSCALE
)
pos
-=
4
;
if
(
!
qbuf
[
pos
])
int
offset
=
8
;
if
(
!
(
qflag
&
QUERY_CODE
))
offset
-=
4
;
unsigned
position
=
((
*
(
int
*
)(
qbuf
+
offset
))
>>
24
)
&
0xff
;
if
(
!
(
position
&
POS_FACEUP
))
memset
(
qbuf
,
0
,
slen
-
4
);
qbuf
+=
slen
-
4
;
qlen
+=
slen
;
...
...
gframe/tag_duel.cpp
View file @
0a025936
...
...
@@ -1583,18 +1583,17 @@ void TagDuel::RefreshHand(int player, int flag, int use_cache) {
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
BufferIO
::
WriteInt8
(
qbuf
,
LOCATION_HAND
);
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_HAND
,
flag
|
QUERY_
IS_PUBLIC
,
(
unsigned
char
*
)
qbuf
,
use_cache
);
int
len
=
query_field_card
(
pduel
,
player
,
LOCATION_HAND
,
flag
|
QUERY_
POSITION
,
(
unsigned
char
*
)
qbuf
,
use_cache
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
query_buffer
,
len
+
3
);
int
qlen
=
0
;
while
(
qlen
<
len
)
{
int
slen
=
BufferIO
::
ReadInt32
(
qbuf
);
int
qflag
=
*
(
int
*
)
qbuf
;
int
pos
=
slen
-
8
;
if
(
qflag
&
QUERY_LSCALE
)
pos
-=
4
;
if
(
qflag
&
QUERY_RSCALE
)
pos
-=
4
;
if
(
!
qbuf
[
pos
])
int
offset
=
8
;
if
(
!
(
qflag
&
QUERY_CODE
))
offset
-=
4
;
unsigned
position
=
((
*
(
int
*
)(
qbuf
+
offset
))
>>
24
)
&
0xff
;
if
(
!
(
position
&
POS_FACEUP
))
memset
(
qbuf
,
0
,
slen
-
4
);
qbuf
+=
slen
-
4
;
qlen
+=
slen
;
...
...
strings.conf
View file @
0a025936
...
...
@@ -70,6 +70,13 @@
!
system
215
已选择数字:
!
system
216
在连锁%
d
发动
!
system
217
被连锁%
d
的[%
ls
]选择为对象
!
system
218
是否使用[%
ls
]的效果代替支付基本分?
!
system
219
是否使用[%
ls
]的效果代替取除超量素材?
!
system
220
是否使用[%
ls
]的效果代替取除指示物?
!
system
221
是否在[%
ls
]发动[%
ls
]的诱发效果?
!
system
222
是否要发动诱发效果?
!
system
223
稍后将询问其他可以发动的效果。
!
system
224
已用正规方法特殊召唤
!
system
500
请选择要解放的卡
!
system
501
请选择要丢弃的手卡
!
system
502
请选择要破坏的卡
...
...
@@ -398,6 +405,7 @@
!
system
1372
守备↑
!
system
1373
名称↓
!
system
1374
连接标记
!
system
1378
使用多个关键词搜索卡片
!
system
1380
人机模式
!
system
1381
残局模式
!
system
1382
人机信息:
...
...
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