C# Class GTAVBETrainerDotNet.Utils

Utilities
显示文件 Open project: betenner/betrainer

Public Methods

Method Description
CTML ( string defaultString, string chineseTraditional ) : MString

Generates a multi-string with a default string and a Chinese Traditional string

DrawRect ( int x, int y, int width, int height, Color color, int screenWidth = GlobalConst.DEFAULT_SCREEN_WIDTH, int screenHeight = GlobalConst.DEFAULT_SCREEN_HEIGHT ) : void

Draw a rectangle

DrawText ( MString text, int x, int y, GlobalConst align, Color color, float xScale = 0.35f, float yScale = 0.35f, GTA font = GTA.Font.ChaletLondon, Point shadowOffset = newPoint(), Color shadowColor = newColor(), int screenWidth = GlobalConst.DEFAULT_SCREEN_WIDTH, int screenHeight = GlobalConst.DEFAULT_SCREEN_HEIGHT ) : void

Draw text

FormatML ( MString format ) : string
FormatML ( MString format, MString arg ) : string
ML ( MString str ) : string

Gets the string with current language code.

ParseBool ( string value ) : bool

Parses a boolean value

ParseBoolStr ( string value ) : bool

Parses a boolean string value

ParseBoolStr ( string value, bool defaultValue ) : bool

Parses a boolean string value

ParseFloat ( string value ) : float

Parses an float value

ParseInt ( string value ) : int

Parses an int value

ParseKey ( string value ) : Keys

Parses a key

ParseNullableBool ( string value ) : bool?

Parses a nullable boolean value

PlaySound ( string sound, string soundSet ) : void

Play a sound

ShowInGameKeyboard ( string titleId = null, string prePopulatedText = null, int maxInputLength = 64 ) : string

Shows the in-game keyboard screen and gets the inputted text.

ShowNotificationAboveMap ( MString message ) : void

Shows a notification above in-game mini-map

Method Details

CTML() public static method

Generates a multi-string with a default string and a Chinese Traditional string
public static CTML ( string defaultString, string chineseTraditional ) : MString
defaultString string Default string
chineseTraditional string Chinese triditional string
return MString

DrawRect() public static method

Draw a rectangle
public static DrawRect ( int x, int y, int width, int height, Color color, int screenWidth = GlobalConst.DEFAULT_SCREEN_WIDTH, int screenHeight = GlobalConst.DEFAULT_SCREEN_HEIGHT ) : void
x int X position in pixel
y int Y position in pixel
width int Width in pixel
height int Height in pixel
color Color Color
screenWidth int Screen width in pixel
screenHeight int Screen height in pixel
return void

DrawText() public static method

Draw text
public static DrawText ( MString text, int x, int y, GlobalConst align, Color color, float xScale = 0.35f, float yScale = 0.35f, GTA font = GTA.Font.ChaletLondon, Point shadowOffset = newPoint(), Color shadowColor = newColor(), int screenWidth = GlobalConst.DEFAULT_SCREEN_WIDTH, int screenHeight = GlobalConst.DEFAULT_SCREEN_HEIGHT ) : void
text MString Text to drawn
x int X position in pixel
y int Y position in pixel
align GlobalConst Horizontal alignment
color Color Color
xScale float X Scale
yScale float Y Scale
font GTA Font
shadowOffset Point Offset of shadow
shadowColor Color Color of shadow
screenWidth int Width of screen in pixel
screenHeight int Height of screen in pixel
return void

FormatML() public static method

public static FormatML ( MString format ) : string
format MString
return string

FormatML() public static method

public static FormatML ( MString format, MString arg ) : string
format MString
arg MString
return string

ML() public static method

Gets the string with current language code.
public static ML ( MString str ) : string
str MString Multi-string
return string

ParseBool() public static method

Parses a boolean value
public static ParseBool ( string value ) : bool
value string Value
return bool

ParseBoolStr() public static method

Parses a boolean string value
public static ParseBoolStr ( string value ) : bool
value string Value
return bool

ParseBoolStr() public static method

Parses a boolean string value
public static ParseBoolStr ( string value, bool defaultValue ) : bool
value string Value
defaultValue bool Default value
return bool

ParseFloat() public static method

Parses an float value
public static ParseFloat ( string value ) : float
value string Value
return float

ParseInt() public static method

Parses an int value
public static ParseInt ( string value ) : int
value string Value
return int

ParseKey() public static method

Parses a key
public static ParseKey ( string value ) : Keys
value string Value
return Keys

ParseNullableBool() public static method

Parses a nullable boolean value
public static ParseNullableBool ( string value ) : bool?
value string Value
return bool?

PlaySound() public static method

Play a sound
public static PlaySound ( string sound, string soundSet ) : void
sound string Sound name
soundSet string Sound set name
return void

ShowInGameKeyboard() public static method

Shows the in-game keyboard screen and gets the inputted text.
public static ShowInGameKeyboard ( string titleId = null, string prePopulatedText = null, int maxInputLength = 64 ) : string
titleId string Title ID (not the title itself!)
prePopulatedText string Text shows in the input area after keyboard open
maxInputLength int Max input length
return string

ShowNotificationAboveMap() public static method

Shows a notification above in-game mini-map
public static ShowNotificationAboveMap ( MString message ) : void
message MString Message to show
return void