Fix console blue messages

master
Eduardo Bart 12 years ago
parent 657640c270
commit 0eb7c166c0

@ -23,7 +23,8 @@ MessageTypes = {
[MessageModes.Loot] = MessageSettings.centerGreen,
[MessageModes.Red] = MessageSettings.consoleRed,
[MessageModes.Blue] = MessageSettings.consoleBlue,
[MessageModes.PrivateFrom] = MessageSettings.private
[MessageModes.PrivateFrom] = MessageSettings.consoleBlue,
[254] = MessageSettings.private
}
messagesPanel = nil
@ -91,6 +92,6 @@ end
function onPrivateTalk(code, text, speaker, speakerlevel, statmentid)
if Options.getOption('showPrivateMessagesOnScreen') then
displayMessage(code, speaker .. ':\n' .. text)
displayMessage(254, speaker .. ':\n' .. text)
end
end

@ -72,6 +72,7 @@ TextColors = {
yellow = '#ffff00', --'#e6c832'
green = '#00EB00', --'#3fbe32'
lightblue = '#5ff7f7',
blue = '#9f9dfd',
--blue1 = '#6e50dc',
--blue2 = '#3264c8',
--blue3 = '#0096c8',

@ -42,7 +42,6 @@ namespace Otc
AWARE_Y_TOP_TILES = AWARE_Y_TILES/2 - 1,
AWARE_Y_BOTTOM_TILES = AWARE_Y_TILES/2,
EFFECT_TICKS_PER_FRAME = 75,
INVISIBLE_TICKS_PER_FRAME = 500,
ITEM_TICKS_PER_FRAME = 500,
ANIMATED_TEXT_DURATION = 1000,

@ -31,17 +31,22 @@ void Effect::draw(const Point& dest, float scaleFactor, bool animate)
int animationPhase = 0;
if(animate)
animationPhase = std::min((int)(m_animationTimer.ticksElapsed() / Otc::EFFECT_TICKS_PER_FRAME), getAnimationPhases() - 1);
animationPhase = std::min((int)(m_animationTimer.ticksElapsed() / m_phaseDuration), getAnimationPhases() - 1);
rawGetThingType()->draw(dest, scaleFactor, 0, 0, 0, 0, animationPhase);
}
void Effect::startAnimation()
{
m_animationTimer.restart();
m_phaseDuration = EFFECT_TICKS_PER_FRAME;
// hack to fix some animation phases duration, currently there is no better solution
if(m_id == 33)
m_phaseDuration *= 4;
// schedule removal
auto self = asEffect();
g_dispatcher.scheduleEvent([self]() { g_map.removeThing(self); }, Otc::EFFECT_TICKS_PER_FRAME * getAnimationPhases());
g_dispatcher.scheduleEvent([self]() { g_map.removeThing(self); }, m_phaseDuration * getAnimationPhases());
}
void Effect::setId(uint32 id)

@ -30,6 +30,9 @@
// @bindclass
class Effect : public Thing
{
enum {
EFFECT_TICKS_PER_FRAME = 75
};
public:
void draw(const Point& dest, float scaleFactor, bool animate);
@ -46,6 +49,7 @@ public:
private:
Timer m_animationTimer;
uint m_phaseDuration;
uint16 m_id;
};

Loading…
Cancel
Save