Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
38e38c8c
Commit
38e38c8c
authored
Jan 21, 2012
by
argon.sun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recon
parent
1bcbcdfe
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
117 additions
and
82 deletions
+117
-82
gframe/duelclient.cpp
gframe/duelclient.cpp
+3
-0
gframe/game.cpp
gframe/game.cpp
+16
-7
gframe/game.h
gframe/game.h
+7
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+26
-73
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+29
-0
gframe/replay_mode.h
gframe/replay_mode.h
+33
-0
strings.conf
strings.conf
+2
-0
system.conf
system.conf
+1
-1
No files found.
gframe/duelclient.cpp
View file @
38e38c8c
...
@@ -320,6 +320,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
...
@@ -320,6 +320,9 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
CloseDuelWindow
();
mainGame
->
CloseDuelWindow
();
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
event_base_loopbreak
(
client_base
);
event_base_loopbreak
(
client_base
);
...
...
gframe/game.cpp
View file @
38e38c8c
...
@@ -404,6 +404,15 @@ bool Game::Initialize() {
...
@@ -404,6 +404,15 @@ bool Game::Initialize() {
scrFilter
->
setLargeStep
(
10
);
scrFilter
->
setLargeStep
(
10
);
scrFilter
->
setSmallStep
(
1
);
scrFilter
->
setSmallStep
(
1
);
scrFilter
->
setVisible
(
false
);
scrFilter
->
setVisible
(
false
);
//replay window
wReplay
=
env
->
addWindow
(
rect
<
s32
>
(
220
,
100
,
800
,
520
),
false
,
dataManager
.
GetSysString
(
1200
));
wReplay
->
getCloseButton
()
->
setVisible
(
false
);
wReplay
->
setVisible
(
false
);
lstReplayList
=
env
->
addListBox
(
rect
<
s32
>
(
10
,
30
,
400
,
350
),
wReplay
,
LISTBOX_REPLAY_LIST
,
true
);
lstReplayList
->
setItemHeight
(
18
);
btnLoadReplay
=
env
->
addButton
(
rect
<
s32
>
(
460
,
355
,
570
,
380
),
wReplay
,
BUTTON_LOAD_REPLAY
,
dataManager
.
GetSysString
(
1348
));
btnReplayCancel
=
env
->
addButton
(
rect
<
s32
>
(
460
,
385
,
570
,
410
),
wReplay
,
BUTTON_CANCEL_REPLAY
,
dataManager
.
GetSysString
(
1347
));
stReplayInfo
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
410
,
30
,
570
,
350
),
false
,
true
,
wReplay
);
//replay save
//replay save
wReplaySave
=
env
->
addWindow
(
rect
<
s32
>
(
510
,
200
,
820
,
320
),
false
,
dataManager
.
GetSysString
(
1340
));
wReplaySave
=
env
->
addWindow
(
rect
<
s32
>
(
510
,
200
,
820
,
320
),
false
,
dataManager
.
GetSysString
(
1340
));
wReplaySave
->
getCloseButton
()
->
setVisible
(
false
);
wReplaySave
->
getCloseButton
()
->
setVisible
(
false
);
...
@@ -414,13 +423,13 @@ bool Game::Initialize() {
...
@@ -414,13 +423,13 @@ bool Game::Initialize() {
btnRSYes
=
env
->
addButton
(
rect
<
s32
>
(
70
,
80
,
140
,
105
),
wReplaySave
,
BUTTON_REPLAY_SAVE
,
dataManager
.
GetSysString
(
1341
));
btnRSYes
=
env
->
addButton
(
rect
<
s32
>
(
70
,
80
,
140
,
105
),
wReplaySave
,
BUTTON_REPLAY_SAVE
,
dataManager
.
GetSysString
(
1341
));
btnRSNo
=
env
->
addButton
(
rect
<
s32
>
(
170
,
80
,
240
,
105
),
wReplaySave
,
BUTTON_REPLAY_CANCEL
,
dataManager
.
GetSysString
(
1212
));
btnRSNo
=
env
->
addButton
(
rect
<
s32
>
(
170
,
80
,
240
,
105
),
wReplaySave
,
BUTTON_REPLAY_CANCEL
,
dataManager
.
GetSysString
(
1212
));
//replay control
//replay control
wReplay
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
205
,
143
,
295
,
273
),
true
,
false
,
0
,
-
1
,
true
);
wReplay
Control
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
205
,
143
,
295
,
273
),
true
,
false
,
0
,
-
1
,
true
);
wReplay
->
setVisible
(
false
);
wReplay
Control
->
setVisible
(
false
);
btnReplayStart
=
env
->
addButton
(
rect
<
s32
>
(
5
,
5
,
85
,
25
),
wReplay
,
BUTTON_REPLAY_START
,
dataManager
.
GetSysString
(
1343
));
btnReplayStart
=
env
->
addButton
(
rect
<
s32
>
(
5
,
5
,
85
,
25
),
wReplay
Control
,
BUTTON_REPLAY_START
,
dataManager
.
GetSysString
(
1343
));
btnReplayPause
=
env
->
addButton
(
rect
<
s32
>
(
5
,
30
,
85
,
50
),
wReplay
,
BUTTON_REPLAY_PAUSE
,
dataManager
.
GetSysString
(
1344
));
btnReplayPause
=
env
->
addButton
(
rect
<
s32
>
(
5
,
30
,
85
,
50
),
wReplay
Control
,
BUTTON_REPLAY_PAUSE
,
dataManager
.
GetSysString
(
1344
));
btnReplayStep
=
env
->
addButton
(
rect
<
s32
>
(
5
,
55
,
85
,
75
),
wReplay
,
BUTTON_REPLAY_STEP
,
dataManager
.
GetSysString
(
1345
));
btnReplayStep
=
env
->
addButton
(
rect
<
s32
>
(
5
,
55
,
85
,
75
),
wReplay
Control
,
BUTTON_REPLAY_STEP
,
dataManager
.
GetSysString
(
1345
));
btnReplaySwap
=
env
->
addButton
(
rect
<
s32
>
(
5
,
80
,
85
,
100
),
wReplay
,
BUTTON_REPLAY_SWAP
,
dataManager
.
GetSysString
(
1346
));
btnReplaySwap
=
env
->
addButton
(
rect
<
s32
>
(
5
,
80
,
85
,
100
),
wReplay
Control
,
BUTTON_REPLAY_SWAP
,
dataManager
.
GetSysString
(
1346
));
btnReplayExit
=
env
->
addButton
(
rect
<
s32
>
(
5
,
105
,
85
,
125
),
wReplay
,
BUTTON_REPLAY_EXIT
,
dataManager
.
GetSysString
(
1347
));
btnReplayExit
=
env
->
addButton
(
rect
<
s32
>
(
5
,
105
,
85
,
125
),
wReplay
Control
,
BUTTON_REPLAY_EXIT
,
dataManager
.
GetSysString
(
1347
));
device
->
setEventReceiver
(
&
menuHandler
);
device
->
setEventReceiver
(
&
menuHandler
);
LoadConfig
();
LoadConfig
();
env
->
getSkin
()
->
setFont
(
guiFont
);
env
->
getSkin
()
->
setFont
(
guiFont
);
...
...
gframe/game.h
View file @
38e38c8c
...
@@ -203,8 +203,11 @@ public:
...
@@ -203,8 +203,11 @@ public:
irr
::
gui
::
IGUIButton
*
btnHostSingleStart
;
irr
::
gui
::
IGUIButton
*
btnHostSingleStart
;
irr
::
gui
::
IGUIButton
*
btnHostSingleCancel
;
irr
::
gui
::
IGUIButton
*
btnHostSingleCancel
;
//replay
//replay
irr
::
gui
::
IGUIWindow
*
wReplay
;
irr
::
gui
::
IGUIListBox
*
lstReplayList
;
irr
::
gui
::
IGUIListBox
*
lstReplayList
;
irr
::
gui
::
IGUIStaticText
*
stReplayInfo
;
irr
::
gui
::
IGUIButton
*
btnLoadReplay
;
irr
::
gui
::
IGUIButton
*
btnLoadReplay
;
irr
::
gui
::
IGUIButton
*
btnReplayCancel
;
//hand
//hand
irr
::
gui
::
IGUIWindow
*
wHand
;
irr
::
gui
::
IGUIWindow
*
wHand
;
irr
::
gui
::
IGUIButton
*
btnHand
[
3
];
irr
::
gui
::
IGUIButton
*
btnHand
[
3
];
...
@@ -309,7 +312,7 @@ public:
...
@@ -309,7 +312,7 @@ public:
irr
::
gui
::
IGUIButton
*
btnRSYes
;
irr
::
gui
::
IGUIButton
*
btnRSYes
;
irr
::
gui
::
IGUIButton
*
btnRSNo
;
irr
::
gui
::
IGUIButton
*
btnRSNo
;
//replay control
//replay control
irr
::
gui
::
IGUIStaticText
*
wReplay
;
irr
::
gui
::
IGUIStaticText
*
wReplay
Control
;
irr
::
gui
::
IGUIButton
*
btnReplayStart
;
irr
::
gui
::
IGUIButton
*
btnReplayStart
;
irr
::
gui
::
IGUIButton
*
btnReplayPause
;
irr
::
gui
::
IGUIButton
*
btnReplayPause
;
irr
::
gui
::
IGUIButton
*
btnReplayStep
;
irr
::
gui
::
IGUIButton
*
btnReplayStep
;
...
@@ -352,6 +355,9 @@ extern Game* mainGame;
...
@@ -352,6 +355,9 @@ extern Game* mainGame;
#define BUTTON_HS_CANCEL 123
#define BUTTON_HS_CANCEL 123
#define BUTTON_HS_KICK 124
#define BUTTON_HS_KICK 124
#define CHECKBOX_HS_READY 125
#define CHECKBOX_HS_READY 125
#define LISTBOX_REPLAY_LIST 130
#define BUTTON_LOAD_REPLAY 131
#define BUTTON_CANCEL_REPLAY 132
#define BUTTON_MSG_OK 200
#define BUTTON_MSG_OK 200
#define BUTTON_YES 201
#define BUTTON_YES 201
#define BUTTON_NO 202
#define BUTTON_NO 202
...
...
gframe/menu_handler.cpp
View file @
38e38c8c
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
#include "netserver.h"
#include "netserver.h"
#include "duelclient.h"
#include "duelclient.h"
#include "deck_manager.h"
#include "deck_manager.h"
#include "replay_mode.h"
#include "game.h"
#include "game.h"
namespace
ygo
{
namespace
ygo
{
...
@@ -106,6 +107,22 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -106,6 +107,22 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
HideElement
(
mainGame
->
wHostSingle
,
false
,
mainGame
->
wLanWindow
);
mainGame
->
HideElement
(
mainGame
->
wHostSingle
,
false
,
mainGame
->
wLanWindow
);
break
;
break
;
}
}
case
BUTTON_REPLAY_MODE
:
{
mainGame
->
HideElement
(
mainGame
->
wMainMenu
,
false
,
mainGame
->
wReplay
);
break
;
}
case
BUTTON_LOAD_REPLAY
:
{
if
(
mainGame
->
lstReplayList
->
getSelected
()
==
-
1
)
break
;
if
(
!
replayMode
.
cur_replay
.
OpenReplay
(
mainGame
->
lstReplayList
->
getListItem
(
mainGame
->
lstReplayList
->
getSelected
())))
break
;
replayMode
.
StartReplay
();
break
;
}
case
BUTTON_CANCEL_REPLAY
:
{
mainGame
->
HideElement
(
mainGame
->
wReplay
,
false
,
mainGame
->
wMainMenu
);
break
;
}
case
BUTTON_DECK_EDIT
:
{
case
BUTTON_DECK_EDIT
:
{
mainGame
->
RefreshDeck
(
mainGame
->
cbDBDecks
);
mainGame
->
RefreshDeck
(
mainGame
->
cbDBDecks
);
if
(
mainGame
->
cbDBDecks
->
getSelected
()
!=
-
1
)
if
(
mainGame
->
cbDBDecks
->
getSelected
()
!=
-
1
)
...
@@ -141,81 +158,17 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -141,81 +158,17 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
break
;
break
;
}
}
/* case BUTTON_LAN_START_SERVER: {
if(mainGame->cbDeckSel->getSelected() == -1)
break;
if(!deckManager.LoadDeck(mainGame->cbDeckSel->getItem(mainGame->cbDeckSel->getSelected()))) {
mainGame->stModeStatus->setText(L"无效卡组");
break;
}
if(!mainGame->chkNoCheckDeck->isChecked()
&& !deckManager.CheckLFList(deckManager.deckhost, mainGame->cbLFlist->getSelected())) {
mainGame->stModeStatus->setText(L"无效卡组或者卡组不符合禁卡表规范");
break;
}
if(_wtoi(mainGame->ebStartLP->getText()) == 0)
mainGame->ebStartLP->setText(L"8000");
if(_wtoi(mainGame->ebStartHand->getText()) == 0)
mainGame->ebStartLP->setText(L"5");
if(_wtoi(mainGame->ebDrawCount->getText()) == 0)
mainGame->ebStartLP->setText(L"1");
if(mainGame->netManager.CreateHost(mainGame->cbIPList->getSelected())) {
mainGame->btnLanStartServer->setEnabled(false);
mainGame->btnLanCancelServer->setEnabled(true);
mainGame->btnLanConnect->setEnabled(false);
mainGame->btnRefreshList->setEnabled(false);
mainGame->btnLoadReplay->setEnabled(false);
mainGame->btnDeckEdit->setEnabled(false);
mainGame->stModeStatus->setText(L"等待连接...");
}
}
break
;
break
;
}
}
case BUTTON_LAN_CANCEL_SERVER: {
case
irr
:
:
gui
::
EGET_LISTBOX_CHANGED
:
{
mainGame->netManager.CancelHost();
switch
(
id
)
{
mainGame->stModeStatus->setText(L"");
case
LISTBOX_REPLAY_LIST
:
{
break;
}
case BUTTON_LAN_REFRESH: {
if(mainGame->netManager.RefreshHost(mainGame->cbIPList->getSelected())) {
mainGame->btnLanStartServer->setEnabled(false);
mainGame->btnLanConnect->setEnabled(false);
mainGame->btnRefreshList->setEnabled(false);
mainGame->btnLoadReplay->setEnabled(false);
mainGame->btnDeckEdit->setEnabled(false);
}
break;
}
case BUTTON_LAN_CONNECT: {
if(mainGame->cbDeckSel->getSelected() == -1)
break;
if(!deckManager.LoadDeck(mainGame->cbDeckSel->getItem(mainGame->cbDeckSel->getSelected()))) {
mainGame->stModeStatus->setText(L"无效卡组");
break;
}
if(mainGame->netManager.JoinHost()) {
mainGame->btnLanStartServer->setEnabled(false);
mainGame->btnLanConnect->setEnabled(false);
mainGame->btnRefreshList->setEnabled(false);
mainGame->btnLoadReplay->setEnabled(false);
mainGame->btnDeckEdit->setEnabled(false);
mainGame->stModeStatus->setText(L"连接中...");
}
break
;
break
;
}
}
case BUTTON_LOAD_REPLAY: {
if(mainGame->lstReplayList->getSelected() == -1)
break;
if(!mainGame->lastReplay.OpenReplay(mainGame->lstReplayList->getListItem(mainGame->lstReplayList->getSelected()))) {
mainGame->stModeStatus->setText(L"录像损坏或丢失,无法播放");
break;
}
}
mainGame->stModeStatus->setText(L"");
Thread::NewThread(Game::ReplayThread, &mainGame->dInfo);
break
;
break
;
}
}
*/
}
}
case
irr
:
:
gui
::
EGET_CHECKBOX_CHANGED
:
{
case
irr
:
:
gui
::
EGET_CHECKBOX_CHANGED
:
{
switch
(
id
)
{
switch
(
id
)
{
case
CHECKBOX_HS_READY
:
{
case
CHECKBOX_HS_READY
:
{
...
...
gframe/replay_mode.cpp
0 → 100644
View file @
38e38c8c
#include "replay_mode.h"
namespace
ygo
{
Replay
ReplayMode
::
cur_replay
;
bool
ReplayMode
::
is_closing
;
wchar_t
ReplayMode
::
event_string
[
256
];
ReplayMode
replayMode
;
bool
ReplayMode
::
StartReplay
()
{
return
false
;
}
void
ReplayMode
::
StopReplay
(
bool
is_exiting
)
{
}
int
ReplayMode
::
ReplayThread
(
void
*
param
)
{
return
0
;
}
int
ReplayMode
::
ReplayAnalyze
(
char
*
msg
,
unsigned
int
len
)
{
return
0
;
}
void
ReplayMode
::
SetResponseI
(
int
respI
)
{
}
void
ReplayMode
::
SetResponseB
(
unsigned
char
*
respB
,
unsigned
char
len
)
{
}
}
gframe/replay_mode.h
0 → 100644
View file @
38e38c8c
#ifndef REPLAY_MODE_H
#define REPLAY_MODE_H
#include "config.h"
#include "data_manager.h"
#include "deck_manager.h"
#include "replay.h"
#include "../ocgcore/mtrandom.h"
namespace
ygo
{
class
ReplayMode
{
private:
static
bool
is_closing
;
static
wchar_t
event_string
[
256
];
public:
static
Replay
cur_replay
;
public:
static
bool
StartReplay
();
static
void
StopReplay
(
bool
is_exiting
=
false
);
static
int
ReplayThread
(
void
*
param
);
static
int
ReplayAnalyze
(
char
*
msg
,
unsigned
int
len
);
static
void
SetResponseI
(
int
respI
);
static
void
SetResponseB
(
unsigned
char
*
respB
,
unsigned
char
len
);
};
extern
ReplayMode
replayMode
;
}
#endif //REPLAY_MODE_H
strings.conf
View file @
38e38c8c
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
!
system
1004
墓地
!
system
1004
墓地
!
system
1005
除外
!
system
1005
除外
!
system
1006
额外
!
system
1006
额外
!
system
1007
叠放
!
system
1010
地
!
system
1010
地
!
system
1011
水
!
system
1011
水
!
system
1012
炎
!
system
1012
炎
...
@@ -269,6 +270,7 @@
...
@@ -269,6 +270,7 @@
!
system
1345
下一步
!
system
1345
下一步
!
system
1346
切换视角
!
system
1346
切换视角
!
system
1347
退出
!
system
1347
退出
!
system
1348
载入录像
!
system
1350
等待对方行动中...
!
system
1350
等待对方行动中...
!
system
1351
等待对方行动中....
!
system
1351
等待对方行动中....
!
system
1352
等待对方行动中.....
!
system
1352
等待对方行动中.....
...
...
system.conf
View file @
38e38c8c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
antialias
=
2
antialias
=
2
nickname
=
Player
nickname
=
Player
gamename
=
Game
gamename
=
Game
lastdeck
=
infernity
lastdeck
=
chaosls
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
serverport
=
7911
serverport
=
7911
...
...
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