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
REIKAI
ygopro
Commits
ab78e5ea
Commit
ab78e5ea
authored
Apr 22, 2019
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implyment buttons
parent
4c5de5d4
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
415 additions
and
9 deletions
+415
-9
gframe/deck_con.cpp
gframe/deck_con.cpp
+334
-3
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+27
-0
gframe/deck_manager.h
gframe/deck_manager.h
+4
-1
gframe/game.cpp
gframe/game.cpp
+21
-3
gframe/game.h
gframe/game.h
+4
-2
gframe/myfilesystem.h
gframe/myfilesystem.h
+25
-0
No files found.
gframe/deck_con.cpp
View file @
ab78e5ea
This diff is collapsed.
Click to expand it.
gframe/deck_manager.cpp
View file @
ab78e5ea
...
...
@@ -293,4 +293,31 @@ bool DeckManager::DeleteDeck(const wchar_t* file) {
return
result
==
0
;
#endif
}
bool
DeckManager
::
CreateCategory
(
const
wchar_t
*
name
)
{
if
(
!
FileSystem
::
IsDirExists
(
L"./deck"
)
&&
!
FileSystem
::
MakeDir
(
L"./deck"
))
return
false
;
if
(
name
[
0
]
==
0
)
return
false
;
wchar_t
localname
[
256
];
myswprintf
(
localname
,
L"./deck/%ls"
,
name
);
return
FileSystem
::
MakeDir
(
localname
);
}
bool
DeckManager
::
RenameCategory
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
)
{
if
(
!
FileSystem
::
IsDirExists
(
L"./deck"
)
&&
!
FileSystem
::
MakeDir
(
L"./deck"
))
return
false
;
if
(
newname
[
0
]
==
0
)
return
false
;
wchar_t
oldlocalname
[
256
];
wchar_t
newlocalname
[
256
];
myswprintf
(
oldlocalname
,
L"./deck/%ls"
,
oldname
);
myswprintf
(
newlocalname
,
L"./deck/%ls"
,
newname
);
return
FileSystem
::
Rename
(
oldlocalname
,
newlocalname
);
}
bool
DeckManager
::
DeleteCategory
(
const
wchar_t
*
name
)
{
wchar_t
localname
[
256
];
myswprintf
(
localname
,
L"./deck/%ls"
,
name
);
if
(
!
FileSystem
::
IsDirExists
(
localname
))
return
false
;
return
FileSystem
::
DeleteDir
(
localname
);
}
}
gframe/deck_manager.h
View file @
ab78e5ea
...
...
@@ -47,7 +47,10 @@ public:
FILE
*
OpenDeckFile
(
const
wchar_t
*
file
,
const
char
*
mode
);
bool
LoadDeck
(
const
wchar_t
*
file
);
bool
SaveDeck
(
Deck
&
deck
,
const
wchar_t
*
file
);
bool
DeleteDeck
(
const
wchar_t
*
file
);
bool
DeleteDeck
(
const
wchar_t
*
file
);
bool
CreateCategory
(
const
wchar_t
*
name
);
bool
RenameCategory
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
bool
DeleteCategory
(
const
wchar_t
*
name
);
};
extern
DeckManager
deckManager
;
...
...
gframe/game.cpp
View file @
ab78e5ea
...
...
@@ -498,10 +498,11 @@ bool Game::Initialize() {
wDeckEdit
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
309
,
5
,
605
,
130
),
true
,
false
,
0
,
-
1
,
true
);
wDeckEdit
->
setVisible
(
false
);
btnManageDeck
=
env
->
addButton
(
rect
<
s32
>
(
225
,
5
,
290
,
30
),
wDeckEdit
,
BUTTON_MANAGE_DECK
,
L"管理"
);
wDeckManage
=
env
->
addWindow
(
rect
<
s32
>
(
310
,
135
,
800
,
465
),
false
,
L"管理卡组"
,
0
,
WINDOW_DECK_MANAGE
);
//deck manage
wDeckManage
=
env
->
addWindow
(
rect
<
s32
>
(
310
,
135
,
800
,
465
),
false
,
L"卡组管理"
,
0
,
WINDOW_DECK_MANAGE
);
wDeckManage
->
setVisible
(
false
);
lstCategories
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
30
,
1
7
0
,
320
),
wDeckManage
,
LISTBOX_CATEGORIES
,
true
);
lstDecks
=
env
->
addListBox
(
rect
<
s32
>
(
1
8
0
,
30
,
340
,
320
),
wDeckManage
,
LISTBOX_DECKS
,
true
);
lstCategories
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
30
,
1
4
0
,
320
),
wDeckManage
,
LISTBOX_CATEGORIES
,
true
);
lstDecks
=
env
->
addListBox
(
rect
<
s32
>
(
1
5
0
,
30
,
340
,
320
),
wDeckManage
,
LISTBOX_DECKS
,
true
);
posY
=
30
;
btnNewCategory
=
env
->
addButton
(
rect
<
s32
>
(
350
,
posY
,
480
,
posY
+
25
),
wDeckManage
,
BUTTON_NEW_CATEGORY
,
L"新建分类"
);
posY
+=
30
;
...
...
@@ -523,6 +524,22 @@ bool Game::Initialize() {
cbLFList
->
setMaxSelectionRows
(
10
);
for
(
unsigned
int
i
=
0
;
i
<
deckManager
.
_lfList
.
size
();
++
i
)
cbLFList
->
addItem
(
deckManager
.
_lfList
[
i
].
listName
);
//deck manage query
wDMQuery
=
env
->
addWindow
(
rect
<
s32
>
(
400
,
200
,
710
,
320
),
false
,
L"卡组管理"
);
wDMQuery
->
getCloseButton
()
->
setVisible
(
false
);
wDMQuery
->
setVisible
(
false
);
stDMMessage
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
20
,
25
,
290
,
45
),
false
,
false
,
wDMQuery
);
stDMMessage2
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
20
,
50
,
290
,
70
),
false
,
false
,
wDMQuery
,
-
1
,
true
);
stDMMessage2
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
ebDMName
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
20
,
50
,
290
,
70
),
true
,
wDMQuery
,
-
1
);
ebDMName
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
cbDMCategory
=
env
->
addComboBox
(
rect
<
s32
>
(
20
,
50
,
290
,
70
),
wDMQuery
,
-
1
);
stDMMessage2
->
setVisible
(
false
);
ebDMName
->
setVisible
(
false
);
cbDMCategory
->
setVisible
(
false
);
cbDMCategory
->
setMaxSelectionRows
(
10
);
btnDMOK
=
env
->
addButton
(
rect
<
s32
>
(
70
,
80
,
140
,
105
),
wDMQuery
,
BUTTON_DM_OK
,
dataManager
.
GetSysString
(
1211
));
btnDMCancel
=
env
->
addButton
(
rect
<
s32
>
(
170
,
80
,
240
,
105
),
wDMQuery
,
BUTTON_DM_CANCEL
,
dataManager
.
GetSysString
(
1212
));
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
);
...
...
@@ -1659,6 +1676,7 @@ void Game::OnResize() {
wANAttribute
->
setRelativePosition
(
ResizeWin
(
500
,
200
,
830
,
285
));
wANRace
->
setRelativePosition
(
ResizeWin
(
480
,
200
,
850
,
410
));
wReplaySave
->
setRelativePosition
(
ResizeWin
(
510
,
200
,
820
,
320
));
wDMQuery
->
setRelativePosition
(
ResizeWin
(
400
,
200
,
710
,
320
));
stHintMsg
->
setRelativePosition
(
ResizeWin
(
660
-
160
*
xScale
,
60
,
660
+
160
*
xScale
,
90
));
...
...
gframe/game.h
View file @
ab78e5ea
...
...
@@ -492,10 +492,12 @@ public:
irr
::
gui
::
IGUIButton
*
btnMoveDeck
;
irr
::
gui
::
IGUIButton
*
btnCopyDeck
;
irr
::
gui
::
IGUIWindow
*
wDMQuery
;
irr
::
gui
::
IGUIStaticText
*
stDMMessage
;
irr
::
gui
::
IGUIStaticText
*
stDMMessage2
;
irr
::
gui
::
IGUIEditBox
*
ebDMName
;
irr
::
gui
::
IGUIComboBox
*
cbDMCategory
;
irr
::
gui
::
IGUIButton
*
btnDM
Yes
;
irr
::
gui
::
IGUIButton
*
btnDM
No
;
irr
::
gui
::
IGUIButton
*
btnDM
OK
;
irr
::
gui
::
IGUIButton
*
btnDM
Cancel
;
irr
::
gui
::
IGUIComboBox
*
cbLFList
;
//filter
irr
::
gui
::
IGUIStaticText
*
wFilter
;
...
...
gframe/myfilesystem.h
View file @
ab78e5ea
...
...
@@ -50,6 +50,31 @@ public:
return
MakeDir
(
wdir
);
}
static
bool
Rename
(
const
wchar_t
*
woldname
,
const
wchar_t
*
wnewname
)
{
return
MoveFileW
(
woldname
,
wnewname
);
}
static
bool
Rename
(
const
char
*
oldname
,
const
char
*
newname
)
{
wchar_t
woldname
[
1024
];
wchar_t
wnewname
[
1024
];
BufferIO
::
DecodeUTF8
(
oldname
,
woldname
);
BufferIO
::
DecodeUTF8
(
newname
,
wnewname
);
return
Rename
(
woldname
,
wnewname
);
}
static
bool
DeleteDir
(
const
wchar_t
*
wdir
)
{
wchar_t
pdir
[
256
];
BufferIO
::
CopyWStr
(
wdir
,
pdir
,
256
);
pdir
[
wcslen
(
wdir
)
+
1
]
=
0
;
SHFILEOPSTRUCTW
lpFileOp
;
lpFileOp
.
hwnd
=
NULL
;
lpFileOp
.
wFunc
=
FO_DELETE
;
lpFileOp
.
pFrom
=
pdir
;
lpFileOp
.
pTo
=
0
;
lpFileOp
.
fFlags
=
FOF_ALLOWUNDO
|
FOF_NOCONFIRMATION
|
FOF_NOERRORUI
|
FOF_SILENT
;
return
SHFileOperationW
(
&
lpFileOp
)
==
0
;
}
static
void
TraversalDir
(
const
wchar_t
*
wpath
,
const
std
::
function
<
void
(
const
wchar_t
*
,
bool
)
>&
cb
)
{
wchar_t
findstr
[
1024
];
wcscpy
(
findstr
,
wpath
);
...
...
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