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
e21e3f8f
Commit
e21e3f8f
authored
Dec 13, 2022
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
parents
e3fd7656
3e2be30d
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
437 additions
and
18 deletions
+437
-18
gframe/drawing.cpp
gframe/drawing.cpp
+23
-6
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+27
-3
lflist.conf
lflist.conf
+386
-8
textures/lp.png
textures/lp.png
+0
-0
No files found.
gframe/drawing.cpp
View file @
e21e3f8f
...
@@ -518,12 +518,29 @@ void Game::DrawMisc() {
...
@@ -518,12 +518,29 @@ void Game::DrawMisc() {
driver
->
draw2DImage
(
imageManager
.
tLPFrame
,
Resize
(
330
,
10
,
629
,
30
),
recti
(
0
,
0
,
200
,
20
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tLPFrame
,
Resize
(
330
,
10
,
629
,
30
),
recti
(
0
,
0
,
200
,
20
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tLPFrame
,
Resize
(
691
,
10
,
990
,
30
),
recti
(
0
,
0
,
200
,
20
),
0
,
0
,
true
);
driver
->
draw2DImage
(
imageManager
.
tLPFrame
,
Resize
(
691
,
10
,
990
,
30
),
recti
(
0
,
0
,
200
,
20
),
0
,
0
,
true
);
if
(
dInfo
.
start_lp
)
{
if
(
dInfo
.
start_lp
)
{
if
(
dInfo
.
lp
[
0
]
>=
dInfo
.
start_lp
)
auto
maxLP
=
dInfo
.
isTag
?
dInfo
.
start_lp
/
2
:
dInfo
.
start_lp
;
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
335
,
12
,
625
,
28
),
recti
(
0
,
0
,
16
,
16
),
0
,
0
,
true
);
if
(
dInfo
.
lp
[
0
]
>=
maxLP
)
{
else
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
335
,
12
,
335
+
290
*
dInfo
.
lp
[
0
]
/
dInfo
.
start_lp
,
28
),
recti
(
0
,
0
,
16
,
16
),
0
,
0
,
true
);
auto
layerCount
=
dInfo
.
lp
[
0
]
/
maxLP
;
if
(
dInfo
.
lp
[
1
]
>=
dInfo
.
start_lp
)
auto
partialLP
=
dInfo
.
lp
[
0
]
%
maxLP
;
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
696
,
12
,
986
,
28
),
recti
(
0
,
0
,
16
,
16
),
0
,
0
,
true
);
auto
bgColorPos
=
(
layerCount
-
1
)
%
5
;
else
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
986
-
290
*
dInfo
.
lp
[
1
]
/
dInfo
.
start_lp
,
12
,
986
,
28
),
recti
(
0
,
0
,
16
,
16
),
0
,
0
,
true
);
auto
fgColorPos
=
layerCount
%
5
;
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
335
+
290
*
partialLP
/
maxLP
,
12
,
625
,
28
),
recti
(
0
,
bgColorPos
*
16
,
16
,
(
bgColorPos
+
1
)
*
16
),
0
,
0
,
true
);
if
(
partialLP
>
0
)
{
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
335
,
12
,
335
+
290
*
partialLP
/
maxLP
,
28
),
recti
(
0
,
fgColorPos
*
16
,
16
,
(
fgColorPos
+
1
)
*
16
),
0
,
0
,
true
);
}
}
else
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
335
,
12
,
335
+
290
*
dInfo
.
lp
[
0
]
/
maxLP
,
28
),
recti
(
0
,
0
,
16
,
16
),
0
,
0
,
true
);
if
(
dInfo
.
lp
[
1
]
>=
maxLP
)
{
auto
layerCount
=
dInfo
.
lp
[
1
]
/
maxLP
;
auto
partialLP
=
dInfo
.
lp
[
1
]
%
maxLP
;
auto
bgColorPos
=
(
layerCount
-
1
)
%
5
;
auto
fgColorPos
=
layerCount
%
5
;
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
696
,
12
,
986
-
290
*
partialLP
/
maxLP
,
28
),
recti
(
0
,
bgColorPos
*
16
,
16
,
(
bgColorPos
+
1
)
*
16
),
0
,
0
,
true
);
if
(
partialLP
>
0
)
{
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
986
-
290
*
partialLP
/
maxLP
,
12
,
986
,
28
),
recti
(
0
,
fgColorPos
*
16
,
16
,
(
fgColorPos
+
1
)
*
16
),
0
,
0
,
true
);
}
}
else
driver
->
draw2DImage
(
imageManager
.
tLPBar
,
Resize
(
986
-
290
*
dInfo
.
lp
[
1
]
/
maxLP
,
12
,
986
,
28
),
recti
(
0
,
0
,
16
,
16
),
0
,
0
,
true
);
}
}
if
(
lpframe
)
{
if
(
lpframe
)
{
dInfo
.
lp
[
lpplayer
]
-=
lpd
;
dInfo
.
lp
[
lpplayer
]
-=
lpd
;
...
...
gframe/duelclient.cpp
View file @
e21e3f8f
...
@@ -2164,7 +2164,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
...
@@ -2164,7 +2164,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
}
mainGame
->
WaitFrameSignal
(
5
);
mainGame
->
WaitFrameSignal
(
5
);
}
}
if
(
panel_confirm
.
size
())
{
if
(
panel_confirm
.
size
()
&&
mainGame
->
dInfo
.
player_type
!=
7
)
{
std
::
sort
(
panel_confirm
.
begin
(),
panel_confirm
.
end
(),
ClientCard
::
client_card_sort
);
std
::
sort
(
panel_confirm
.
begin
(),
panel_confirm
.
end
(),
ClientCard
::
client_card_sort
);
mainGame
->
gMutex
.
lock
();
mainGame
->
gMutex
.
lock
();
mainGame
->
dField
.
selectable_cards
=
panel_confirm
;
mainGame
->
dField
.
selectable_cards
=
panel_confirm
;
...
...
gframe/menu_handler.cpp
View file @
e21e3f8f
...
@@ -93,6 +93,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -93,6 +93,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
sockaddr_in
*
sin
=
((
struct
sockaddr_in
*
)
answer
->
ai_addr
);
sockaddr_in
*
sin
=
((
struct
sockaddr_in
*
)
answer
->
ai_addr
);
evutil_inet_ntop
(
AF_INET
,
&
(
sin
->
sin_addr
),
ip
,
20
);
evutil_inet_ntop
(
AF_INET
,
&
(
sin
->
sin_addr
),
ip
,
20
);
remote_addr
=
htonl
(
inet_addr
(
ip
));
remote_addr
=
htonl
(
inet_addr
(
ip
));
evutil_freeaddrinfo
(
answer
);
}
}
}
}
unsigned
int
remote_port
=
_wtoi
(
mainGame
->
ebJoinPort
->
getText
());
unsigned
int
remote_port
=
_wtoi
(
mainGame
->
ebJoinPort
->
getText
());
...
@@ -126,10 +127,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -126,10 +127,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case
BUTTON_HOST_CONFIRM
:
{
case
BUTTON_HOST_CONFIRM
:
{
bot_mode
=
false
;
bot_mode
=
false
;
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
mainGame
->
gameConf
.
gamename
,
20
);
BufferIO
::
CopyWStr
(
mainGame
->
ebServerName
->
getText
(),
mainGame
->
gameConf
.
gamename
,
20
);
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
NetServer
::
StopServer
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
}
mainGame
->
btnHostConfirm
->
setEnabled
(
false
);
mainGame
->
btnHostConfirm
->
setEnabled
(
false
);
...
@@ -169,6 +175,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -169,6 +175,10 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
case
BUTTON_HP_READY
:
{
case
BUTTON_HP_READY
:
{
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
mainGame
->
gMutex
.
lock
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1406
));
mainGame
->
gMutex
.
unlock
();
break
;
break
;
}
}
UpdateDeck
();
UpdateDeck
();
...
@@ -323,10 +333,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -323,10 +333,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
break
;
break
;
bot_mode
=
true
;
bot_mode
=
true
;
#ifdef _WIN32
#ifdef _WIN32
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
NetServer
::
StopServer
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
}
STARTUPINFOW
si
;
STARTUPINFOW
si
;
...
@@ -373,10 +388,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -373,10 +388,15 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
execl
(
"./bot"
,
"bot"
,
arg1
,
arg2
,
arg3
,
NULL
);
execl
(
"./bot"
,
"bot"
,
arg1
,
arg2
,
arg3
,
NULL
);
exit
(
0
);
exit
(
0
);
}
else
{
}
else
{
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
if
(
!
NetServer
::
StartServer
(
mainGame
->
gameConf
.
serverport
))
{
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
if
(
!
DuelClient
::
StartClient
(
0x7f000001
,
mainGame
->
gameConf
.
serverport
))
{
NetServer
::
StopServer
();
NetServer
::
StopServer
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1402
));
break
;
break
;
}
}
}
}
...
@@ -607,7 +627,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
...
@@ -607,7 +627,11 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
if
(
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
isChecked
())
{
if
(
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
isChecked
())
{
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
if
(
mainGame
->
cbCategorySelect
->
getSelected
()
==
-
1
||
mainGame
->
cbDeckSelect
->
getSelected
()
==
-
1
||
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
!
deckManager
.
LoadDeck
(
mainGame
->
cbCategorySelect
,
mainGame
->
cbDeckSelect
))
{
mainGame
->
gMutex
.
lock
();
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
setChecked
(
false
);
static_cast
<
irr
::
gui
::
IGUICheckBox
*>
(
caller
)
->
setChecked
(
false
);
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1406
));
mainGame
->
gMutex
.
unlock
();
break
;
break
;
}
}
UpdateDeck
();
UpdateDeck
();
...
...
lflist.conf
View file @
e21e3f8f
This diff is collapsed.
Click to expand it.
textures/lp.png
View replaced file @
e3fd7656
View file @
e21e3f8f
967 Bytes
|
W:
|
H:
2.05 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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