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
baichixing
ygopro
Commits
b958217a
Commit
b958217a
authored
Jan 08, 2016
by
woodee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1648 from DailyShana/control_mode
add mouse control
parents
506c0076
a7e421df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
3 deletions
+38
-3
gframe/event_handler.cpp
gframe/event_handler.cpp
+30
-3
gframe/game.cpp
gframe/game.cpp
+5
-0
gframe/game.h
gframe/game.h
+1
-0
system.conf
system.conf
+2
-0
No files found.
gframe/event_handler.cpp
View file @
b958217a
...
...
@@ -892,6 +892,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
irr
::
core
::
position2di
pos
(
x
,
y
);
if
(
x
<
300
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
)
mainGame
->
always_chain
=
event
.
MouseInput
.
isLeftPressed
();
if
(
mainGame
->
wCmdMenu
->
isVisible
()
&&
!
mainGame
->
wCmdMenu
->
getRelativePosition
().
isPointInside
(
pos
))
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
panel
&&
panel
->
isVisible
())
...
...
@@ -1239,6 +1241,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EMIE_RMOUSE_LEFT_UP
:
{
if
(
mainGame
->
dInfo
.
isReplay
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
mainGame
->
ignore_chain
=
event
.
MouseInput
.
isRightPressed
();
mainGame
->
wCmdMenu
->
setVisible
(
false
);
if
(
mainGame
->
fadingList
.
size
())
break
;
...
...
@@ -1531,6 +1535,20 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EMIE_MOUSE_WHEEL
:
{
break
;
}
case
irr
:
:
EMIE_LMOUSE_PRESSED_DOWN
:
{
if
(
!
mainGame
->
dInfo
.
isStarted
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
mainGame
->
always_chain
=
event
.
MouseInput
.
isLeftPressed
();
break
;
}
case
irr
:
:
EMIE_RMOUSE_PRESSED_DOWN
:
{
if
(
!
mainGame
->
dInfo
.
isStarted
)
break
;
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
event
.
MouseInput
.
X
>
300
)
mainGame
->
ignore_chain
=
event
.
MouseInput
.
isRightPressed
();
break
;
}
default:
break
;
}
...
...
@@ -1539,15 +1557,18 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
EET_KEY_INPUT_EVENT
:
{
switch
(
event
.
KeyInput
.
Key
)
{
case
irr
:
:
KEY_KEY_A
:
{
mainGame
->
always_chain
=
event
.
KeyInput
.
PressedDown
;
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
mainGame
->
always_chain
=
event
.
KeyInput
.
PressedDown
;
break
;
}
case
irr
:
:
KEY_KEY_S
:
{
mainGame
->
ignore_chain
=
event
.
KeyInput
.
PressedDown
;
if
(
mainGame
->
gameConf
.
control_mode
==
0
)
mainGame
->
ignore_chain
=
event
.
KeyInput
.
PressedDown
;
break
;
}
case
irr
:
:
KEY_KEY_R
:
{
if
(
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
if
(
mainGame
->
gameConf
.
control_mode
==
0
&&
!
event
.
KeyInput
.
PressedDown
&&
!
mainGame
->
HasFocus
(
EGUIET_EDIT_BOX
))
mainGame
->
textFont
->
setTransparency
(
true
);
break
;
}
...
...
@@ -1621,6 +1642,12 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
KEY_F9
:
{
if
(
mainGame
->
gameConf
.
control_mode
==
1
&&
!
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
();
...
...
gframe/game.cpp
View file @
b958217a
...
...
@@ -814,6 +814,7 @@ void Game::LoadConfig() {
gameConf
.
chkIgnore1
=
0
;
gameConf
.
chkIgnore2
=
0
;
gameConf
.
chkHideSetname
=
0
;
gameConf
.
control_mode
=
0
;
fseek
(
fp
,
0
,
SEEK_END
);
int
fsize
=
ftell
(
fp
);
fseek
(
fp
,
0
,
SEEK_SET
);
...
...
@@ -860,6 +861,8 @@ void Game::LoadConfig() {
gameConf
.
chkIgnore2
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"hide_setname"
))
{
gameConf
.
chkHideSetname
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"control_mode"
))
{
gameConf
.
control_mode
=
atoi
(
valbuf
);
}
else
{
// options allowing multiple words
sscanf
(
linebuf
,
"%s = %240[^
\n
]"
,
strbuf
,
valbuf
);
...
...
@@ -910,6 +913,8 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"ignore1 = %d
\n
"
,
((
mainGame
->
chkIgnore1
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"ignore2 = %d
\n
"
,
((
mainGame
->
chkIgnore2
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"hide_setname = %d
\n
"
,
((
mainGame
->
chkHideSetname
->
isChecked
())
?
1
:
0
));
fprintf
(
fp
,
"#control_mode = 0: Key A/S/R. control_mode = 1: MouseLeft/MouseRight/F9
\n
"
);
fprintf
(
fp
,
"control_mode = %d
\n
"
,
gameConf
.
control_mode
);
fclose
(
fp
);
}
void
Game
::
ShowCardInfo
(
int
code
)
{
...
...
gframe/game.h
View file @
b958217a
...
...
@@ -32,6 +32,7 @@ struct Config {
int
chkIgnore1
;
int
chkIgnore2
;
int
chkHideSetname
;
int
control_mode
;
};
struct
DuelInfo
{
...
...
system.conf
View file @
b958217a
...
...
@@ -18,3 +18,5 @@ waitchain = 0
ignore1
=
0
ignore2
=
0
hide_setname
=
0
#control_mode = 0: Key A/S/R. control_mode = 1: MouseLeft/MouseRight/F9
control_mode
=
0
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