Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
REIKAI
ygopro
Commits
900632ec
Commit
900632ec
authored
Apr 11, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
display card count
parent
31eed0c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
12 deletions
+41
-12
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+24
-0
gframe/deck_manager.h
gframe/deck_manager.h
+5
-0
gframe/drawing.cpp
gframe/drawing.cpp
+12
-12
No files found.
gframe/deck_manager.cpp
View file @
900632ec
...
@@ -313,4 +313,28 @@ bool DeckManager::DeleteDeck(Deck& deck, const wchar_t* name) {
...
@@ -313,4 +313,28 @@ bool DeckManager::DeleteDeck(Deck& deck, const wchar_t* name) {
return
result
==
0
;
return
result
==
0
;
#endif
#endif
}
}
const
wchar_t
*
DeckManager
::
GetMainFormatString
()
{
myswprintf
(
DeckFormatBuffer
,
L"%d ( %d / %d / %d )"
,
deckManager
.
current_deck
.
main
.
size
(),
GetTypeCount
(
deckManager
.
current_deck
.
main
,
TYPE_MONSTER
),
GetTypeCount
(
deckManager
.
current_deck
.
main
,
TYPE_SPELL
),
GetTypeCount
(
deckManager
.
current_deck
.
main
,
TYPE_TRAP
));
wchar_t
*
result
=
DeckFormatBuffer
;
return
result
;
}
const
wchar_t
*
DeckManager
::
GetExtraFormatString
()
{
myswprintf
(
DeckFormatBuffer
,
L"%d ( %d / %d / %d / %d )"
,
deckManager
.
current_deck
.
extra
.
size
(),
GetTypeCount
(
deckManager
.
current_deck
.
extra
,
TYPE_FUSION
),
GetTypeCount
(
deckManager
.
current_deck
.
extra
,
TYPE_SYNCHRO
),
GetTypeCount
(
deckManager
.
current_deck
.
extra
,
TYPE_XYZ
),
GetTypeCount
(
deckManager
.
current_deck
.
extra
,
TYPE_LINK
));
wchar_t
*
result
=
DeckFormatBuffer
;
return
result
;
}
const
wchar_t
*
DeckManager
::
GetSideFormatString
()
{
myswprintf
(
DeckFormatBuffer
,
L"%d ( %d / %d / %d / %d )"
,
deckManager
.
current_deck
.
side
.
size
(),
GetTypeCount
(
deckManager
.
current_deck
.
side
,
TYPE_MONSTER
),
GetTypeCount
(
deckManager
.
current_deck
.
side
,
TYPE_SPELL
),
GetTypeCount
(
deckManager
.
current_deck
.
side
,
TYPE_TRAP
),
GetTypeCount
(
deckManager
.
current_deck
.
side
,
TYPE_FUSION
|
TYPE_SYNCHRO
|
TYPE_XYZ
|
TYPE_LINK
));
wchar_t
*
result
=
DeckFormatBuffer
;
return
result
;
}
int
DeckManager
::
GetTypeCount
(
std
::
vector
<
code_pointer
>
list
,
unsigned
int
ctype
)
{
int
res
=
0
;
for
(
size_t
i
=
0
;
i
<
list
.
size
();
++
i
)
{
code_pointer
cur
=
list
[
i
];
if
(
cur
->
second
.
type
&
ctype
)
res
++
;
}
return
res
;
}
}
}
gframe/deck_manager.h
View file @
900632ec
...
@@ -45,6 +45,11 @@ public:
...
@@ -45,6 +45,11 @@ public:
bool
SaveDeck
(
Deck
&
deck
,
const
wchar_t
*
name
);
bool
SaveDeck
(
Deck
&
deck
,
const
wchar_t
*
name
);
bool
DeleteDeck
(
Deck
&
deck
,
const
wchar_t
*
name
);
bool
DeleteDeck
(
Deck
&
deck
,
const
wchar_t
*
name
);
static
bool
RenameDeck
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
static
bool
RenameDeck
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
wchar_t
DeckFormatBuffer
[
128
];
const
wchar_t
*
GetMainFormatString
();
const
wchar_t
*
GetSideFormatString
();
const
wchar_t
*
GetExtraFormatString
();
int
GetTypeCount
(
std
::
vector
<
code_pointer
>
list
,
unsigned
int
ctype
);
};
};
extern
DeckManager
deckManager
;
extern
DeckManager
deckManager
;
...
...
gframe/drawing.cpp
View file @
900632ec
...
@@ -1111,10 +1111,10 @@ void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, i
...
@@ -1111,10 +1111,10 @@ void Game::DrawThumb(code_pointer cp, position2di pos, std::unordered_map<int, i
void
Game
::
DrawDeckBd
()
{
void
Game
::
DrawDeckBd
()
{
wchar_t
textBuffer
[
64
];
wchar_t
textBuffer
[
64
];
//main deck
//main deck
driver
->
draw2DRectangle
(
Resize
(
310
,
137
,
4
10
,
157
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
310
,
137
,
5
10
,
157
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
136
,
4
10
,
157
));
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
136
,
5
10
,
157
));
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1330
),
Resize
(
315
,
137
,
4
10
,
157
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1330
),
Resize
(
315
,
137
,
5
10
,
157
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
d
ataManager
.
numStrings
[
deckManager
.
current_deck
.
main
.
size
()],
Resize
(
380
,
138
,
4
40
,
158
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
d
eckManager
.
GetMainFormatString
(),
Resize
(
380
,
138
,
5
40
,
158
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
driver
->
draw2DRectangle
(
Resize
(
310
,
160
,
797
,
436
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
310
,
160
,
797
,
436
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
159
,
797
,
436
));
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
159
,
797
,
436
));
int
lx
;
int
lx
;
...
@@ -1132,10 +1132,10 @@ void Game::DrawDeckBd() {
...
@@ -1132,10 +1132,10 @@ void Game::DrawDeckBd() {
driver
->
draw2DRectangleOutline
(
Resize
(
313
+
(
i
%
lx
)
*
dx
,
163
+
(
i
/
lx
)
*
68
,
359
+
(
i
%
lx
)
*
dx
,
228
+
(
i
/
lx
)
*
68
));
driver
->
draw2DRectangleOutline
(
Resize
(
313
+
(
i
%
lx
)
*
dx
,
163
+
(
i
/
lx
)
*
68
,
359
+
(
i
%
lx
)
*
dx
,
228
+
(
i
/
lx
)
*
68
));
}
}
//extra deck
//extra deck
driver
->
draw2DRectangle
(
Resize
(
310
,
440
,
4
10
,
460
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
310
,
440
,
5
10
,
460
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
439
,
4
10
,
460
));
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
439
,
5
10
,
460
));
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1331
),
Resize
(
315
,
440
,
4
10
,
460
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1331
),
Resize
(
315
,
440
,
5
10
,
460
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
d
ataManager
.
numStrings
[
deckManager
.
current_deck
.
extra
.
size
()],
Resize
(
380
,
441
,
4
40
,
461
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
d
eckManager
.
GetExtraFormatString
(),
Resize
(
380
,
441
,
5
40
,
461
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
driver
->
draw2DRectangle
(
Resize
(
310
,
463
,
797
,
533
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
310
,
463
,
797
,
533
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
462
,
797
,
533
));
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
462
,
797
,
533
));
if
(
deckManager
.
current_deck
.
extra
.
size
()
<=
10
)
if
(
deckManager
.
current_deck
.
extra
.
size
()
<=
10
)
...
@@ -1147,10 +1147,10 @@ void Game::DrawDeckBd() {
...
@@ -1147,10 +1147,10 @@ void Game::DrawDeckBd() {
driver
->
draw2DRectangleOutline
(
Resize
(
313
+
i
*
dx
,
465
,
359
+
i
*
dx
,
531
));
driver
->
draw2DRectangleOutline
(
Resize
(
313
+
i
*
dx
,
465
,
359
+
i
*
dx
,
531
));
}
}
//side deck
//side deck
driver
->
draw2DRectangle
(
Resize
(
310
,
537
,
4
10
,
557
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
310
,
537
,
5
10
,
557
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
536
,
4
10
,
557
));
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
536
,
5
10
,
557
));
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1332
),
Resize
(
315
,
537
,
4
10
,
557
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
textFont
,
dataManager
.
GetSysString
(
1332
),
Resize
(
315
,
537
,
5
10
,
557
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
d
ataManager
.
numStrings
[
deckManager
.
current_deck
.
side
.
size
()],
Resize
(
380
,
538
,
4
40
,
558
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
DrawShadowText
(
numFont
,
d
eckManager
.
GetSideFormatString
(),
Resize
(
380
,
538
,
5
40
,
558
),
Resize
(
1
,
1
,
1
,
1
),
0xffffffff
,
0xff000000
,
false
,
true
);
driver
->
draw2DRectangle
(
Resize
(
310
,
560
,
797
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangle
(
Resize
(
310
,
560
,
797
,
630
),
0x400000ff
,
0x400000ff
,
0x40000000
,
0x40000000
);
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
559
,
797
,
630
));
driver
->
draw2DRectangleOutline
(
Resize
(
309
,
559
,
797
,
630
));
if
(
deckManager
.
current_deck
.
side
.
size
()
<=
10
)
if
(
deckManager
.
current_deck
.
side
.
size
()
<=
10
)
...
...
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