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
wyykak
ygopro
Commits
d088471b
Commit
d088471b
authored
Nov 05, 2017
by
edo9300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix
parent
5bb61394
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
gframe/game.cpp
gframe/game.cpp
+14
-8
gframe/game.h
gframe/game.h
+1
-0
No files found.
gframe/game.cpp
View file @
d088471b
...
@@ -60,6 +60,7 @@ bool Game::Initialize() {
...
@@ -60,6 +60,7 @@ bool Game::Initialize() {
ignore_chain = false;
ignore_chain = false;
chain_when_avail = false;
chain_when_avail = false;
is_building = false;
is_building = false;
texty = 0;
memset(&dInfo, 0, sizeof(DuelInfo));
memset(&dInfo, 0, sizeof(DuelInfo));
memset(chatTiming, 0, sizeof(chatTiming));
memset(chatTiming, 0, sizeof(chatTiming));
deckManager.LoadLFList();
deckManager.LoadLFList();
...
@@ -794,12 +795,12 @@ void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32
...
@@ -794,12 +795,12 @@ void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32
mProjection[14] = znear * zfar / (znear - zfar);
mProjection[14] = znear * zfar / (znear - zfar);
}
}
void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text) {
void Game::InitStaticText(irr::gui::IGUIStaticText* pControl, u32 cWidth, u32 cHeight, irr::gui::CGUITTFont* font, const wchar_t* text) {
const
auto
&
tsize
=
scrCardText
->
getRelativePosition
();
SetStaticText(pControl, cWidth-10, font, text);
SetStaticText
(
pControl
,
cWidth
-
tsize
.
getWidth
(),
font
,
text
);
if(font->getDimension(dataManager.strBuffer).Height <= cHeight) {
if(font->getDimension(dataManager.strBuffer).Height <= cHeight) {
scrCardText->setVisible(false);
scrCardText->setVisible(false);
return;
return;
}
}
const auto& tsize = scrCardText->getRelativePosition();
SetStaticText(pControl, cWidth - tsize.getWidth(), font, text);
SetStaticText(pControl, cWidth - tsize.getWidth(), font, text);
u32 fontheight = font->getDimension(L"A").Height + font->getKerningHeight();
u32 fontheight = font->getDimension(L"A").Height + font->getKerningHeight();
u32 step = (font->getDimension(dataManager.strBuffer).Height - cHeight) / fontheight + 1;
u32 step = (font->getDimension(dataManager.strBuffer).Height - cHeight) / fontheight + 1;
...
@@ -1278,15 +1279,17 @@ void Game::ShowCardInfo(int code) {
...
@@ -1278,15 +1279,17 @@ void Game::ShowCardInfo(int code) {
}
}
stDataInfo->setText(formatBuffer);
stDataInfo->setText(formatBuffer);
stSetName->setRelativePosition(rect<s32>(15, 83, 316 * window_size.Width / 1024 - 30, 116));
stSetName->setRelativePosition(rect<s32>(15, 83, 316 * window_size.Width / 1024 - 30, 116));
stText
->
setRelativePosition
(
rect
<
s32
>
(
15
,
83
+
offset
,
287
*
window_size
.
Width
/
1024
-
30
,
324
*
window_size
.
Height
/
640
));
texty = 83 + offset;
scrCardText
->
setRelativePosition
(
Resize
(
267
,
83
+
offset
,
287
,
324
));
stText->setRelativePosition(rect<s32>(15, texty * window_size.Height / 640, 287 * window_size.Width / 1024, 324 * window_size.Height / 640));
scrCardText->setRelativePosition(Resize(267, texty, 287, 324));
} else {
} else {
myswprintf(formatBuffer, L"[%ls]", dataManager.FormatType(cd.type));
myswprintf(formatBuffer, L"[%ls]", dataManager.FormatType(cd.type));
stInfo->setText(formatBuffer);
stInfo->setText(formatBuffer);
stDataInfo->setText(L"");
stDataInfo->setText(L"");
stSetName->setRelativePosition(rect<s32>(15, 60, 316 * window_size.Height / 640, 83));
stSetName->setRelativePosition(rect<s32>(15, 60, 316 * window_size.Height / 640, 83));
stText
->
setRelativePosition
(
rect
<
s32
>
(
15
,
60
+
offset
,
287
*
window_size
.
Width
/
1024
-
30
,
324
*
window_size
.
Height
/
640
));
texty = 60 + offset;
scrCardText
->
setRelativePosition
(
Resize
(
267
,
60
+
offset
,
287
,
324
));
stText->setRelativePosition(rect<s32>(15, texty * window_size.Height / 640, 287 * window_size.Width / 1024, 324 * window_size.Height / 640));
scrCardText->setRelativePosition(Resize(267, texty, 287, 324));
}
}
showingtext = dataManager.GetText(code);
showingtext = dataManager.GetText(code);
const auto& tsize = stText->getRelativePosition();
const auto& tsize = stText->getRelativePosition();
...
@@ -1569,9 +1572,12 @@ void Game::OnResize()
...
@@ -1569,9 +1572,12 @@ void Game::OnResize()
stName->setRelativePosition(recti(10, 10, 287 * window_size.Width / 1024, 32));
stName->setRelativePosition(recti(10, 10, 287 * window_size.Width / 1024, 32));
stInfo->setRelativePosition(recti(15, 37, 296 * window_size.Width / 1024, 60));
stInfo->setRelativePosition(recti(15, 37, 296 * window_size.Width / 1024, 60));
stDataInfo->setRelativePosition(recti(15, 60, 296 * window_size.Width / 1024, 83));
stDataInfo->setRelativePosition(recti(15, 60, 296 * window_size.Width / 1024, 83));
stText
->
setRelativePosition
(
recti
(
15
,
stText
->
getRelativePosition
().
UpperLeftCorner
.
Y
,
287
*
window_size
.
Width
/
1024
,
324
*
window_size
.
Height
/
640
));
stText->setRelativePosition(recti(15,
texty * window_size.Height / 640
, 287 * window_size.Width / 1024, 324 * window_size.Height / 640));
scrCardText
->
setRelativePosition
(
recti
(
267
*
window_size
.
Width
/
1024
,
scrCardText
->
getRelativePosition
().
UpperLeftCorner
.
Y
,
287
*
window_size
.
Width
/
1024
,
324
*
window_size
.
Height
/
640
));
scrCardText->setRelativePosition(
Resize(267, texty, 287, 324
));
lstLog->setRelativePosition(Resize(10, 10, 290, 290));
lstLog->setRelativePosition(Resize(10, 10, 290, 290));
const auto& tsize = stText->getRelativePosition();
if(texty)
InitStaticText(stText, tsize.getWidth(), tsize.getHeight(), textFont, showingtext);
btnClearLog->setRelativePosition(Resize(160, 300, 260, 325));
btnClearLog->setRelativePosition(Resize(160, 300, 260, 325));
srcVolume->setRelativePosition(rect<s32>(85, 295, wInfos->getRelativePosition().LowerRightCorner.X - 21, 310));
srcVolume->setRelativePosition(rect<s32>(85, 295, wInfos->getRelativePosition().LowerRightCorner.X - 21, 310));
...
...
gframe/game.h
View file @
d088471b
...
@@ -188,6 +188,7 @@ public:
...
@@ -188,6 +188,7 @@ public:
bool
is_building
;
bool
is_building
;
bool
is_siding
;
bool
is_siding
;
uint32
duel_param
;
uint32
duel_param
;
int
texty
;
irr
::
core
::
dimension2d
<
irr
::
u32
>
window_size
;
irr
::
core
::
dimension2d
<
irr
::
u32
>
window_size
;
...
...
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