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
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
Commits
4325b5c4
Commit
4325b5c4
authored
Oct 22, 2018
by
mercury233
Committed by
GitHub
Oct 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tip for cards in select / display list (#2146)
parent
56c13662
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
0 deletions
+56
-0
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+47
-0
gframe/game.cpp
gframe/game.cpp
+5
-0
gframe/game.h
gframe/game.h
+1
-0
strings.conf
strings.conf
+2
-0
No files found.
gframe/client_field.h
View file @
4325b5c4
...
...
@@ -138,6 +138,7 @@ public:
void
UpdateChainButtons
();
void
ShowCancelOrFinishButton
(
int
buttonOp
);
void
SetShowMark
(
ClientCard
*
pcard
,
bool
enable
);
void
ShowCardInfoInList
(
ClientCard
*
pcard
,
irr
::
gui
::
IGUIElement
*
element
,
irr
::
gui
::
IGUIElement
*
parent
);
void
SetResponseSelectedCards
()
const
;
void
SetResponseSelectedOption
()
const
;
void
CancelOrFinish
();
...
...
gframe/event_handler.cpp
View file @
4325b5c4
...
...
@@ -976,6 +976,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
id
>=
BUTTON_CARD_0
&&
id
<=
BUTTON_CARD_4
)
{
int
pos
=
mainGame
->
scrCardList
->
getPos
()
/
10
;
ClientCard
*
mcard
=
selectable_cards
[
id
-
BUTTON_CARD_0
+
pos
];
SetShowMark
(
mcard
,
true
);
ShowCardInfoInList
(
mcard
,
mainGame
->
btnCardSelect
[
id
-
BUTTON_CARD_0
],
mainGame
->
wCardSelect
);
if
(
mcard
->
code
)
{
mainGame
->
ShowCardInfo
(
mcard
->
code
);
}
else
{
...
...
@@ -985,6 +987,8 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
id
>=
BUTTON_DISPLAY_0
&&
id
<=
BUTTON_DISPLAY_4
)
{
int
pos
=
mainGame
->
scrDisplayList
->
getPos
()
/
10
;
ClientCard
*
mcard
=
display_cards
[
id
-
BUTTON_DISPLAY_0
+
pos
];
SetShowMark
(
mcard
,
true
);
ShowCardInfoInList
(
mcard
,
mainGame
->
btnCardDisplay
[
id
-
BUTTON_DISPLAY_0
],
mainGame
->
wCardDisplay
);
if
(
mcard
->
code
)
{
mainGame
->
ShowCardInfo
(
mcard
->
code
);
}
else
{
...
...
@@ -993,6 +997,21 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
break
;
}
case
irr
:
:
gui
::
EGET_ELEMENT_LEFT
:
{
if
(
id
>=
BUTTON_CARD_0
&&
id
<=
BUTTON_CARD_4
)
{
int
pos
=
mainGame
->
scrCardList
->
getPos
()
/
10
;
ClientCard
*
mcard
=
selectable_cards
[
id
-
BUTTON_CARD_0
+
pos
];
SetShowMark
(
mcard
,
false
);
mainGame
->
stCardListTip
->
setVisible
(
false
);
}
if
(
id
>=
BUTTON_DISPLAY_0
&&
id
<=
BUTTON_DISPLAY_4
)
{
int
pos
=
mainGame
->
scrDisplayList
->
getPos
()
/
10
;
ClientCard
*
mcard
=
display_cards
[
id
-
BUTTON_DISPLAY_0
+
pos
];
SetShowMark
(
mcard
,
false
);
mainGame
->
stCardListTip
->
setVisible
(
false
);
}
break
;
}
default:
break
;
}
...
...
@@ -2202,6 +2221,34 @@ void ClientField::SetShowMark(ClientCard* pcard, bool enable) {
chit
->
chain_card
->
is_showchaintarget
=
enable
;
}
}
void
ClientField
::
ShowCardInfoInList
(
ClientCard
*
pcard
,
irr
::
gui
::
IGUIElement
*
element
,
irr
::
gui
::
IGUIElement
*
parent
)
{
std
::
wstring
str
(
L""
);
if
(
pcard
->
code
)
{
str
.
append
(
dataManager
.
GetName
(
pcard
->
code
));
}
for
(
size_t
i
=
0
;
i
<
chains
.
size
();
++
i
)
{
wchar_t
formatBuffer
[
2048
];
auto
chit
=
chains
[
i
];
if
(
pcard
==
chit
.
chain_card
)
{
myswprintf
(
formatBuffer
,
dataManager
.
GetSysString
(
216
),
i
+
1
);
str
.
append
(
L"
\n
"
).
append
(
formatBuffer
);
}
if
(
chit
.
target
.
find
(
pcard
)
!=
chit
.
target
.
end
())
{
myswprintf
(
formatBuffer
,
dataManager
.
GetSysString
(
217
),
i
+
1
,
dataManager
.
GetName
(
chit
.
chain_card
->
code
));
str
.
append
(
L"
\n
"
).
append
(
formatBuffer
);
}
}
if
(
str
.
length
()
>
0
)
{
parent
->
addChild
(
mainGame
->
stCardListTip
);
irr
::
core
::
rect
<
s32
>
ePos
=
element
->
getRelativePosition
();
s32
x
=
(
ePos
.
UpperLeftCorner
.
X
+
ePos
.
LowerRightCorner
.
X
)
/
2
;
s32
y
=
ePos
.
LowerRightCorner
.
Y
;
mainGame
->
SetStaticText
(
mainGame
->
stCardListTip
,
160
,
mainGame
->
guiFont
,
str
.
c_str
());
irr
::
core
::
dimension2d
<
unsigned
int
>
dTip
=
mainGame
->
guiFont
->
getDimension
(
mainGame
->
stCardListTip
->
getText
())
+
irr
::
core
::
dimension2d
<
unsigned
int
>
(
10
,
10
);
mainGame
->
stCardListTip
->
setRelativePosition
(
recti
(
x
-
dTip
.
Width
/
2
,
y
-
10
,
x
+
dTip
.
Width
/
2
,
y
-
10
+
dTip
.
Height
));
mainGame
->
stCardListTip
->
setVisible
(
true
);
}
}
void
ClientField
::
SetResponseSelectedCards
()
const
{
unsigned
char
respbuf
[
64
];
respbuf
[
0
]
=
selected_cards
.
size
();
...
...
gframe/game.cpp
View file @
4325b5c4
...
...
@@ -674,6 +674,11 @@ bool Game::Initialize() {
stTip
->
setBackgroundColor
(
0xc0ffffff
);
stTip
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
stTip
->
setVisible
(
false
);
//tip for cards in select / display list
stCardListTip
=
env
->
addStaticText
(
L""
,
rect
<
s32
>
(
0
,
0
,
150
,
150
),
false
,
true
,
wCardSelect
,
-
1
,
true
);
stCardListTip
->
setBackgroundColor
(
0xc0ffffff
);
stCardListTip
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
stCardListTip
->
setVisible
(
false
);
device
->
setEventReceiver
(
&
menuHandler
);
LoadConfig
();
if
(
!
soundManager
.
Init
())
{
...
...
gframe/game.h
View file @
4325b5c4
...
...
@@ -225,6 +225,7 @@ public:
//hint text
irr
::
gui
::
IGUIStaticText
*
stHintMsg
;
irr
::
gui
::
IGUIStaticText
*
stTip
;
irr
::
gui
::
IGUIStaticText
*
stCardListTip
;
//infos
irr
::
gui
::
IGUITabControl
*
wInfos
;
irr
::
gui
::
IGUIStaticText
*
stName
;
...
...
strings.conf
View file @
4325b5c4
...
...
@@ -68,6 +68,8 @@
!
system
213
已选择种族:
!
system
214
已选择属性:
!
system
215
已选择数字:
!
system
216
在连锁%
d
发动
!
system
217
被连锁%
d
的[%
ls
]选择为对象
!
system
500
请选择要解放的卡
!
system
501
请选择要丢弃的手卡
!
system
502
请选择要破坏的卡
...
...
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