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
818c283f
Commit
818c283f
authored
May 25, 2016
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sort
parent
6272c66e
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
100 additions
and
6 deletions
+100
-6
gframe/client_card.cpp
gframe/client_card.cpp
+52
-1
gframe/client_card.h
gframe/client_card.h
+3
-0
gframe/deck_con.cpp
gframe/deck_con.cpp
+24
-1
gframe/deck_con.h
gframe/deck_con.h
+1
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-0
gframe/game.cpp
gframe/game.cpp
+8
-2
gframe/game.h
gframe/game.h
+4
-0
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-0
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+4
-0
No files found.
gframe/client_card.cpp
View file @
818c283f
#include "client_card.h"
#include "client_field.h"
#include "data_manager.h"
#include "game.h"
namespace
ygo
{
...
...
@@ -215,10 +216,60 @@ bool ClientCard::deck_sort_lv(code_pointer p1, code_pointer p2) {
return
p1
->
second
.
attack
>
p2
->
second
.
attack
;
if
(
p1
->
second
.
defence
!=
p2
->
second
.
defence
)
return
p1
->
second
.
defence
>
p2
->
second
.
defence
;
else
return
p1
->
first
<
p2
->
first
;
return
p1
->
first
<
p2
->
first
;
}
if
((
p1
->
second
.
type
&
0xfffffff8
)
!=
(
p2
->
second
.
type
&
0xfffffff8
))
return
(
p1
->
second
.
type
&
0xfffffff8
)
<
(
p2
->
second
.
type
&
0xfffffff8
);
return
p1
->
first
<
p2
->
first
;
}
bool
ClientCard
::
deck_sort_atk
(
code_pointer
p1
,
code_pointer
p2
)
{
if
((
p1
->
second
.
type
&
0x7
)
!=
(
p2
->
second
.
type
&
0x7
))
return
(
p1
->
second
.
type
&
0x7
)
<
(
p2
->
second
.
type
&
0x7
);
if
((
p1
->
second
.
type
&
0x7
)
==
1
)
{
if
(
p1
->
second
.
attack
!=
p2
->
second
.
attack
)
return
p1
->
second
.
attack
>
p2
->
second
.
attack
;
if
(
p1
->
second
.
defence
!=
p2
->
second
.
defence
)
return
p1
->
second
.
defence
>
p2
->
second
.
defence
;
if
(
p1
->
second
.
level
!=
p2
->
second
.
level
)
return
p1
->
second
.
level
>
p2
->
second
.
level
;
int
type1
=
(
p1
->
second
.
type
&
0x8020c0
)
?
(
p1
->
second
.
type
&
0x8020c1
)
:
(
p1
->
second
.
type
&
0x31
);
int
type2
=
(
p2
->
second
.
type
&
0x8020c0
)
?
(
p2
->
second
.
type
&
0x8020c1
)
:
(
p2
->
second
.
type
&
0x31
);
if
(
type1
!=
type2
)
return
type1
<
type2
;
return
p1
->
first
<
p2
->
first
;
}
if
((
p1
->
second
.
type
&
0xfffffff8
)
!=
(
p2
->
second
.
type
&
0xfffffff8
))
return
(
p1
->
second
.
type
&
0xfffffff8
)
<
(
p2
->
second
.
type
&
0xfffffff8
);
return
p1
->
first
<
p2
->
first
;
}
bool
ClientCard
::
deck_sort_def
(
code_pointer
p1
,
code_pointer
p2
)
{
if
((
p1
->
second
.
type
&
0x7
)
!=
(
p2
->
second
.
type
&
0x7
))
return
(
p1
->
second
.
type
&
0x7
)
<
(
p2
->
second
.
type
&
0x7
);
if
((
p1
->
second
.
type
&
0x7
)
==
1
)
{
if
(
p1
->
second
.
defence
!=
p2
->
second
.
defence
)
return
p1
->
second
.
defence
>
p2
->
second
.
defence
;
if
(
p1
->
second
.
attack
!=
p2
->
second
.
attack
)
return
p1
->
second
.
attack
>
p2
->
second
.
attack
;
if
(
p1
->
second
.
level
!=
p2
->
second
.
level
)
return
p1
->
second
.
level
>
p2
->
second
.
level
;
int
type1
=
(
p1
->
second
.
type
&
0x8020c0
)
?
(
p1
->
second
.
type
&
0x8020c1
)
:
(
p1
->
second
.
type
&
0x31
);
int
type2
=
(
p2
->
second
.
type
&
0x8020c0
)
?
(
p2
->
second
.
type
&
0x8020c1
)
:
(
p2
->
second
.
type
&
0x31
);
if
(
type1
!=
type2
)
return
type1
<
type2
;
return
p1
->
first
<
p2
->
first
;
}
if
((
p1
->
second
.
type
&
0xfffffff8
)
!=
(
p2
->
second
.
type
&
0xfffffff8
))
return
(
p1
->
second
.
type
&
0xfffffff8
)
<
(
p2
->
second
.
type
&
0xfffffff8
);
return
p1
->
first
<
p2
->
first
;
}
bool
ClientCard
::
deck_sort_name
(
code_pointer
p1
,
code_pointer
p2
)
{
CardString
cstr1
;
CardString
cstr2
;
dataManager
.
GetString
(
p1
->
second
.
code
,
&
cstr1
);
dataManager
.
GetString
(
p2
->
second
.
code
,
&
cstr2
);
int
res
=
wcscmp
(
cstr1
.
name
,
cstr2
.
name
);
if
(
res
!=
0
)
return
res
<
0
;
return
p1
->
first
<
p2
->
first
;
}
}
gframe/client_card.h
View file @
818c283f
...
...
@@ -112,6 +112,9 @@ public:
void
ClearTarget
();
static
bool
client_card_sort
(
ClientCard
*
c1
,
ClientCard
*
c2
);
static
bool
deck_sort_lv
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_atk
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_def
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_name
(
code_pointer
l1
,
code_pointer
l2
);
};
}
...
...
gframe/deck_con.cpp
View file @
818c283f
...
...
@@ -110,6 +110,7 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wCategories
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
mainGame
->
wCardImg
->
setVisible
(
false
);
mainGame
->
wInfos
->
setVisible
(
false
);
mainGame
->
PopupElement
(
mainGame
->
wMainMenu
);
...
...
@@ -322,6 +323,12 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
}
}
break
;
}
case
COMBOBOX_SORTTYPE
:
{
SortList
();
mainGame
->
env
->
setFocus
(
0
);
break
;
}
}
}
...
...
@@ -767,7 +774,7 @@ void DeckBuilder::FilterCards() {
mainGame
->
scrFilter
->
setVisible
(
false
);
mainGame
->
scrFilter
->
setPos
(
0
);
}
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_lv
);
SortList
(
);
}
void
DeckBuilder
::
ClearSearch
()
{
mainGame
->
cbCardType
->
setSelected
(
0
);
...
...
@@ -794,5 +801,21 @@ void DeckBuilder::ClearFilter() {
for
(
int
i
=
0
;
i
<
32
;
++
i
)
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
}
void
DeckBuilder
::
SortList
()
{
switch
(
mainGame
->
cbSortType
->
getSelected
())
{
case
0
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_lv
);
break
;
case
1
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_atk
);
break
;
case
2
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_def
);
break
;
case
3
:
std
::
sort
(
results
.
begin
(),
results
.
end
(),
ClientCard
::
deck_sort_name
);
break
;
}
}
}
gframe/deck_con.h
View file @
818c283f
...
...
@@ -14,6 +14,7 @@ public:
void
FilterCards
();
void
ClearFilter
();
void
ClearSearch
();
void
SortList
();
long
long
filter_effect
;
unsigned
int
filter_type
;
...
...
gframe/duelclient.cpp
View file @
818c283f
...
...
@@ -280,6 +280,7 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
wPhase
->
setVisible
(
false
);
mainGame
->
wDeckEdit
->
setVisible
(
false
);
mainGame
->
wFilter
->
setVisible
(
false
);
mainGame
->
wSort
->
setVisible
(
false
);
mainGame
->
btnSideOK
->
setVisible
(
true
);
if
(
mainGame
->
dInfo
.
player_type
<
7
)
mainGame
->
btnLeaveGame
->
setVisible
(
false
);
...
...
gframe/game.cpp
View file @
818c283f
...
...
@@ -461,6 +461,12 @@ bool Game::Initialize() {
scrFilter
->
setLargeStep
(
10
);
scrFilter
->
setSmallStep
(
1
);
scrFilter
->
setVisible
(
false
);
//sort type
wSort
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
930
,
132
,
1020
,
156
),
true
,
false
,
0
,
-
1
,
true
);
cbSortType
=
env
->
addComboBox
(
rect
<
s32
>
(
10
,
2
,
85
,
22
),
wSort
,
COMBOBOX_SORTTYPE
);
for
(
int
i
=
1370
;
i
<=
1373
;
i
++
)
cbSortType
->
addItem
(
dataManager
.
GetSysString
(
i
));
wSort
->
setVisible
(
false
);
//replay window
wReplay
=
env
->
addWindow
(
rect
<
s32
>
(
220
,
100
,
800
,
520
),
false
,
dataManager
.
GetSysString
(
1202
));
wReplay
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -970,8 +976,8 @@ void Game::ShowCardInfo(int code) {
myswprintf
(
formatBuffer
,
L"[%ls] %ls/%ls"
,
dataManager
.
FormatType
(
cd
.
type
),
dataManager
.
FormatRace
(
cd
.
race
),
dataManager
.
FormatAttribute
(
cd
.
attribute
));
stInfo
->
setText
(
formatBuffer
);
int
form
=
0x2605
;
if
(
cd
.
type
&
TYPE_XYZ
)
++
form
;
myswprintf
(
formatBuffer
,
L"[%c%d] "
,
form
,
cd
.
level
);
if
(
cd
.
type
&
TYPE_XYZ
)
++
form
;
myswprintf
(
formatBuffer
,
L"[%c%d] "
,
form
,
cd
.
level
);
wchar_t
adBuffer
[
16
];
if
(
cd
.
attack
<
0
&&
cd
.
defence
<
0
)
myswprintf
(
adBuffer
,
L"?/?"
);
...
...
gframe/game.h
View file @
818c283f
...
...
@@ -369,6 +369,9 @@ public:
irr
::
gui
::
IGUIWindow
*
wCategories
;
irr
::
gui
::
IGUICheckBox
*
chkCategory
[
32
];
irr
::
gui
::
IGUIButton
*
btnCategoryOK
;
//sort type
irr
::
gui
::
IGUIStaticText
*
wSort
;
irr
::
gui
::
IGUIComboBox
*
cbSortType
;
//replay save
irr
::
gui
::
IGUIWindow
*
wReplaySave
;
irr
::
gui
::
IGUIEditBox
*
ebRSName
;
...
...
@@ -505,4 +508,5 @@ extern Game* mainGame;
#define LISTBOX_SINGLEPLAY_LIST 350
#define BUTTON_LOAD_SINGLEPLAY 351
#define BUTTON_CANCEL_SINGLEPLAY 352
#define COMBOBOX_SORTTYPE 370
#endif // GAME_H
gframe/menu_handler.cpp
View file @
818c283f
...
...
@@ -220,6 +220,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
wCardImg
->
setVisible
(
true
);
mainGame
->
wDeckEdit
->
setVisible
(
true
);
mainGame
->
wFilter
->
setVisible
(
true
);
mainGame
->
wSort
->
setVisible
(
true
);
mainGame
->
btnSideOK
->
setVisible
(
false
);
mainGame
->
deckBuilder
.
filterList
=
deckManager
.
_lfList
[
0
].
content
;
mainGame
->
cbDBLFList
->
setSelected
(
0
);
...
...
ocgcore
@
7059fdae
Subproject commit
60b891ab59cb34d31a584f7a9de98a78c7af4afb
Subproject commit
7059fdaede394163a2f718ce6a50bafb151fe5f4
script
@
9f3a2f36
Subproject commit
40925d41110b1b3674bd43f7a308ae2aa2ba4e0e
Subproject commit
9f3a2f3659f31bcb50c188a2e92107980531af75
strings.conf
View file @
818c283f
...
...
@@ -331,6 +331,10 @@
!
system
1353
播放起始于回合:
!
system
1354
不显示卡片系列
!
system
1360
上一步
!
system
1370
星数↑
!
system
1371
攻击↑
!
system
1372
守备↑
!
system
1373
名称↓
!
system
1390
等待行动中...
!
system
1391
等待行动中....
!
system
1392
等待行动中.....
...
...
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