Skip to content

Commit 3ab1b48

Browse files
committed
Added optional NoUnderline flag to the Hyperlink function
1 parent 74e4966 commit 3ab1b48

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

install/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MUSHclient version 4.75
1+
MUSHclient version 4.76
22
=======================
33

44
Sunday, 12th June 2011

scripting/lua_methods.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4090,14 +4090,15 @@ static int L_Help (lua_State *L)
40904090
static int L_Hyperlink (lua_State *L)
40914091
{
40924092
CMUSHclientDoc *pDoc = doc (L);
4093-
pDoc->Hyperlink (
4094-
my_checkstring (L, 1), // Action
4095-
my_checkstring (L, 2), // Text
4096-
my_checkstring (L, 3), // Hint
4097-
my_checkstring (L, 4), // TextColour
4098-
my_checkstring (L, 5), // BackColour
4099-
optboolean (L, 6, 0) // URL - optional
4100-
);
4093+
pDoc->Hyperlink_Helper (
4094+
my_checkstring (L, 1), // Action
4095+
my_checkstring (L, 2), // Text
4096+
my_checkstring (L, 3), // Hint
4097+
my_checkstring (L, 4), // TextColour
4098+
my_checkstring (L, 5), // BackColour
4099+
optboolean (L, 6, 0), // URL - optional
4100+
optboolean (L, 7, 0) // No_Underline - optional
4101+
);
41014102
return 0; // number of result fields
41024103
} // end of L_Hyperlink
41034104

scripting/methods/methods_noting.cpp

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -512,12 +512,14 @@ else
512512
513513
*/
514514

515-
void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
516-
LPCTSTR Text,
517-
LPCTSTR Hint,
518-
LPCTSTR TextColour,
519-
LPCTSTR BackColour,
520-
BOOL URL)
515+
void CMUSHclientDoc::Hyperlink_Helper (LPCTSTR Action,
516+
LPCTSTR Text,
517+
LPCTSTR Hint,
518+
LPCTSTR TextColour,
519+
LPCTSTR BackColour,
520+
BOOL URL,
521+
BOOL NoUnderline)
522+
521523
{
522524
// return if attempt to do tell (or note) before output buffer exists
523525
if (m_pCurrentLine == NULL || m_pLinePositions == NULL)
@@ -560,7 +562,7 @@ void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
560562
// change to underlined hyperlink
561563
AddStyle (COLOUR_RGB |
562564
(URL ? ACTION_HYPERLINK : ACTION_SEND) |
563-
UNDERLINE,
565+
(NoUnderline ? 0 : UNDERLINE),
564566
forecolour,
565567
backcolour, 0,
566568
GetAction (Action,
@@ -590,7 +592,26 @@ void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
590592
AddStyle (COLOUR_CUSTOM, m_iNoteTextColour, BLACK, 0, NULL);
591593
} // not RGB
592594

593-
} // end of CMUSHclientDoc::Hyperlink
595+
} // end of CMUSHclientDoc::Hyperlink_Helper
596+
597+
598+
void CMUSHclientDoc::Hyperlink(LPCTSTR Action,
599+
LPCTSTR Text,
600+
LPCTSTR Hint,
601+
LPCTSTR TextColour,
602+
LPCTSTR BackColour,
603+
BOOL URL)
604+
{
605+
606+
Hyperlink_Helper (Action,
607+
Text,
608+
Hint,
609+
TextColour,
610+
BackColour,
611+
URL,
612+
FALSE);
613+
} // end of CMUSHclientDoc::Hyperlink
614+
594615

595616
/*
596617

0 commit comments

Comments
 (0)