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
baichixing
ygopro
Commits
c9824af0
Commit
c9824af0
authored
Apr 05, 2017
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Link Markers Filter
parent
d51773a5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
4 deletions
+64
-4
gframe/deck_con.cpp
gframe/deck_con.cpp
+32
-0
gframe/deck_con.h
gframe/deck_con.h
+1
-0
gframe/game.cpp
gframe/game.cpp
+21
-4
gframe/game.h
gframe/game.h
+7
-0
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+3
-0
No files found.
gframe/deck_con.cpp
View file @
c9824af0
...
...
@@ -66,6 +66,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
if
(
mainGame
->
wQuery
->
isVisible
()
&&
id
!=
BUTTON_YES
&&
id
!=
BUTTON_NO
)
break
;
if
(
mainGame
->
wLinkMarks
->
isVisible
()
&&
id
!=
BUTTON_MARKERS_OK
)
break
;
switch
(
event
.
GUIEvent
.
EventType
)
{
case
irr
:
:
gui
::
EGET_BUTTON_CLICKED
:
{
switch
(
id
)
{
...
...
@@ -242,6 +244,31 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
is_clearing
=
false
;
break
;
}
case
BUTTON_MARKS_FILTER
:
{
mainGame
->
PopupElement
(
mainGame
->
wLinkMarks
);
break
;
}
case
BUTTON_MARKERS_OK
:
{
filter_marks
=
0
;
if
(
mainGame
->
btnMark
[
0
]
->
isPressed
())
filter_marks
|=
0100
;
if
(
mainGame
->
btnMark
[
1
]
->
isPressed
())
filter_marks
|=
0200
;
if
(
mainGame
->
btnMark
[
2
]
->
isPressed
())
filter_marks
|=
0400
;
if
(
mainGame
->
btnMark
[
3
]
->
isPressed
())
filter_marks
|=
0010
;
if
(
mainGame
->
btnMark
[
4
]
->
isPressed
())
filter_marks
|=
0040
;
if
(
mainGame
->
btnMark
[
5
]
->
isPressed
())
filter_marks
|=
0001
;
if
(
mainGame
->
btnMark
[
6
]
->
isPressed
())
filter_marks
|=
0002
;
if
(
mainGame
->
btnMark
[
7
]
->
isPressed
())
filter_marks
|=
0004
;
mainGame
->
HideElement
(
mainGame
->
wLinkMarks
);
break
;
}
}
break
;
}
...
...
@@ -860,6 +887,8 @@ void DeckBuilder::FilterCards() {
}
if
(
filter_effect
&&
!
(
data
.
category
&
filter_effect
))
continue
;
if
(
filter_marks
&&
(
data
.
link_marker
&
filter_marks
)
!=
filter_marks
)
continue
;
if
(
filter_lm
)
{
if
(
filter_lm
<=
3
&&
(
!
filterList
->
count
(
ptr
->
first
)
||
(
*
filterList
)[
ptr
->
first
]
!=
filter_lm
-
1
))
continue
;
...
...
@@ -921,6 +950,9 @@ void DeckBuilder::ClearFilter() {
filter_effect
=
0
;
for
(
int
i
=
0
;
i
<
32
;
++
i
)
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
filter_marks
=
0
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
mainGame
->
btnMark
[
i
]
->
setPressed
(
false
);
}
void
DeckBuilder
::
SortList
()
{
auto
left
=
results
.
begin
();
...
...
gframe/deck_con.h
View file @
c9824af0
...
...
@@ -29,6 +29,7 @@ public:
unsigned
int
filter_lv
;
unsigned
int
filter_scltype
;
unsigned
int
filter_scl
;
unsigned
int
filter_marks
;
int
filter_lm
;
int
hovered_code
;
int
hovered_pos
;
...
...
gframe/game.cpp
View file @
c9824af0
...
...
@@ -472,11 +472,11 @@ bool Game::Initialize() {
env
->
addStaticText
(
dataManager
.
GetSysString
(
1323
),
rect
<
s32
>
(
205
,
42
+
75
/
6
,
280
,
62
+
75
/
6
),
false
,
false
,
wFilter
);
ebDefense
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
260
,
40
+
75
/
6
,
340
,
60
+
75
/
6
),
true
,
wFilter
);
ebDefense
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1324
),
rect
<
s32
>
(
10
,
62
+
100
/
6
,
80
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebStar
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
60
,
60
+
100
/
6
,
190
,
80
+
100
/
6
),
true
,
wFilter
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1324
),
rect
<
s32
>
(
10
,
74
,
80
,
94
),
false
,
false
,
wFilter
);
ebStar
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
60
,
72
,
100
,
92
),
true
,
wFilter
);
ebStar
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1336
),
rect
<
s32
>
(
10
,
82
+
125
/
6
,
80
,
102
+
125
/
6
),
false
,
false
,
wFilter
);
ebScale
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
60
,
80
+
125
/
6
,
190
,
100
+
125
/
6
),
true
,
wFilter
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1336
),
rect
<
s32
>
(
10
1
,
74
,
150
,
94
),
false
,
false
,
wFilter
);
ebScale
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
150
,
72
,
190
,
92
),
true
,
wFilter
);
ebScale
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
env
->
addStaticText
(
dataManager
.
GetSysString
(
1325
),
rect
<
s32
>
(
205
,
62
+
100
/
6
,
280
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebCardName
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
260
,
60
+
100
/
6
,
390
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_KEYWORD
);
...
...
@@ -495,6 +495,23 @@ bool Game::Initialize() {
btnCategoryOK
=
env
->
addButton
(
rect
<
s32
>
(
135
,
175
,
235
,
200
),
wCategories
,
BUTTON_CATEGORY_OK
,
dataManager
.
GetSysString
(
1211
));
for
(
int
i
=
0
;
i
<
32
;
++
i
)
chkCategory
[
i
]
=
env
->
addCheckBox
(
false
,
recti
(
10
+
(
i
%
4
)
*
90
,
10
+
(
i
/
4
)
*
20
,
100
+
(
i
%
4
)
*
90
,
30
+
(
i
/
4
)
*
20
),
wCategories
,
-
1
,
dataManager
.
GetSysString
(
1100
+
i
));
btnMarksFilter
=
env
->
addButton
(
rect
<
s32
>
(
60
,
80
+
125
/
6
,
190
,
100
+
125
/
6
),
wFilter
,
BUTTON_MARKS_FILTER
,
dataManager
.
GetSysString
(
1374
));
wLinkMarks
=
env
->
addWindow
(
rect
<
s32
>
(
700
,
30
,
820
,
150
),
false
,
dataManager
.
strBuffer
);
wLinkMarks
->
getCloseButton
()
->
setVisible
(
false
);
wLinkMarks
->
setDrawTitlebar
(
false
);
wLinkMarks
->
setDraggable
(
false
);
wLinkMarks
->
setVisible
(
false
);
btnMarksOK
=
env
->
addButton
(
recti
(
45
,
45
,
75
,
75
),
wLinkMarks
,
BUTTON_MARKERS_OK
,
dataManager
.
GetSysString
(
1211
));
btnMark
[
0
]
=
env
->
addButton
(
recti
(
10
,
10
,
40
,
40
),
wLinkMarks
,
-
1
,
L"
\x2196
"
);
btnMark
[
1
]
=
env
->
addButton
(
recti
(
45
,
10
,
75
,
40
),
wLinkMarks
,
-
1
,
L"
\x2191
"
);
btnMark
[
2
]
=
env
->
addButton
(
recti
(
80
,
10
,
110
,
40
),
wLinkMarks
,
-
1
,
L"
\x2197
"
);
btnMark
[
3
]
=
env
->
addButton
(
recti
(
10
,
45
,
40
,
75
),
wLinkMarks
,
-
1
,
L"
\x2190
"
);
btnMark
[
4
]
=
env
->
addButton
(
recti
(
80
,
45
,
110
,
75
),
wLinkMarks
,
-
1
,
L"
\x2192
"
);
btnMark
[
5
]
=
env
->
addButton
(
recti
(
10
,
80
,
40
,
110
),
wLinkMarks
,
-
1
,
L"
\x2199
"
);
btnMark
[
6
]
=
env
->
addButton
(
recti
(
45
,
80
,
75
,
110
),
wLinkMarks
,
-
1
,
L"
\x2193
"
);
btnMark
[
7
]
=
env
->
addButton
(
recti
(
80
,
80
,
110
,
110
),
wLinkMarks
,
-
1
,
L"
\x2198
"
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
btnMark
[
i
]
->
setIsPushButton
(
true
);
//replay window
wReplay
=
env
->
addWindow
(
rect
<
s32
>
(
220
,
100
,
800
,
520
),
false
,
dataManager
.
GetSysString
(
1202
));
wReplay
->
getCloseButton
()
->
setVisible
(
false
);
...
...
gframe/game.h
View file @
c9824af0
...
...
@@ -382,6 +382,10 @@ public:
irr
::
gui
::
IGUIWindow
*
wCategories
;
irr
::
gui
::
IGUICheckBox
*
chkCategory
[
32
];
irr
::
gui
::
IGUIButton
*
btnCategoryOK
;
irr
::
gui
::
IGUIButton
*
btnMarksFilter
;
irr
::
gui
::
IGUIWindow
*
wLinkMarks
;
irr
::
gui
::
IGUIButton
*
btnMark
[
8
];
irr
::
gui
::
IGUIButton
*
btnMarksOK
;
//sort type
irr
::
gui
::
IGUIStaticText
*
wSort
;
irr
::
gui
::
IGUIComboBox
*
cbSortType
;
...
...
@@ -538,5 +542,8 @@ extern Game* mainGame;
#define BUTTON_CANCEL_SINGLEPLAY 352
#define COMBOBOX_SORTTYPE 370
#define BUTTON_MARKS_FILTER 380
#define BUTTON_MARKERS_OK 381
#define DEFAULT_DUEL_RULE 3
#endif // GAME_H
gframe/menu_handler.cpp
View file @
c9824af0
...
...
@@ -271,6 +271,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
ebStar
->
setEnabled
(
false
);
mainGame
->
ebScale
->
setEnabled
(
false
);
mainGame
->
deckBuilder
.
filter_effect
=
0
;
mainGame
->
deckBuilder
.
filter_marks
=
0
;
mainGame
->
deckBuilder
.
result_string
[
0
]
=
L'0'
;
mainGame
->
deckBuilder
.
result_string
[
1
]
=
0
;
mainGame
->
deckBuilder
.
results
.
clear
();
...
...
@@ -280,6 +281,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
deckBuilder
);
for
(
int
i
=
0
;
i
<
32
;
++
i
)
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
for
(
int
i
=
0
;
i
<
8
;
i
++
)
mainGame
->
btnMark
[
i
]
->
setPressed
(
false
);
break
;
}
}
...
...
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