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
nanahira
ygopro
Commits
8b6b40c2
Commit
8b6b40c2
authored
Mar 20, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't use inline
parent
44a078e3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
52 deletions
+60
-52
gframe/deck_con.cpp
gframe/deck_con.cpp
+52
-52
gframe/deck_con.h
gframe/deck_con.h
+8
-0
No files found.
gframe/deck_con.cpp
View file @
8b6b40c2
...
...
@@ -61,7 +61,7 @@ static bool check_set_code(const CardDataC& data, int set_code) {
inline
bool
havePopupWindow
()
{
return
mainGame
->
wQuery
->
isVisible
()
||
mainGame
->
wCategories
->
isVisible
()
||
mainGame
->
wLinkMarks
->
isVisible
()
||
mainGame
->
wDeckManage
->
isVisible
()
||
mainGame
->
wDMQuery
->
isVisible
();
}
inline
void
r
efreshDeckList
()
{
void
DeckBuilder
::
R
efreshDeckList
()
{
irr
::
gui
::
IGUIListBox
*
lstCategories
=
mainGame
->
lstCategories
;
irr
::
gui
::
IGUIListBox
*
lstDecks
=
mainGame
->
lstDecks
;
wchar_t
catepath
[
256
];
...
...
@@ -77,33 +77,33 @@ inline void refreshDeckList() {
}
});
}
inline
void
r
efreshReadonly
(
int
catesel
)
{
void
DeckBuilder
::
R
efreshReadonly
(
int
catesel
)
{
bool
hasDeck
=
mainGame
->
cbDBDecks
->
getItemCount
()
!=
0
;
mainGame
->
deckBuilder
.
readonly
=
catesel
<
2
;
mainGame
->
btnSaveDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
readonly
=
catesel
<
2
;
mainGame
->
btnSaveDeck
->
setEnabled
(
!
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
hasDeck
&&
!
readonly
);
mainGame
->
btnRenameCategory
->
setEnabled
(
catesel
>
3
);
mainGame
->
btnDeleteCategory
->
setEnabled
(
catesel
>
3
);
mainGame
->
btnNewDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnRenameDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnDMDeleteDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnMoveDeck
->
setEnabled
(
hasDeck
&&
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnNewDeck
->
setEnabled
(
!
readonly
);
mainGame
->
btnRenameDeck
->
setEnabled
(
hasDeck
&&
!
readonly
);
mainGame
->
btnDMDeleteDeck
->
setEnabled
(
hasDeck
&&
!
readonly
);
mainGame
->
btnMoveDeck
->
setEnabled
(
hasDeck
&&
!
readonly
);
mainGame
->
btnCopyDeck
->
setEnabled
(
hasDeck
);
}
inline
void
c
hangeCategory
(
int
catesel
)
{
void
DeckBuilder
::
C
hangeCategory
(
int
catesel
)
{
mainGame
->
RefreshDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
cbDBDecks
->
setSelected
(
0
);
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
r
efreshReadonly
(
catesel
);
mainGame
->
deckBuilder
.
is_modified
=
false
;
mainGame
->
deckBuilder
.
prev_category
=
catesel
;
mainGame
->
deckBuilder
.
prev_deck
=
0
;
R
efreshReadonly
(
catesel
);
is_modified
=
false
;
prev_category
=
catesel
;
prev_deck
=
0
;
}
inline
void
s
howDeckManage
()
{
void
DeckBuilder
::
S
howDeckManage
()
{
mainGame
->
RefreshCategoryDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
,
false
);
mainGame
->
cbDBCategory
->
setSelected
(
mainGame
->
deckBuilder
.
prev_category
);
mainGame
->
cbDBCategory
->
setSelected
(
prev_category
);
mainGame
->
RefreshDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
cbDBDecks
->
setSelected
(
mainGame
->
deckBuilder
.
prev_deck
);
mainGame
->
cbDBDecks
->
setSelected
(
prev_deck
);
irr
::
gui
::
IGUIListBox
*
lstCategories
=
mainGame
->
lstCategories
;
lstCategories
->
clear
();
lstCategories
->
addItem
(
dataManager
.
GetSysString
(
1450
));
...
...
@@ -115,16 +115,16 @@ inline void showDeckManage() {
lstCategories
->
addItem
(
name
);
}
});
lstCategories
->
setSelected
(
mainGame
->
deckBuilder
.
prev_category
);
r
efreshDeckList
();
refreshReadonly
(
mainGame
->
deckBuilder
.
prev_category
);
mainGame
->
lstDecks
->
setSelected
(
mainGame
->
deckBuilder
.
prev_deck
);
lstCategories
->
setSelected
(
prev_category
);
R
efreshDeckList
();
RefreshReadonly
(
prev_category
);
mainGame
->
lstDecks
->
setSelected
(
prev_deck
);
mainGame
->
PopupElement
(
mainGame
->
wDeckManage
);
}
inline
void
ShowBigCard
(
int
code
,
float
zoom
)
{
mainGame
->
deckBuilder
.
bigcard_code
=
code
;
mainGame
->
deckBuilder
.
bigcard_zoom
=
zoom
;
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
();
...
...
@@ -141,12 +141,12 @@ inline void ShowBigCard(int code, float zoom) {
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
);
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
();
...
...
@@ -161,7 +161,7 @@ inline void ZoomBigCard(s32 centerx = -1, s32 centery = -1) {
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
()
{
void
DeckBuilder
::
CloseBigCard
()
{
mainGame
->
HideElement
(
mainGame
->
wBigCard
);
mainGame
->
btnBigCardOriginalSize
->
setVisible
(
false
);
mainGame
->
btnBigCardZoomIn
->
setVisible
(
false
);
...
...
@@ -379,7 +379,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
prev_operation
=
id
;
break
;
}
s
howDeckManage
();
S
howDeckManage
();
break
;
}
case
BUTTON_NEW_CATEGORY
:
{
...
...
@@ -500,10 +500,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
if
(
catesel
>
0
)
{
mainGame
->
lstCategories
->
setSelected
(
catesel
);
r
efreshDeckList
();
R
efreshDeckList
();
mainGame
->
lstDecks
->
setSelected
(
0
);
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
}
break
;
}
...
...
@@ -530,10 +530,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
if
(
catesel
>
0
)
{
mainGame
->
lstCategories
->
setSelected
(
catesel
);
r
efreshDeckList
();
R
efreshDeckList
();
mainGame
->
lstDecks
->
setSelected
(
0
);
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
}
break
;
}
...
...
@@ -545,10 +545,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
lstCategories
->
removeItem
(
catesel
);
catesel
=
2
;
mainGame
->
lstCategories
->
setSelected
(
catesel
);
r
efreshDeckList
();
R
efreshDeckList
();
mainGame
->
lstDecks
->
setSelected
(
0
);
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
}
else
{
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1476
));
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
...
...
@@ -567,8 +567,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
deckManager
.
current_deck
.
extra
.
clear
();
deckManager
.
current_deck
.
side
.
clear
();
res
=
deckManager
.
SaveDeck
(
deckManager
.
current_deck
,
filepath
);
r
efreshDeckList
();
c
hangeCategory
(
mainGame
->
lstCategories
->
getSelected
());
R
efreshDeckList
();
C
hangeCategory
(
mainGame
->
lstCategories
->
getSelected
());
}
for
(
int
i
=
0
;
i
<
mainGame
->
lstDecks
->
getItemCount
();
i
++
)
{
if
(
!
mywcsncasecmp
(
mainGame
->
lstDecks
->
getListItem
(
i
),
deckname
,
256
))
{
...
...
@@ -602,8 +602,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if
(
!
FileSystem
::
IsFileExists
(
newfilepath
))
{
res
=
FileSystem
::
Rename
(
oldfilepath
,
newfilepath
);
}
r
efreshDeckList
();
c
hangeCategory
(
catesel
);
R
efreshDeckList
();
C
hangeCategory
(
catesel
);
for
(
int
i
=
0
;
i
<
mainGame
->
lstDecks
->
getItemCount
();
i
++
)
{
if
(
!
mywcsncasecmp
(
mainGame
->
lstDecks
->
getListItem
(
i
),
newdeckname
,
256
))
{
deckManager
.
LoadDeck
(
newfilepath
);
...
...
@@ -635,7 +635,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
cbDBDecks
->
setSelected
(
decksel
);
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
}
r
efreshReadonly
(
prev_category
);
R
efreshReadonly
(
prev_category
);
prev_deck
=
decksel
;
}
else
{
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1476
));
...
...
@@ -665,9 +665,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
mainGame
->
lstCategories
->
setSelected
(
newcatename
);
int
catesel
=
mainGame
->
lstCategories
->
getSelected
();
r
efreshDeckList
();
R
efreshDeckList
();
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
for
(
int
i
=
0
;
i
<
mainGame
->
lstDecks
->
getItemCount
();
i
++
)
{
if
(
!
mywcsncasecmp
(
mainGame
->
lstDecks
->
getListItem
(
i
),
deckname
,
256
))
{
deckManager
.
LoadDeck
(
newfilepath
);
...
...
@@ -703,9 +703,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
mainGame
->
lstCategories
->
setSelected
(
newcatename
);
int
catesel
=
mainGame
->
lstCategories
->
getSelected
();
r
efreshDeckList
();
R
efreshDeckList
();
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
for
(
int
i
=
0
;
i
<
mainGame
->
lstDecks
->
getItemCount
();
i
++
)
{
if
(
!
mywcsncasecmp
(
mainGame
->
lstDecks
->
getListItem
(
i
),
deckname
,
256
))
{
deckManager
.
LoadDeck
(
newfilepath
);
...
...
@@ -817,14 +817,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
Terminate
();
}
else
if
(
prev_operation
==
COMBOBOX_DBCATEGORY
)
{
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
}
else
if
(
prev_operation
==
COMBOBOX_DBDECKS
)
{
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
prev_deck
=
decksel
;
is_modified
=
false
;
}
else
if
(
prev_operation
==
BUTTON_MANAGE_DECK
)
{
s
howDeckManage
();
S
howDeckManage
();
}
prev_operation
=
0
;
break
;
...
...
@@ -920,7 +920,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
prev_operation
=
id
;
break
;
}
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
break
;
}
case
COMBOBOX_DBDECKS
:
{
...
...
@@ -1078,10 +1078,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
if
(
prev_category
==
catesel
)
break
;
}
r
efreshDeckList
();
R
efreshDeckList
();
mainGame
->
lstDecks
->
setSelected
(
0
);
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
c
hangeCategory
(
catesel
);
C
hangeCategory
(
catesel
);
break
;
}
case
LISTBOX_DECKS
:
{
...
...
gframe/deck_con.h
View file @
8b6b40c2
...
...
@@ -21,6 +21,14 @@ public:
void
ClearSearch
();
void
SortList
();
void
RefreshDeckList
();
void
RefreshReadonly
(
int
catesel
);
void
ChangeCategory
(
int
catesel
);
void
ShowDeckManage
();
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
);
...
...
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