Skip to content

Commit 9d4f265

Browse files
committed
Added stuff for fading older lines
1 parent ec20047 commit 9d4f265

File tree

9 files changed

+246
-167
lines changed

9 files changed

+246
-167
lines changed

doc.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7542,22 +7542,31 @@ void CMUSHclientDoc::DoFixMenus(CCmdUI* pCmdUI)
75427542
} // end of CMUSHclientDoc::DoFixMenus
75437543

75447544
// for mapping one colour to another at drawing time
7545-
const COLORREF CMUSHclientDoc::TranslateColour (const COLORREF & source) const
7545+
const COLORREF CMUSHclientDoc::TranslateColour (const COLORREF & source, const double opacity) const
75467546
{
75477547
// quick escape
75487548
if (m_ColourTranslationMap.empty ())
7549-
return source;
7549+
{
7550+
if (opacity == 1.0)
7551+
return source;
7552+
return RGB (opacity * GetRValue (source), opacity * GetGValue (source), opacity * GetBValue (source));
7553+
}
75507554

75517555
// search for it
75527556
map<COLORREF, COLORREF>::const_iterator it = m_ColourTranslationMap.find (source);
75537557

75547558
// not found, use original colour
75557559
if (it == m_ColourTranslationMap.end ())
7556-
return source;
7560+
{
7561+
if (opacity == 1.0)
7562+
return source;
7563+
return RGB (opacity * GetRValue (source), opacity * GetGValue (source), opacity * GetBValue (source));
7564+
}
75577565

75587566
// return replacement colour
7559-
return it->second;
7560-
7567+
if (opacity == 1.0)
7568+
return it->second;
7569+
return RGB (opacity * GetRValue (it->second), opacity * GetGValue (it->second), opacity * GetBValue (it->second));
75617570
} // end of CMUSHclientDoc::TranslateColour
75627571

75637572

doc.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,12 @@ class CMUSHclientDoc : public CDocument
925925
unsigned short m_bLogScriptErrors; // write scripting error messages to log file?
926926
unsigned short m_bOmitSavedDateFromSaveFiles; // if set, do not write the date saved to save files
927927

928+
// version 5.06
929+
930+
unsigned short m_iFadeOutputBufferAfterSeconds; // fade output buffer after these many seconds (0 = disable)
931+
unsigned short m_FadeOutputOpacityPercent; // what opacity to fade to (0 to 100 percent)
932+
unsigned short m_FadeOutputSeconds; // how many seconds to fade over
933+
928934
// end of stuff saved to disk **************************************************************
929935

930936
// stuff from pre version 11, read from disk but not saved
@@ -1382,6 +1388,8 @@ class CMUSHclientDoc : public CDocument
13821388
CString m_strWindowTitle; // for SetTitle
13831389
CString m_strMainWindowTitle; // for SetMainTitle
13841390

1391+
CTime m_timeFadeCancelled; // when we last scrolled up and cancelled faded text
1392+
CTime m_timeLastWindowDraw; // when we last redrew the output window
13851393

13861394
// see enum above: eKeepEvaluatingTriggers, eStopEvaluatingTriggers,
13871395
// eStopEvaluatingTriggersInAllPlugins
@@ -1824,7 +1832,7 @@ class CMUSHclientDoc : public CDocument
18241832

18251833
#endif // PANE
18261834

1827-
const COLORREF TranslateColour (const COLORREF & source) const;
1835+
const COLORREF TranslateColour (const COLORREF & source, const double opacity) const;
18281836

18291837
void OnConnect(int nErrorCode);
18301838
void HostNameResolved (WPARAM wParam, LPARAM lParam);

doc_construct.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ int i;
431431
m_bTreeviewAliases = true;
432432
m_bTreeviewTimers = true;
433433

434+
m_timeFadeCancelled = CTime ((time_t) 0);
435+
m_timeLastWindowDraw = CTime ((time_t) 0);
436+
434437
// set up some default triggers for MUSHes
435438

436439
/*

0 commit comments

Comments
 (0)