Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
fallenstardust
YGOMobile
Commits
a6b96c02
Commit
a6b96c02
authored
May 06, 2018
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
额外禁卡表&聊天消息同步
parent
2514e293
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
58 deletions
+55
-58
Classes/gframe/deck_con.cpp
Classes/gframe/deck_con.cpp
+2
-1
Classes/gframe/deck_manager.cpp
Classes/gframe/deck_manager.cpp
+36
-0
Classes/gframe/drawing.cpp
Classes/gframe/drawing.cpp
+3
-2
Classes/gframe/event_handler.cpp
Classes/gframe/event_handler.cpp
+14
-12
Classes/gframe/menu_handler.cpp
Classes/gframe/menu_handler.cpp
+0
-43
No files found.
Classes/gframe/deck_con.cpp
View file @
a6b96c02
...
@@ -391,7 +391,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
...
@@ -391,7 +391,8 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
break
;
break
;
}
}
int
sel
=
mainGame
->
cbDBDecks
->
getSelected
();
int
sel
=
mainGame
->
cbDBDecks
->
getSelected
();
deckManager
.
LoadDeck
(
mainGame
->
cbDBDecks
->
getItem
(
sel
));
if
(
sel
>=
0
)
deckManager
.
LoadDeck
(
mainGame
->
cbDBDecks
->
getItem
(
sel
));
prev_deck
=
sel
;
prev_deck
=
sel
;
is_modified
=
false
;
is_modified
=
false
;
break
;
break
;
...
...
Classes/gframe/deck_manager.cpp
View file @
a6b96c02
...
@@ -11,8 +11,44 @@ DeckManager deckManager;
...
@@ -11,8 +11,44 @@ DeckManager deckManager;
void
DeckManager
::
LoadLFList
(
const
char
*
path
)
{
void
DeckManager
::
LoadLFList
(
const
char
*
path
)
{
LFList
*
cur
=
NULL
;
LFList
*
cur
=
NULL
;
FILE
*
fp
=
fopen
(
path
,
"r"
);
FILE
*
fp
=
fopen
(
path
,
"r"
);
FILE
*
fp_custom
=
fopen
((
workingDir
+
path
(
"/expansions/lflist.conf"
)).
c_str
(),
"r"
);
char
linebuf
[
256
];
char
linebuf
[
256
];
wchar_t
strBuffer
[
256
];
wchar_t
strBuffer
[
256
];
if
(
fp_custom
)
{
while
(
fgets
(
linebuf
,
256
,
fp_custom
))
{
if
(
linebuf
[
0
]
==
'#'
)
continue
;
int
p
=
0
,
sa
=
0
,
code
,
count
;
if
(
linebuf
[
0
]
==
'!'
)
{
sa
=
BufferIO
::
DecodeUTF8
((
const
char
*
)(
&
linebuf
[
1
]),
strBuffer
);
while
(
strBuffer
[
sa
-
1
]
==
L'\r'
||
strBuffer
[
sa
-
1
]
==
L'\n'
)
sa
--
;
LFList
newlist
;
_lfList
.
push_back
(
newlist
);
cur
=
&
_lfList
[
_lfList
.
size
()
-
1
];
memcpy
(
cur
->
listName
,
(
const
void
*
)
strBuffer
,
40
);
cur
->
listName
[
sa
]
=
0
;
cur
->
content
=
new
std
::
unordered_map
<
int
,
int
>
;
cur
->
hash
=
0x7dfcee6a
;
continue
;
}
while
(
linebuf
[
p
]
!=
' '
&&
linebuf
[
p
]
!=
'\t'
&&
linebuf
[
p
]
!=
0
)
p
++
;
if
(
linebuf
[
p
]
==
0
)
continue
;
linebuf
[
p
++
]
=
0
;
sa
=
p
;
code
=
atoi
(
linebuf
);
if
(
code
==
0
)
continue
;
while
(
linebuf
[
p
]
==
' '
||
linebuf
[
p
]
==
'\t'
)
p
++
;
while
(
linebuf
[
p
]
!=
' '
&&
linebuf
[
p
]
!=
'\t'
&&
linebuf
[
p
]
!=
0
)
p
++
;
linebuf
[
p
]
=
0
;
count
=
atoi
(
&
linebuf
[
sa
]);
if
(
cur
==
NULL
)
continue
;
(
*
cur
->
content
)[
code
]
=
count
;
cur
->
hash
=
cur
->
hash
^
((
code
<<
18
)
|
(
code
>>
14
))
^
((
code
<<
(
27
+
count
))
|
(
code
>>
(
5
-
count
)));
}
fclose
(
fp_custom
);
}
if
(
fp
)
{
if
(
fp
)
{
while
(
fgets
(
linebuf
,
256
,
fp
))
{
while
(
fgets
(
linebuf
,
256
,
fp
))
{
if
(
linebuf
[
0
]
==
'#'
)
if
(
linebuf
[
0
]
==
'#'
)
...
...
Classes/gframe/drawing.cpp
View file @
a6b96c02
...
@@ -984,12 +984,13 @@ void Game::DrawSpec() {
...
@@ -984,12 +984,13 @@ void Game::DrawSpec() {
showChat
=
false
;
showChat
=
false
;
hideChatTimer
--
;
hideChatTimer
--
;
}
}
int
maxChatLines
=
mainGame
->
dInfo
.
isStarted
?
5
:
8
;
for
(
int
i
=
0
;
i
<
8
;
++
i
)
{
for
(
int
i
=
0
;
i
<
maxChatLines
;
++
i
)
{
static
unsigned
int
chatColor
[]
=
{
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xff8080ff
,
0xffff4040
,
0xffff4040
,
static
unsigned
int
chatColor
[]
=
{
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xffffffff
,
0xff8080ff
,
0xffff4040
,
0xffff4040
,
0xffff4040
,
0xff40ff40
,
0xff4040ff
,
0xff40ffff
,
0xffff40ff
,
0xffffff40
,
0xffffffff
,
0xff808080
,
0xff404040
};
0xffff4040
,
0xff40ff40
,
0xff4040ff
,
0xff40ffff
,
0xffff40ff
,
0xffffff40
,
0xffffffff
,
0xff808080
,
0xff404040
};
if
(
chatTiming
[
i
])
{
if
(
chatTiming
[
i
])
{
chatTiming
[
i
]
--
;
chatTiming
[
i
]
--
;
if
(
mainGame
->
dInfo
.
isStarted
&&
i
>=
5
)
continue
;
if
(
!
showChat
&&
i
>
2
)
if
(
!
showChat
&&
i
>
2
)
continue
;
continue
;
int
w
=
textFont
->
getDimension
(
chatMsg
[
i
].
c_str
()).
Width
;
int
w
=
textFont
->
getDimension
(
chatMsg
[
i
].
c_str
()).
Width
;
...
...
Classes/gframe/event_handler.cpp
View file @
a6b96c02
...
@@ -472,6 +472,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -472,6 +472,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
list_command
=
COMMAND_SPSUMMON
;
list_command
=
COMMAND_SPSUMMON
;
mainGame
->
wCardSelect
->
setText
(
dataManager
.
GetSysString
(
509
));
mainGame
->
wCardSelect
->
setText
(
dataManager
.
GetSysString
(
509
));
ShowSelectCard
();
ShowSelectCard
();
select_ready
=
false
;
ShowCancelOrFinishButton
(
1
);
ShowCancelOrFinishButton
(
1
);
}
}
break
;
break
;
...
@@ -967,18 +968,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -967,18 +968,6 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
UpdateDeclarableCode
(
true
);
UpdateDeclarableCode
(
true
);
break
;
break
;
}
}
case
EDITBOX_CHAT
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
if
(
input
[
0
])
{
unsigned
short
msgbuf
[
256
];
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
}
break
;
}
}
}
break
;
break
;
}
}
...
@@ -1844,6 +1833,19 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
...
@@ -1844,6 +1833,19 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
u32
pos
=
mainGame
->
scrCardText
->
getPos
();
u32
pos
=
mainGame
->
scrCardText
->
getPos
();
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
textFont
,
mainGame
->
showingtext
,
pos
);
mainGame
->
SetStaticText
(
mainGame
->
stText
,
mainGame
->
stText
->
getRelativePosition
().
getWidth
()
-
25
,
mainGame
->
textFont
,
mainGame
->
showingtext
,
pos
);
return
true
;
return
true
;
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
switch
(
id
)
{
case
EDITBOX_CHAT
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
if
(
input
[
0
])
{
unsigned
short
msgbuf
[
256
];
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
return
true
;
}
break
;
break
;
}
}
}
}
...
...
Classes/gframe/menu_handler.cpp
View file @
a6b96c02
...
@@ -505,49 +505,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -505,49 +505,6 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
}
break
;
break
;
}
}
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
switch
(
id
)
{
case
EDITBOX_CHAT
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
const
wchar_t
*
input
=
mainGame
->
ebChatInput
->
getText
();
if
(
input
[
0
])
{
unsigned
short
msgbuf
[
256
];
if
(
mainGame
->
dInfo
.
isStarted
)
{
if
(
mainGame
->
dInfo
.
player_type
<
7
)
{
if
(
mainGame
->
dInfo
.
isTag
&&
(
mainGame
->
dInfo
.
player_type
%
2
))
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
2
);
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
0
);
}
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
10
);
}
else
mainGame
->
AddChatMsg
((
wchar_t
*
)
input
,
7
);
int
len
=
BufferIO
::
CopyWStr
(
input
,
msgbuf
,
256
);
DuelClient
::
SendBufferToServer
(
CTOS_CHAT
,
msgbuf
,
(
len
+
1
)
*
sizeof
(
short
));
mainGame
->
ebChatInput
->
setText
(
L""
);
}
break
;
}
}
break
;
}
default:
break
;
}
break
;
}
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_R
:
{
if
(
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
textFont
->
setTransparency
(
true
);
break
;
}
case
irr
:
:
KEY_ESCAPE
:
{
if
(
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
device
->
minimizeWindow
();
break
;
}
default:
break
;
default:
break
;
}
}
break
;
break
;
...
...
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