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
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
Commits
817d49bf
Commit
817d49bf
authored
Mar 20, 2021
by
mercury233
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't use inline on ShowBigCard
parent
07a49e50
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
46 deletions
+52
-46
gframe/deck_con.cpp
gframe/deck_con.cpp
+48
-46
gframe/deck_con.h
gframe/deck_con.h
+4
-0
No files found.
gframe/deck_con.cpp
View file @
817d49bf
...
...
@@ -58,52 +58,6 @@ static bool check_set_code(const CardDataC& data, int set_code) {
return
res
;
}
inline
void
ShowBigCard
(
int
code
,
float
zoom
)
{
mainGame
->
deckBuilder
.
bigcard_code
=
code
;
mainGame
->
deckBuilder
.
bigcard_zoom
=
zoom
;
ITexture
*
img
=
imageManager
.
GetBigPicture
(
code
,
zoom
);
mainGame
->
imgBigCard
->
setImage
(
img
);
auto
size
=
img
->
getSize
();
s32
left
=
mainGame
->
window_size
.
Width
/
2
-
size
.
Width
/
2
;
s32
top
=
mainGame
->
window_size
.
Height
/
2
-
size
.
Height
/
2
;
mainGame
->
imgBigCard
->
setRelativePosition
(
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
mainGame
->
gMutex
.
lock
();
mainGame
->
btnBigCardOriginalSize
->
setVisible
(
true
);
mainGame
->
btnBigCardZoomIn
->
setVisible
(
true
);
mainGame
->
btnBigCardZoomOut
->
setVisible
(
true
);
mainGame
->
btnBigCardClose
->
setVisible
(
true
);
mainGame
->
ShowElement
(
mainGame
->
wBigCard
);
mainGame
->
env
->
getRootGUIElement
()
->
bringToFront
(
mainGame
->
wBigCard
);
mainGame
->
gMutex
.
unlock
();
}
inline
void
ZoomBigCard
(
s32
centerx
=
-
1
,
s32
centery
=
-
1
)
{
if
(
mainGame
->
deckBuilder
.
bigcard_zoom
>=
4
)
mainGame
->
deckBuilder
.
bigcard_zoom
=
4
;
if
(
mainGame
->
deckBuilder
.
bigcard_zoom
<=
0.2
f
)
mainGame
->
deckBuilder
.
bigcard_zoom
=
0.2
f
;
ITexture
*
img
=
imageManager
.
GetBigPicture
(
mainGame
->
deckBuilder
.
bigcard_code
,
mainGame
->
deckBuilder
.
bigcard_zoom
);
mainGame
->
imgBigCard
->
setImage
(
img
);
auto
size
=
img
->
getSize
();
auto
pos
=
mainGame
->
wBigCard
->
getRelativePosition
();
if
(
centerx
==
-
1
)
{
centerx
=
pos
.
UpperLeftCorner
.
X
+
pos
.
getWidth
()
/
2
;
centery
=
pos
.
UpperLeftCorner
.
Y
+
pos
.
getHeight
()
*
0.444
f
;
}
float
posx
=
(
float
)(
centerx
-
pos
.
UpperLeftCorner
.
X
)
/
pos
.
getWidth
();
float
posy
=
(
float
)(
centery
-
pos
.
UpperLeftCorner
.
Y
)
/
pos
.
getHeight
();
s32
left
=
centerx
-
size
.
Width
*
posx
;
s32
top
=
centery
-
size
.
Height
*
posy
;
mainGame
->
imgBigCard
->
setRelativePosition
(
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
}
inline
void
CloseBigCard
()
{
mainGame
->
HideElement
(
mainGame
->
wBigCard
);
mainGame
->
btnBigCardOriginalSize
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomIn
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomOut
->
setVisible
(
false
);
mainGame
->
btnBigCardClose
->
setVisible
(
false
);
}
void
DeckBuilder
::
Initialize
()
{
mainGame
->
is_building
=
true
;
mainGame
->
is_siding
=
false
;
...
...
@@ -1126,6 +1080,54 @@ void DeckBuilder::SortList() {
break
;
}
}
void
DeckBuilder
::
ShowBigCard
(
int
code
,
float
zoom
)
{
bigcard_code
=
code
;
bigcard_zoom
=
zoom
;
ITexture
*
img
=
imageManager
.
GetBigPicture
(
code
,
zoom
);
mainGame
->
imgBigCard
->
setImage
(
img
);
auto
size
=
img
->
getSize
();
s32
left
=
mainGame
->
window_size
.
Width
/
2
-
size
.
Width
/
2
;
s32
top
=
mainGame
->
window_size
.
Height
/
2
-
size
.
Height
/
2
;
mainGame
->
imgBigCard
->
setRelativePosition
(
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
mainGame
->
gMutex
.
lock
();
mainGame
->
btnBigCardOriginalSize
->
setVisible
(
true
);
mainGame
->
btnBigCardZoomIn
->
setVisible
(
true
);
mainGame
->
btnBigCardZoomOut
->
setVisible
(
true
);
mainGame
->
btnBigCardClose
->
setVisible
(
true
);
mainGame
->
ShowElement
(
mainGame
->
wBigCard
);
mainGame
->
env
->
getRootGUIElement
()
->
bringToFront
(
mainGame
->
wBigCard
);
mainGame
->
gMutex
.
unlock
();
}
void
DeckBuilder
::
ZoomBigCard
(
s32
centerx
,
s32
centery
)
{
if
(
bigcard_zoom
>=
4
)
bigcard_zoom
=
4
;
if
(
bigcard_zoom
<=
0.2
f
)
bigcard_zoom
=
0.2
f
;
ITexture
*
img
=
imageManager
.
GetBigPicture
(
bigcard_code
,
bigcard_zoom
);
mainGame
->
imgBigCard
->
setImage
(
img
);
auto
size
=
img
->
getSize
();
auto
pos
=
mainGame
->
wBigCard
->
getRelativePosition
();
if
(
centerx
==
-
1
)
{
centerx
=
pos
.
UpperLeftCorner
.
X
+
pos
.
getWidth
()
/
2
;
centery
=
pos
.
UpperLeftCorner
.
Y
+
pos
.
getHeight
()
*
0.444
f
;
}
float
posx
=
(
float
)(
centerx
-
pos
.
UpperLeftCorner
.
X
)
/
pos
.
getWidth
();
float
posy
=
(
float
)(
centery
-
pos
.
UpperLeftCorner
.
Y
)
/
pos
.
getHeight
();
s32
left
=
centerx
-
size
.
Width
*
posx
;
s32
top
=
centery
-
size
.
Height
*
posy
;
mainGame
->
imgBigCard
->
setRelativePosition
(
recti
(
0
,
0
,
size
.
Width
,
size
.
Height
));
mainGame
->
wBigCard
->
setRelativePosition
(
recti
(
left
,
top
,
left
+
size
.
Width
,
top
+
size
.
Height
));
}
void
DeckBuilder
::
CloseBigCard
()
{
mainGame
->
HideElement
(
mainGame
->
wBigCard
);
mainGame
->
btnBigCardOriginalSize
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomIn
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomOut
->
setVisible
(
false
);
mainGame
->
btnBigCardClose
->
setVisible
(
false
);
}
static
inline
wchar_t
NormalizeChar
(
wchar_t
c
)
{
/*
// Convert all symbols and punctuations to space.
...
...
gframe/deck_con.h
View file @
817d49bf
...
...
@@ -21,6 +21,10 @@ public:
void
ClearSearch
();
void
SortList
();
void
ShowBigCard
(
int
code
,
float
zoom
);
void
ZoomBigCard
(
s32
centerx
=
-
1
,
s32
centery
=
-
1
);
void
CloseBigCard
();
bool
CardNameContains
(
const
wchar_t
*
haystack
,
const
wchar_t
*
needle
);
bool
push_main
(
code_pointer
pointer
,
int
seq
=
-
1
);
...
...
nanahira
@nanahira
mentioned in commit
e7891669
·
Jun 11, 2021
mentioned in commit
e7891669
mentioned in commit e78916690641c1cef384c753fa8be066794f1b87
Toggle commit list
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