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
MobiusMei
ygopro
Commits
c6b0ede5
Commit
c6b0ede5
authored
Jun 15, 2016
by
独孤朲
Committed by
GitHub
Jun 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1776 from mercury233/patch-1
fix and update del deck and clear deck
parents
1dc1e961
ec267d3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
16 deletions
+38
-16
gframe/deck_con.cpp
gframe/deck_con.cpp
+35
-16
gframe/deck_con.h
gframe/deck_con.h
+2
-0
strings.conf
strings.conf
+1
-0
No files found.
gframe/deck_con.cpp
View file @
c6b0ede5
...
...
@@ -51,9 +51,11 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
switch
(
id
)
{
case
BUTTON_CLEAR_DECK
:
{
deckManager
.
current_deck
.
main
.
clear
();
deckManager
.
current_deck
.
extra
.
clear
();
deckManager
.
current_deck
.
side
.
clear
();
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetSysString
(
1339
));
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
Unlock
();
is_clearing
=
true
;
break
;
}
case
BUTTON_SORT_DECK
:
{
...
...
@@ -97,12 +99,16 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_DELETE_DECK
:
{
if
(
mainGame
->
cbDBDecks
->
getSelected
()
==
-
1
)
int
sel
=
mainGame
->
cbDBDecks
->
getSelected
();
if
(
sel
==
-
1
)
break
;
mainGame
->
gMutex
.
Lock
();
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
dataManager
.
GetSysString
(
1337
));
wchar_t
textBuffer
[
256
];
myswprintf
(
textBuffer
,
L"%ls
\n
%ls"
,
mainGame
->
cbDBDecks
->
getItem
(
sel
),
dataManager
.
GetSysString
(
1337
));
mainGame
->
SetStaticText
(
mainGame
->
stQMessage
,
310
,
mainGame
->
textFont
,
(
wchar_t
*
)
textBuffer
);
mainGame
->
PopupElement
(
mainGame
->
wQuery
);
mainGame
->
gMutex
.
Unlock
();
is_deleting
=
true
;
break
;
}
case
BUTTON_LEAVE_GAME
:
{
...
...
@@ -181,22 +187,35 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_YES
:
{
mainGame
->
HideElement
(
mainGame
->
wQuery
);
int
sel
=
mainGame
->
cbDBDecks
->
getSelected
();
if
(
deckManager
.
DeleteDeck
(
deckManager
.
current_deck
,
mainGame
->
cbDBDecks
->
getItem
(
sel
)))
{
mainGame
->
cbDBDecks
->
removeItem
(
sel
);
int
count
=
mainGame
->
cbDBDecks
->
getItemCount
();
if
(
sel
>=
count
)
sel
=
count
-
1
;
mainGame
->
cbDBDecks
->
setSelected
(
sel
);
if
(
sel
!=
-
1
)
deckManager
.
LoadDeck
(
mainGame
->
cbDBDecks
->
getItem
(
sel
));
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1338
));
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
if
(
!
mainGame
->
is_building
||
mainGame
->
is_siding
)
break
;
if
(
is_deleting
)
{
int
sel
=
mainGame
->
cbDBDecks
->
getSelected
();
if
(
deckManager
.
DeleteDeck
(
deckManager
.
current_deck
,
mainGame
->
cbDBDecks
->
getItem
(
sel
)))
{
mainGame
->
cbDBDecks
->
removeItem
(
sel
);
int
count
=
mainGame
->
cbDBDecks
->
getItemCount
();
if
(
sel
>=
count
)
sel
=
count
-
1
;
mainGame
->
cbDBDecks
->
setSelected
(
sel
);
if
(
sel
!=
-
1
)
deckManager
.
LoadDeck
(
mainGame
->
cbDBDecks
->
getItem
(
sel
));
mainGame
->
stACMessage
->
setText
(
dataManager
.
GetSysString
(
1338
));
mainGame
->
PopupElement
(
mainGame
->
wACMessage
,
20
);
}
is_deleting
=
false
;
}
if
(
is_clearing
)
{
deckManager
.
current_deck
.
main
.
clear
();
deckManager
.
current_deck
.
extra
.
clear
();
deckManager
.
current_deck
.
side
.
clear
();
is_clearing
=
false
;
}
break
;
}
case
BUTTON_NO
:
{
mainGame
->
HideElement
(
mainGame
->
wQuery
);
is_deleting
=
false
;
is_clearing
=
false
;
break
;
}
}
...
...
gframe/deck_con.h
View file @
c6b0ede5
...
...
@@ -41,6 +41,8 @@ public:
size_t
pre_extrac
;
size_t
pre_sidec
;
code_pointer
draging_pointer
;
bool
is_deleting
;
bool
is_clearing
;
std
::
unordered_map
<
int
,
int
>*
filterList
;
std
::
vector
<
code_pointer
>
results
;
...
...
strings.conf
View file @
c6b0ede5
...
...
@@ -318,6 +318,7 @@
!
system
1336
刻度:
!
system
1337
是否删除这个卡组?
!
system
1338
删除成功
!
system
1339
是否清空正在编辑的卡组?
!
system
1340
是否保存录像?
!
system
1341
保存
!
system
1342
录像文件:
...
...
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