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
0cbdcdf0
Commit
0cbdcdf0
authored
Apr 20, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deck manage window
parent
53994c1c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
133 additions
and
51 deletions
+133
-51
gframe/deck_con.cpp
gframe/deck_con.cpp
+110
-32
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+4
-4
gframe/deck_manager.h
gframe/deck_manager.h
+1
-1
gframe/game.cpp
gframe/game.cpp
+17
-13
gframe/game.h
gframe/game.h
+1
-1
No files found.
gframe/deck_con.cpp
View file @
0cbdcdf0
...
@@ -59,9 +59,57 @@ static bool check_set_code(const CardDataC& data, int set_code) {
...
@@ -59,9 +59,57 @@ static bool check_set_code(const CardDataC& data, int set_code) {
return
res
;
return
res
;
}
}
static
bool
isHavePopupWindow
()
{
inline
bool
isHavePopupWindow
()
{
return
mainGame
->
wQuery
->
isVisible
()
||
mainGame
->
wCategories
->
isVisible
()
||
mainGame
->
wLinkMarks
->
isVisible
()
||
mainGame
->
wManageDeck
->
isVisible
();
return
mainGame
->
wQuery
->
isVisible
()
||
mainGame
->
wCategories
->
isVisible
()
||
mainGame
->
wLinkMarks
->
isVisible
()
||
mainGame
->
wManageDeck
->
isVisible
();
}
}
inline
void
refreshDeckList
()
{
irr
::
gui
::
IGUIListBox
*
lstCategories
=
mainGame
->
lstCategories
;
irr
::
gui
::
IGUIListBox
*
lstDecks
=
mainGame
->
lstDecks
;
wchar_t
catepath
[
256
];
deckManager
.
GetCategoryPath
(
catepath
,
lstCategories
->
getSelected
(),
lstCategories
->
getListItem
(
lstCategories
->
getSelected
()));
lstDecks
->
clear
();
FileSystem
::
TraversalDir
(
catepath
,
[
lstDecks
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
wcsrchr
(
name
,
'.'
)
&&
!
mywcsncasecmp
(
wcsrchr
(
name
,
'.'
),
L".ydk"
,
4
))
{
size_t
len
=
wcslen
(
name
);
wchar_t
deckname
[
256
];
wcsncpy
(
deckname
,
name
,
len
-
4
);
deckname
[
len
-
4
]
=
0
;
lstDecks
->
addItem
(
deckname
);
}
});
}
inline
void
changeCategory
(
int
catesel
)
{
mainGame
->
deckBuilder
.
readonly
=
catesel
<
2
;
mainGame
->
btnSaveDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
!
mainGame
->
deckBuilder
.
readonly
);
mainGame
->
RefreshDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
cbDBDecks
->
setSelected
(
0
);
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
deckBuilder
.
is_modified
=
false
;
mainGame
->
deckBuilder
.
prev_category
=
catesel
;
mainGame
->
deckBuilder
.
prev_deck
=
0
;
}
inline
void
showManageDeck
()
{
mainGame
->
RefreshCategoryDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
,
false
);
mainGame
->
cbDBCategory
->
setSelected
(
mainGame
->
deckBuilder
.
prev_category
);
mainGame
->
RefreshDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
cbDBDecks
->
setSelected
(
mainGame
->
deckBuilder
.
prev_deck
);
irr
::
gui
::
IGUIListBox
*
lstCategories
=
mainGame
->
lstCategories
;
lstCategories
->
clear
();
lstCategories
->
addItem
(
dataManager
.
GetSysString
(
1450
));
lstCategories
->
addItem
(
dataManager
.
GetSysString
(
1451
));
lstCategories
->
addItem
(
dataManager
.
GetSysString
(
1452
));
lstCategories
->
addItem
(
dataManager
.
GetSysString
(
1453
));
FileSystem
::
TraversalDir
(
L"./deck"
,
[
lstCategories
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
isdir
)
{
lstCategories
->
addItem
(
name
);
}
});
lstCategories
->
setSelected
(
mainGame
->
deckBuilder
.
prev_category
);
refreshDeckList
();
mainGame
->
lstDecks
->
setSelected
(
mainGame
->
deckBuilder
.
prev_deck
);
mainGame
->
PopupElement
(
mainGame
->
wManageDeck
);
}
void
DeckBuilder
::
Initialize
()
{
void
DeckBuilder
::
Initialize
()
{
mainGame
->
is_building
=
true
;
mainGame
->
is_building
=
true
;
...
@@ -129,14 +177,13 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -129,14 +177,13 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
switch
(
event
.
EventType
)
{
switch
(
event
.
EventType
)
{
case
irr
:
:
EET_GUI_EVENT
:
{
case
irr
:
:
EET_GUI_EVENT
:
{
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
s32
id
=
event
.
GUIEvent
.
Caller
->
getID
();
if
(
mainGame
->
wCategories
->
isVisible
()
&&
id
!=
BUTTON_CATEGORY_OK
)
if
(((
mainGame
->
wCategories
->
isVisible
()
&&
id
!=
BUTTON_CATEGORY_OK
)
||
break
;
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
||
if
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
(
mainGame
->
wLinkMarks
->
isVisible
()
&&
id
!=
BUTTON_MARKERS_OK
)
||
break
;
(
mainGame
->
wManageDeck
->
isVisible
()
&&
!
(
id
>=
WINDOW_MANAGE_DECK
&&
id
<=
LISTBOX_CATEGORY_DECKS
)))
if
(
mainGame
->
wLinkMarks
->
isVisible
()
&&
id
!=
BUTTON_MARKERS_OK
)
&&
event
.
GUIEvent
.
EventType
!=
irr
::
gui
::
EGET_COMBO_BOX_CHANGED
)
{
break
;
if
(
mainGame
->
wManageDeck
->
isVisible
()
&&
!
(
id
>=
WINDOW_MANAGE_DECK
&&
id
<=
LISTBOX_CATEGORY_DECKS
))
break
;
break
;
}
switch
(
event
.
GUIEvent
.
EventType
)
{
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_ELEMENT_CLOSED
:
{
case
irr
:
:
gui
::
EGET_ELEMENT_CLOSED
:
{
if
(
id
==
WINDOW_MANAGE_DECK
)
{
if
(
id
==
WINDOW_MANAGE_DECK
)
{
...
@@ -197,7 +244,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -197,7 +244,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
cbDBDecks
->
setSelected
(
mainGame
->
cbDBDecks
->
getItemCount
()
-
1
);
mainGame
->
cbDBDecks
->
setSelected
(
mainGame
->
cbDBDecks
->
getItemCount
()
-
1
);
}
}
wchar_t
catepath
[
256
];
wchar_t
catepath
[
256
];
deckManager
.
GetCategoryPath
(
catepath
,
mainGame
->
cbDBCategory
);
deckManager
.
GetCategoryPath
(
catepath
,
mainGame
->
cbDBCategory
->
getSelected
(),
mainGame
->
cbDBCategory
->
getText
()
);
wchar_t
filepath
[
256
];
wchar_t
filepath
[
256
];
myswprintf
(
filepath
,
L"%ls/%ls.ydk"
,
catepath
,
dname
);
myswprintf
(
filepath
,
L"%ls/%ls.ydk"
,
catepath
,
dname
);
if
(
deckManager
.
SaveDeck
(
deckManager
.
current_deck
,
filepath
))
{
if
(
deckManager
.
SaveDeck
(
deckManager
.
current_deck
,
filepath
))
{
...
@@ -259,7 +306,15 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -259,7 +306,15 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
BUTTON_MANAGE_DECK
:
{
case
BUTTON_MANAGE_DECK
:
{
mainGame
->
PopupElement
(
mainGame
->
wManageDeck
);
if
(
is_modified
&&
!
readonly
&&
!
mainGame
->
chkIgnoreDeckChanges
->
isChecked
())
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
guiFont
,
dataManager
.
GetSysString
(
1356
));
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
Unlock
();
prev_operation
=
id
;
break
;
}
showManageDeck
();
break
;
break
;
}
}
case
BUTTON_SIDE_OK
:
{
case
BUTTON_SIDE_OK
:
{
...
@@ -321,24 +376,16 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -321,24 +376,16 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
prev_sel
=
-
1
;
prev_sel
=
-
1
;
}
else
if
(
prev_operation
==
BUTTON_LEAVE_GAME
)
{
}
else
if
(
prev_operation
==
BUTTON_LEAVE_GAME
)
{
Terminate
();
Terminate
();
}
else
if
(
prev_operation
==
COMBOBOX_DBCATEGORY
||
prev_operation
==
COMBOBOX_DBDECKS
)
{
}
else
if
(
prev_operation
==
COMBOBOX_DBCATEGORY
)
{
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
changeCategory
(
catesel
);
}
else
if
(
prev_operation
==
COMBOBOX_DBDECKS
)
{
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
int
decksel
=
mainGame
->
cbDBDecks
->
getSelected
();
if
(
prev_operation
==
COMBOBOX_DBCATEGORY
)
{
if
(
catesel
==
3
)
{
catesel
=
2
;
mainGame
->
cbDBCategory
->
setSelected
(
2
);
}
readonly
=
catesel
<
2
;
mainGame
->
btnSaveDeck
->
setEnabled
(
!
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
!
readonly
);
mainGame
->
RefreshDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
cbDBDecks
->
setSelected
(
0
);
}
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
prev_category
=
catesel
;
prev_deck
=
decksel
;
prev_deck
=
decksel
;
is_modified
=
false
;
is_modified
=
false
;
}
else
if
(
prev_operation
==
BUTTON_MANAGE_DECK
)
{
showManageDeck
();
}
}
prev_operation
=
0
;
prev_operation
=
0
;
break
;
break
;
...
@@ -418,6 +465,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -418,6 +465,10 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
case
COMBOBOX_DBCATEGORY
:
{
case
COMBOBOX_DBCATEGORY
:
{
if
(
isHavePopupWindow
())
{
mainGame
->
cbDBCategory
->
setSelected
(
prev_category
);
break
;
}
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
int
catesel
=
mainGame
->
cbDBCategory
->
getSelected
();
if
(
catesel
==
3
)
{
if
(
catesel
==
3
)
{
catesel
=
2
;
catesel
=
2
;
...
@@ -433,18 +484,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -433,18 +484,14 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
prev_operation
=
id
;
prev_operation
=
id
;
break
;
break
;
}
}
if
(
catesel
>=
0
)
{
changeCategory
(
catesel
);
readonly
=
catesel
<
2
;
mainGame
->
btnSaveDeck
->
setEnabled
(
!
readonly
);
mainGame
->
btnDeleteDeck
->
setEnabled
(
!
readonly
);
mainGame
->
RefreshDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
mainGame
->
cbDBDecks
->
setSelected
(
0
);
deckManager
.
LoadDeck
(
mainGame
->
cbDBCategory
,
mainGame
->
cbDBDecks
);
}
prev_category
=
catesel
;
break
;
break
;
}
}
case
COMBOBOX_DBDECKS
:
{
case
COMBOBOX_DBDECKS
:
{
if
(
isHavePopupWindow
())
{
mainGame
->
cbDBDecks
->
setSelected
(
prev_deck
);
break
;
}
if
(
is_modified
&&
!
readonly
&&
!
mainGame
->
chkIgnoreDeckChanges
->
isChecked
())
{
if
(
is_modified
&&
!
readonly
&&
!
mainGame
->
chkIgnoreDeckChanges
->
isChecked
())
{
mainGame
->
gMutex
.
Lock
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
guiFont
,
dataManager
.
GetSysString
(
1356
));
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
guiFont
,
dataManager
.
GetSysString
(
1356
));
...
@@ -577,6 +624,37 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -577,6 +624,37 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
InstantSearch
();
InstantSearch
();
}
}
}
}
case
irr
:
:
gui
::
EGET_LISTBOX_CHANGED
:
{
switch
(
id
)
{
case
LISTBOX_CATEGORIES
:
{
int
catesel
=
mainGame
->
lstCategories
->
getSelected
();
if
(
catesel
==
3
)
{
catesel
=
2
;
mainGame
->
lstCategories
->
setSelected
(
catesel
);
break
;
}
refreshDeckList
();
mainGame
->
lstDecks
->
setSelected
(
0
);
mainGame
->
cbDBCategory
->
setSelected
(
catesel
);
changeCategory
(
catesel
);
break
;
}
case
LISTBOX_CATEGORY_DECKS
:
{
int
decksel
=
mainGame
->
lstDecks
->
getSelected
();
mainGame
->
cbDBDecks
->
setSelected
(
decksel
);
if
(
decksel
==
-
1
)
break
;
wchar_t
filepath
[
256
];
wchar_t
catepath
[
256
];
deckManager
.
GetCategoryPath
(
catepath
,
mainGame
->
lstCategories
->
getSelected
(),
mainGame
->
lstCategories
->
getListItem
(
mainGame
->
lstCategories
->
getSelected
()));
myswprintf
(
filepath
,
L"%ls/%ls.ydk"
,
catepath
,
mainGame
->
lstDecks
->
getListItem
(
decksel
));
deckManager
.
LoadDeck
(
filepath
);
prev_deck
=
decksel
;
break
;
}
}
break
;
}
default:
break
;
default:
break
;
}
}
break
;
break
;
...
...
gframe/deck_manager.cpp
View file @
0cbdcdf0
...
@@ -191,9 +191,9 @@ bool DeckManager::LoadSide(Deck& deck, int* dbuf, int mainc, int sidec) {
...
@@ -191,9 +191,9 @@ bool DeckManager::LoadSide(Deck& deck, int* dbuf, int mainc, int sidec) {
deck
=
ndeck
;
deck
=
ndeck
;
return
true
;
return
true
;
}
}
void
DeckManager
::
GetCategoryPath
(
wchar_t
*
ret
,
i
rr
::
gui
::
IGUIComboBox
*
cbCategory
)
{
void
DeckManager
::
GetCategoryPath
(
wchar_t
*
ret
,
i
nt
index
,
const
wchar_t
*
text
)
{
wchar_t
catepath
[
256
];
wchar_t
catepath
[
256
];
switch
(
cbCategory
->
getSelected
()
)
{
switch
(
index
)
{
case
0
:
case
0
:
myswprintf
(
catepath
,
L"./pack"
);
myswprintf
(
catepath
,
L"./pack"
);
break
;
break
;
...
@@ -206,14 +206,14 @@ void DeckManager::GetCategoryPath(wchar_t* ret, irr::gui::IGUIComboBox* cbCatego
...
@@ -206,14 +206,14 @@ void DeckManager::GetCategoryPath(wchar_t* ret, irr::gui::IGUIComboBox* cbCatego
myswprintf
(
catepath
,
L"./deck"
);
myswprintf
(
catepath
,
L"./deck"
);
break
;
break
;
default:
default:
myswprintf
(
catepath
,
L"./deck/%ls"
,
cbCategory
->
getItem
(
cbCategory
->
getSelected
())
);
myswprintf
(
catepath
,
L"./deck/%ls"
,
text
);
}
}
BufferIO
::
CopyWStr
(
catepath
,
ret
,
256
);
BufferIO
::
CopyWStr
(
catepath
,
ret
,
256
);
}
}
void
DeckManager
::
GetDeckFile
(
wchar_t
*
ret
,
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
void
DeckManager
::
GetDeckFile
(
wchar_t
*
ret
,
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
wchar_t
filepath
[
256
];
wchar_t
filepath
[
256
];
wchar_t
catepath
[
256
];
wchar_t
catepath
[
256
];
GetCategoryPath
(
catepath
,
cbCategory
);
GetCategoryPath
(
catepath
,
cbCategory
->
getSelected
(),
cbCategory
->
getText
()
);
myswprintf
(
filepath
,
L"%ls/%ls.ydk"
,
catepath
,
cbDeck
->
getItem
(
cbDeck
->
getSelected
()));
myswprintf
(
filepath
,
L"%ls/%ls.ydk"
,
catepath
,
cbDeck
->
getItem
(
cbDeck
->
getSelected
()));
BufferIO
::
CopyWStr
(
filepath
,
ret
,
256
);
BufferIO
::
CopyWStr
(
filepath
,
ret
,
256
);
}
}
...
...
gframe/deck_manager.h
View file @
0cbdcdf0
...
@@ -41,7 +41,7 @@ public:
...
@@ -41,7 +41,7 @@ public:
int
CheckDeck
(
Deck
&
deck
,
int
lfhash
,
bool
allow_ocg
,
bool
allow_tcg
);
int
CheckDeck
(
Deck
&
deck
,
int
lfhash
,
bool
allow_ocg
,
bool
allow_tcg
);
int
LoadDeck
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
int
LoadDeck
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
bool
LoadSide
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
bool
LoadSide
(
Deck
&
deck
,
int
*
dbuf
,
int
mainc
,
int
sidec
);
void
GetCategoryPath
(
wchar_t
*
ret
,
i
rr
::
gui
::
IGUIComboBox
*
cbCategory
);
void
GetCategoryPath
(
wchar_t
*
ret
,
i
nt
index
,
const
wchar_t
*
text
);
void
GetDeckFile
(
wchar_t
*
ret
,
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
GetDeckFile
(
wchar_t
*
ret
,
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
bool
LoadDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
bool
LoadDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
FILE
*
OpenDeckFile
(
const
wchar_t
*
file
,
const
char
*
mode
);
FILE
*
OpenDeckFile
(
const
wchar_t
*
file
,
const
char
*
mode
);
...
...
gframe/game.cpp
View file @
0cbdcdf0
...
@@ -525,7 +525,7 @@ bool Game::Initialize() {
...
@@ -525,7 +525,7 @@ bool Game::Initialize() {
stDBCategory
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1300
),
rect
<
s32
>
(
10
,
9
,
100
,
29
),
false
,
false
,
wDeckEdit
);
stDBCategory
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1300
),
rect
<
s32
>
(
10
,
9
,
100
,
29
),
false
,
false
,
wDeckEdit
);
cbDBCategory
=
env
->
addComboBox
(
rect
<
s32
>
(
80
,
5
,
220
,
30
),
wDeckEdit
,
COMBOBOX_DBCATEGORY
);
cbDBCategory
=
env
->
addComboBox
(
rect
<
s32
>
(
80
,
5
,
220
,
30
),
wDeckEdit
,
COMBOBOX_DBCATEGORY
);
cbDBCategory
->
setMaxSelectionRows
(
1
0
);
cbDBCategory
->
setMaxSelectionRows
(
1
5
);
stDeck
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1301
),
rect
<
s32
>
(
10
,
39
,
100
,
59
),
false
,
false
,
wDeckEdit
);
stDeck
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1301
),
rect
<
s32
>
(
10
,
39
,
100
,
59
),
false
,
false
,
wDeckEdit
);
cbDBDecks
=
env
->
addComboBox
(
rect
<
s32
>
(
80
,
35
,
220
,
60
),
wDeckEdit
,
COMBOBOX_DBDECKS
);
cbDBDecks
=
env
->
addComboBox
(
rect
<
s32
>
(
80
,
35
,
220
,
60
),
wDeckEdit
,
COMBOBOX_DBDECKS
);
cbDBDecks
->
setMaxSelectionRows
(
15
);
cbDBDecks
->
setMaxSelectionRows
(
15
);
...
@@ -981,7 +981,7 @@ void Game::LoadExpansions() {
...
@@ -981,7 +981,7 @@ void Game::LoadExpansions() {
}
}
}
}
}
}
void
Game
::
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
void
Game
::
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
,
bool
selectlastused
)
{
cbCategory
->
clear
();
cbCategory
->
clear
();
cbCategory
->
addItem
(
dataManager
.
GetSysString
(
1450
));
cbCategory
->
addItem
(
dataManager
.
GetSysString
(
1450
));
cbCategory
->
addItem
(
dataManager
.
GetSysString
(
1451
));
cbCategory
->
addItem
(
dataManager
.
GetSysString
(
1451
));
...
@@ -993,24 +993,28 @@ void Game::RefreshCategoryDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGU
...
@@ -993,24 +993,28 @@ void Game::RefreshCategoryDeck(irr::gui::IGUIComboBox* cbCategory, irr::gui::IGU
}
}
});
});
cbCategory
->
setSelected
(
2
);
cbCategory
->
setSelected
(
2
);
for
(
size_t
i
=
0
;
i
<
cbCategory
->
getItemCount
();
++
i
)
{
if
(
selectlastused
)
{
if
(
!
wcscmp
(
cbCategory
->
getItem
(
i
),
gameConf
.
lastcategory
))
{
for
(
size_t
i
=
0
;
i
<
cbCategory
->
getItemCount
();
++
i
)
{
cbCategory
->
setSelected
(
i
);
if
(
!
wcscmp
(
cbCategory
->
getItem
(
i
),
gameConf
.
lastcategory
))
{
break
;
cbCategory
->
setSelected
(
i
);
break
;
}
}
}
}
}
RefreshDeck
(
cbCategory
,
cbDeck
);
RefreshDeck
(
cbCategory
,
cbDeck
);
if
(
selectlastused
)
{
for
(
size_t
i
=
0
;
i
<
cbDeck
->
getItemCount
();
++
i
)
{
if
(
!
wcscmp
(
cbDeck
->
getItem
(
i
),
gameConf
.
lastdeck
))
{
cbDeck
->
setSelected
(
i
);
break
;
}
}
}
}
}
void
Game
::
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
void
Game
::
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
wchar_t
catepath
[
256
];
wchar_t
catepath
[
256
];
deckManager
.
GetCategoryPath
(
catepath
,
cbCategory
);
deckManager
.
GetCategoryPath
(
catepath
,
cbCategory
->
getSelected
(),
cbCategory
->
getText
()
);
RefreshDeck
(
catepath
,
cbDeck
);
RefreshDeck
(
catepath
,
cbDeck
);
for
(
size_t
i
=
0
;
i
<
cbDeck
->
getItemCount
();
++
i
)
{
if
(
!
wcscmp
(
cbDeck
->
getItem
(
i
),
gameConf
.
lastdeck
))
{
cbDeck
->
setSelected
(
i
);
break
;
}
}
}
}
void
Game
::
RefreshDeck
(
const
wchar_t
*
deckpath
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
void
Game
::
RefreshDeck
(
const
wchar_t
*
deckpath
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
)
{
cbDeck
->
clear
();
cbDeck
->
clear
();
...
...
gframe/game.h
View file @
0cbdcdf0
...
@@ -115,7 +115,7 @@ public:
...
@@ -115,7 +115,7 @@ public:
void
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
void
InitStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
u32
cHeight
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
);
void
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
void
SetStaticText
(
irr
::
gui
::
IGUIStaticText
*
pControl
,
u32
cWidth
,
irr
::
gui
::
CGUITTFont
*
font
,
const
wchar_t
*
text
,
u32
pos
=
0
);
void
LoadExpansions
();
void
LoadExpansions
();
void
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshCategoryDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
,
bool
selectlastused
=
true
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshDeck
(
irr
::
gui
::
IGUIComboBox
*
cbCategory
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshDeck
(
const
wchar_t
*
deckpath
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshDeck
(
const
wchar_t
*
deckpath
,
irr
::
gui
::
IGUIComboBox
*
cbDeck
);
void
RefreshReplay
();
void
RefreshReplay
();
...
...
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