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
MobiusMei
ygopro
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
Hide 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) {
mainGame
->
CloseDuelWindow
();
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
btnCreateHost
->
setEnabled
(
true
);
mainGame
->
btnJoinHost
->
setEnabled
(
true
);
mainGame
->
btnJoinCancel
->
setEnabled
(
true
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
ShowElement
(
mainGame
->
wLanWindow
);
event_base_loopbreak
(
client_base
);
...
...
gframe/game.cpp
View file @
38e38c8c
...
...
@@ -404,6 +404,15 @@ bool Game::Initialize() {
scrFilter
->
setLargeStep
(
10
);
scrFilter
->
setSmallStep
(
1
);
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
wReplaySave
=
env
->
addWindow
(
rect
<
s32
>
(
510
,
200
,
820
,
320
),
false
,
dataManager
.
GetSysString
(
1340
));
wReplaySave
->
getCloseButton
()
->
setVisible
(
false
);
...
...
@@ -414,13 +423,13 @@ bool Game::Initialize() {
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
));
//replay control
wReplay
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
205
,
143
,
295
,
273
),
true
,
false
,
0
,
-
1
,
true
);
wReplay
->
setVisible
(
false
);
btnReplayStart
=
env
->
addButton
(
rect
<
s32
>
(
5
,
5
,
85
,
25
),
wReplay
,
BUTTON_REPLAY_START
,
dataManager
.
GetSysString
(
1343
));
btnReplayPause
=
env
->
addButton
(
rect
<
s32
>
(
5
,
30
,
85
,
50
),
wReplay
,
BUTTON_REPLAY_PAUSE
,
dataManager
.
GetSysString
(
1344
));
btnReplayStep
=
env
->
addButton
(
rect
<
s32
>
(
5
,
55
,
85
,
75
),
wReplay
,
BUTTON_REPLAY_STEP
,
dataManager
.
GetSysString
(
1345
));
btnReplaySwap
=
env
->
addButton
(
rect
<
s32
>
(
5
,
80
,
85
,
100
),
wReplay
,
BUTTON_REPLAY_SWAP
,
dataManager
.
GetSysString
(
1346
));
btnReplayExit
=
env
->
addButton
(
rect
<
s32
>
(
5
,
105
,
85
,
125
),
wReplay
,
BUTTON_REPLAY_EXIT
,
dataManager
.
GetSysString
(
1347
));
wReplay
Control
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
205
,
143
,
295
,
273
),
true
,
false
,
0
,
-
1
,
true
);
wReplay
Control
->
setVisible
(
false
);
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
Control
,
BUTTON_REPLAY_PAUSE
,
dataManager
.
GetSysString
(
1344
));
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
Control
,
BUTTON_REPLAY_SWAP
,
dataManager
.
GetSysString
(
1346
));
btnReplayExit
=
env
->
addButton
(
rect
<
s32
>
(
5
,
105
,
85
,
125
),
wReplay
Control
,
BUTTON_REPLAY_EXIT
,
dataManager
.
GetSysString
(
1347
));
device
->
setEventReceiver
(
&
menuHandler
);
LoadConfig
();
env
->
getSkin
()
->
setFont
(
guiFont
);
...
...
gframe/game.h
View file @
38e38c8c
...
...
@@ -203,8 +203,11 @@ public:
irr
::
gui
::
IGUIButton
*
btnHostSingleStart
;
irr
::
gui
::
IGUIButton
*
btnHostSingleCancel
;
//replay
irr
::
gui
::
IGUIWindow
*
wReplay
;
irr
::
gui
::
IGUIListBox
*
lstReplayList
;
irr
::
gui
::
IGUIStaticText
*
stReplayInfo
;
irr
::
gui
::
IGUIButton
*
btnLoadReplay
;
irr
::
gui
::
IGUIButton
*
btnReplayCancel
;
//hand
irr
::
gui
::
IGUIWindow
*
wHand
;
irr
::
gui
::
IGUIButton
*
btnHand
[
3
];
...
...
@@ -309,7 +312,7 @@ public:
irr
::
gui
::
IGUIButton
*
btnRSYes
;
irr
::
gui
::
IGUIButton
*
btnRSNo
;
//replay control
irr
::
gui
::
IGUIStaticText
*
wReplay
;
irr
::
gui
::
IGUIStaticText
*
wReplay
Control
;
irr
::
gui
::
IGUIButton
*
btnReplayStart
;
irr
::
gui
::
IGUIButton
*
btnReplayPause
;
irr
::
gui
::
IGUIButton
*
btnReplayStep
;
...
...
@@ -352,6 +355,9 @@ extern Game* mainGame;
#define BUTTON_HS_CANCEL 123
#define BUTTON_HS_KICK 124
#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_YES 201
#define BUTTON_NO 202
...
...
gframe/menu_handler.cpp
View file @
38e38c8c
...
...
@@ -3,6 +3,7 @@
#include "netserver.h"
#include "duelclient.h"
#include "deck_manager.h"
#include "replay_mode.h"
#include "game.h"
namespace
ygo
{
...
...
@@ -106,6 +107,22 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
HideElement
(
mainGame
->
wHostSingle
,
false
,
mainGame
->
wLanWindow
);
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
:
{
mainGame
->
RefreshDeck
(
mainGame
->
cbDBDecks
);
if
(
mainGame
->
cbDBDecks
->
getSelected
()
!=
-
1
)
...
...
@@ -141,80 +158,16 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
mainGame
->
chkCategory
[
i
]
->
setChecked
(
false
);
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;
}
case BUTTON_LAN_CANCEL_SERVER: {
mainGame->netManager.CancelHost();
mainGame->stModeStatus->setText(L"");
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;
}
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_LISTBOX_CHANGED
:
{
switch
(
id
)
{
case
LISTBOX_REPLAY_LIST
:
{
break
;
}
}
break
;
}
case
irr
:
:
gui
::
EGET_CHECKBOX_CHANGED
:
{
switch
(
id
)
{
...
...
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 @@
!
system
1004
墓地
!
system
1005
除外
!
system
1006
额外
!
system
1007
叠放
!
system
1010
地
!
system
1011
水
!
system
1012
炎
...
...
@@ -269,6 +270,7 @@
!
system
1345
下一步
!
system
1346
切换视角
!
system
1347
退出
!
system
1348
载入录像
!
system
1350
等待对方行动中...
!
system
1351
等待对方行动中....
!
system
1352
等待对方行动中.....
...
...
system.conf
View file @
38e38c8c
...
...
@@ -3,7 +3,7 @@
antialias
=
2
nickname
=
Player
gamename
=
Game
lastdeck
=
infernity
lastdeck
=
chaosls
textfont
=
c
:/
windows
/
fonts
/
simsun
.
ttc
numfont
=
c
:/
windows
/
fonts
/
arialbd
.
ttf
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