Page 1 of 1

base:SystemRequest()

Posted: Wed Apr 15, 2015 11:07 pm
by djrikki
This is a replacement for the internal SystemRequest() command, or rather an extended version of the original which goes one step further and removes them pesky formatting characters that can appear; tbh since I've moved over to MUI Royale I don't really encounter the formatting characters anymore.

Code: Select all

Global base
base = {}

;; base:StripBoldandUnderlineFormatting(gadgets$)
; Removes underline characters from a string, used when displaying locales via a SystemRequest call for example
Function base:StripBoldandUnderlineFormatting(gadgets$)
    gadgets$ = ToString(gadgets$)
    gadgets$ = ReplaceStr(gadgets$,"[u]","")
    gadgets$ = ReplaceStr(gadgets$,"[/u]","")
    gadgets$ = ReplaceStr(gadgets$,"[b]","")
    gadgets$ = ReplaceStr(gadgets$,"[/b]","")
    Return (gadgets$)
EndFunction
    
Function base:SystemRequest(title,body,gadgets,icon)
	Local res = SystemRequest(base:StripBoldandUnderlineFormatting(title),base:StripBoldandUnderlineFormatting(body),base:StripBoldandUnderlineFormatting(gadgets),icon)
	Return (res)
EndFunction