Skip to content

Commit

Permalink
Added optional NoUnderline flag to the Hyperlink function
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Jun 12, 2011
1 parent 74e4966 commit 3ab1b48
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 17 deletions.
2 changes: 1 addition & 1 deletion install/readme.txt
@@ -1,4 +1,4 @@
MUSHclient version 4.75
MUSHclient version 4.76
=======================

Sunday, 12th June 2011
Expand Down
17 changes: 9 additions & 8 deletions scripting/lua_methods.cpp
Expand Up @@ -4090,14 +4090,15 @@ static int L_Help (lua_State *L)
static int L_Hyperlink (lua_State *L)
{
CMUSHclientDoc *pDoc = doc (L);
pDoc->Hyperlink (
my_checkstring (L, 1), // Action
my_checkstring (L, 2), // Text
my_checkstring (L, 3), // Hint
my_checkstring (L, 4), // TextColour
my_checkstring (L, 5), // BackColour
optboolean (L, 6, 0) // URL - optional
);
pDoc->Hyperlink_Helper (
my_checkstring (L, 1), // Action
my_checkstring (L, 2), // Text
my_checkstring (L, 3), // Hint
my_checkstring (L, 4), // TextColour
my_checkstring (L, 5), // BackColour
optboolean (L, 6, 0), // URL - optional
optboolean (L, 7, 0) // No_Underline - optional
);
return 0; // number of result fields
} // end of L_Hyperlink

Expand Down
37 changes: 29 additions & 8 deletions scripting/methods/methods_noting.cpp
Expand Up @@ -512,12 +512,14 @@ else
*/

void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
LPCTSTR Text,
LPCTSTR Hint,
LPCTSTR TextColour,
LPCTSTR BackColour,
BOOL URL)
void CMUSHclientDoc::Hyperlink_Helper (LPCTSTR Action,
LPCTSTR Text,
LPCTSTR Hint,
LPCTSTR TextColour,
LPCTSTR BackColour,
BOOL URL,
BOOL NoUnderline)

{
// return if attempt to do tell (or note) before output buffer exists
if (m_pCurrentLine == NULL || m_pLinePositions == NULL)
Expand Down Expand Up @@ -560,7 +562,7 @@ void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
// change to underlined hyperlink
AddStyle (COLOUR_RGB |
(URL ? ACTION_HYPERLINK : ACTION_SEND) |
UNDERLINE,
(NoUnderline ? 0 : UNDERLINE),
forecolour,
backcolour, 0,
GetAction (Action,
Expand Down Expand Up @@ -590,7 +592,26 @@ void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
AddStyle (COLOUR_CUSTOM, m_iNoteTextColour, BLACK, 0, NULL);
} // not RGB

} // end of CMUSHclientDoc::Hyperlink
} // end of CMUSHclientDoc::Hyperlink_Helper


void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
LPCTSTR Text,
LPCTSTR Hint,
LPCTSTR TextColour,
LPCTSTR BackColour,
BOOL URL)
{

Hyperlink_Helper (Action,
Text,
Hint,
TextColour,
BackColour,
URL,
FALSE);
} // end of CMUSHclientDoc::Hyperlink


/*
Expand Down

0 comments on commit 3ab1b48

Please sign in to comment.