[colobot] 39/62: Make shortcut blink in red
Didier Raboud
odyx at moszumanska.debian.org
Fri Nov 10 11:53:57 UTC 2017
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch debian/master
in repository colobot.
commit 2a0c2c38f0760e505df6d8b39c1811a1c03164a4
Author: DavivaD <davivad055 at gmail.com>
Date: Tue Oct 17 02:35:33 2017 +0200
Make shortcut blink in red
---
src/ui/controls/shortcut.cpp | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/src/ui/controls/shortcut.cpp b/src/ui/controls/shortcut.cpp
index 52cbcec..036c10d 100644
--- a/src/ui/controls/shortcut.cpp
+++ b/src/ui/controls/shortcut.cpp
@@ -109,12 +109,6 @@ void CShortcut::Draw()
zoom = 1.0f;
mode = Gfx::ENG_RSTATE_NORMAL;
}
- if ( (m_state & STATE_DAMAGE) && Math::Mod(m_time, 0.7f) >= 0.3f )
- {
- icon = 59;
- zoom = 0.8f;
- mode = Gfx::ENG_RSTATE_NORMAL;
- }
if ( m_icon == 128+6 || m_icon == 128+7 || m_icon == 58 ) // pause or film?
{
icon = -1; // no bottom
@@ -215,6 +209,27 @@ void CShortcut::Draw()
DrawIcon(m_pos, m_dim, uv1, uv2);
}
+ if ( (m_state & STATE_DAMAGE) && Math::Mod(m_time, 0.7f) >= 0.3f )
+ {
+ Math::Point uv1, uv2;
+ float dp;
+
+ m_engine->SetTexture("textures/interface/button2.png");
+ m_engine->SetState(Gfx::ENG_RSTATE_TTEXTURE_BLACK);
+
+ uv1.x = 159.0f/256.0f;
+ uv1.y = 240.0f/256.0f;
+ uv2.x = 145.0f/256.0f;
+ uv2.y = 256.0f/256.0f;
+
+ dp = 0.5f/256.0f;
+ uv1.x += dp;
+ uv1.y += dp;
+ uv2.x -= dp;
+ uv2.y -= dp;
+
+ DrawIcon(m_pos, m_dim, uv1, uv2);
+ }
}
// Draw the vertex array.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list