Fix console blue messages

This commit is contained in:
Eduardo Bart 2012-07-26 09:19:01 -03:00
parent 657640c270
commit 0eb7c166c0
5 changed files with 15 additions and 5 deletions

View File

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

View File

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

View File

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

View File

@ -31,17 +31,22 @@ void Effect::draw(const Point& dest, float scaleFactor, bool animate)
int animationPhase = 0; int animationPhase = 0;
if(animate) 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); rawGetThingType()->draw(dest, scaleFactor, 0, 0, 0, 0, animationPhase);
} }
void Effect::startAnimation() void Effect::startAnimation()
{ {
m_animationTimer.restart(); 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 // schedule removal
auto self = asEffect(); 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) void Effect::setId(uint32 id)

View File

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