Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rd-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
苍蓝
rd-ygopro
Commits
d52d9691
Commit
d52d9691
authored
May 21, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clear filter button
parent
024b36f0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
10 deletions
+28
-10
gframe/deck_con.cpp
gframe/deck_con.cpp
+15
-9
gframe/deck_con.h
gframe/deck_con.h
+2
-1
gframe/game.cpp
gframe/game.cpp
+8
-0
gframe/game.h
gframe/game.h
+3
-0
No files found.
gframe/deck_con.cpp
View file @
d52d9691
...
...
@@ -119,17 +119,21 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
filter_type
=
mainGame
->
cbCardType
->
getSelected
();
filter_type2
=
mainGame
->
cbCardType2
->
getItemData
(
mainGame
->
cbCardType2
->
getSelected
());
filter_lm
=
mainGame
->
cbLimit
->
getSelected
();
if
(
filter_type
>
1
)
{
FilterCards
();
break
;
}
if
(
filter_type
==
1
)
{
filter_attrib
=
mainGame
->
cbAttribute
->
getItemData
(
mainGame
->
cbAttribute
->
getSelected
());
filter_race
=
mainGame
->
cbRace
->
getItemData
(
mainGame
->
cbRace
->
getSelected
());
filter_atk
=
parse_filter
(
mainGame
->
ebAttack
->
getText
(),
&
filter_atktype
);
filter_def
=
parse_filter
(
mainGame
->
ebDefence
->
getText
(),
&
filter_deftype
);
filter_lv
=
parse_filter
(
mainGame
->
ebStar
->
getText
(),
&
filter_lvtype
);
filter_scl
=
parse_filter
(
mainGame
->
ebScale
->
getText
(),
&
filter_scltype
);
}
FilterCards
();
if
(
!
mainGame
->
gameConf
.
separate_clear_button
)
ClearFilter
();
break
;
}
case
BUTTON_CLEAR_FILTER
:
{
ClearFilter
();
break
;
}
case
BUTTON_CATEGORY_OK
:
{
...
...
@@ -717,6 +721,8 @@ void DeckBuilder::FilterCards() {
mainGame
->
scrFilter
->
setPos
(
0
);
}
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_lv
);
}
void
DeckBuilder
::
ClearFilter
()
{
mainGame
->
cbAttribute
->
setSelected
(
0
);
mainGame
->
cbRace
->
setSelected
(
0
);
mainGame
->
cbLimit
->
setSelected
(
0
);
...
...
gframe/deck_con.h
View file @
d52d9691
...
...
@@ -12,6 +12,7 @@ class DeckBuilder: public irr::IEventReceiver {
public:
virtual
bool
OnEvent
(
const
irr
::
SEvent
&
event
);
void
FilterCards
();
void
ClearFilter
();
long
long
filter_effect
;
unsigned
int
filter_type
;
...
...
gframe/game.cpp
View file @
d52d9691
...
...
@@ -443,6 +443,10 @@ bool Game::Initialize() {
ebCardName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
btnEffectFilter
=
env
->
addButton
(
rect
<
s32
>
(
345
,
28
,
390
,
69
),
wFilter
,
BUTTON_EFFECT_FILTER
,
dataManager
.
GetSysString
(
1326
));
btnStartFilter
=
env
->
addButton
(
rect
<
s32
>
(
210
,
96
,
390
,
118
),
wFilter
,
BUTTON_START_FILTER
,
dataManager
.
GetSysString
(
1327
));
if
(
mainGame
->
gameConf
.
separate_clear_button
)
{
btnStartFilter
->
setRelativePosition
(
rect
<
s32
>
(
210
,
96
,
335
,
118
));
btnClearFilter
=
env
->
addButton
(
rect
<
s32
>
(
340
,
96
,
390
,
118
),
wFilter
,
BUTTON_CLEAR_FILTER
,
dataManager
.
GetSysString
(
1304
));
}
wCategories
=
env
->
addWindow
(
rect
<
s32
>
(
630
,
60
,
1000
,
270
),
false
,
dataManager
.
strBuffer
);
wCategories
->
getCloseButton
()
->
setVisible
(
false
);
wCategories
->
setDrawTitlebar
(
false
);
...
...
@@ -824,6 +828,7 @@ void Game::LoadConfig() {
gameConf
.
chkHideSetname
=
0
;
gameConf
.
control_mode
=
0
;
gameConf
.
draw_field_spell
=
1
;
gameConf
.
separate_clear_button
=
1
;
fseek
(
fp
,
0
,
SEEK_END
);
int
fsize
=
ftell
(
fp
);
fseek
(
fp
,
0
,
SEEK_SET
);
...
...
@@ -874,6 +879,8 @@ void Game::LoadConfig() {
gameConf
.
control_mode
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"draw_field_spell"
))
{
gameConf
.
draw_field_spell
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"separate_clear_button"
))
{
gameConf
.
separate_clear_button
=
atoi
(
valbuf
);
}
else
{
// options allowing multiple words
sscanf
(
linebuf
,
"%s = %240[^
\n
]"
,
strbuf
,
valbuf
);
...
...
@@ -925,6 +932,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"#control_mode = 0: Key A/S/R. control_mode = 1: MouseLeft/MouseRight/F9
\n
"
);
fprintf
(
fp
,
"control_mode = %d
\n
"
,
gameConf
.
control_mode
);
fprintf
(
fp
,
"draw_field_spell = %d
\n
"
,
gameConf
.
draw_field_spell
);
fprintf
(
fp
,
"separate_clear_button = %d
\n
"
,
gameConf
.
separate_clear_button
);
fclose
(
fp
);
}
void
Game
::
ShowCardInfo
(
int
code
)
{
...
...
gframe/game.h
View file @
d52d9691
...
...
@@ -34,6 +34,7 @@ struct Config {
int
chkHideSetname
;
int
control_mode
;
int
draw_field_spell
;
int
separate_clear_button
;
};
struct
DuelInfo
{
...
...
@@ -364,6 +365,7 @@ public:
irr
::
gui
::
IGUIEditBox
*
ebCardName
;
irr
::
gui
::
IGUIButton
*
btnEffectFilter
;
irr
::
gui
::
IGUIButton
*
btnStartFilter
;
irr
::
gui
::
IGUIButton
*
btnClearFilter
;
irr
::
gui
::
IGUIWindow
*
wCategories
;
irr
::
gui
::
IGUICheckBox
*
chkCategory
[
32
];
irr
::
gui
::
IGUIButton
*
btnCategoryOK
;
...
...
@@ -489,6 +491,7 @@ extern Game* mainGame;
#define BUTTON_START_FILTER 312
#define SCROLL_FILTER 314
#define EDITBOX_KEYWORD 315
#define BUTTON_CLEAR_FILTER 316
#define BUTTON_REPLAY_START 320
#define BUTTON_REPLAY_PAUSE 321
#define BUTTON_REPLAY_STEP 322
...
...
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