Skip to content

Commit

Permalink
Added "string" command
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiephan committed Jan 11, 2021
1 parent eaec11a commit 0c00533
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 1 deletion.
57 changes: 57 additions & 0 deletions (10)trymemode.stormmap/base.stormdata/Modules/LibUtilities.galaxy
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ trigger libUTIL_gt_ForceRunTrigger;
trigger libUTIL_gt_ToggleACTS;
trigger libUTIL_gt_MinionWaveInterval;
trigger libUTIL_gt_FloatingCombatText;
trigger libUTIL_gt_DisplayString;

// Library Initialization
void libUTIL_InitVariables ();
Expand Down Expand Up @@ -709,6 +710,61 @@ void libUTIL_gt_FloatingCombatText_Init () {
TriggerAddEventChatMessage(libUTIL_gt_FloatingCombatText, c_playerAny, "floatingcombattext", false);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Display String
//--------------------------------------------------------------------------------------------------
bool libUTIL_gt_DisplayString_Func (bool testConds, bool runActions) {
// Variable Declarations
string lv_mode;
string lv_value;

// Automatic Variable Declarations
// Variable Initialization
lv_mode = "";
lv_value = "";

// Conditions
if (testConds) {
if (!(((StringWord(EventChatMessage(false), 1) == "str") || (StringWord(EventChatMessage(false), 1) == "string")))) {
return false;
}
}

// Actions
if (!runActions) {
return true;
}

GameSetSpeedValue(8);
if (((StringWord(EventChatMessage(false), 2) == null) && (StringWord(EventChatMessage(false), 3) == null))) {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Usage: <str|string> <TextExpressionAssemble|StringExternal> <value>"));
}
else {
lv_mode = StringWord(EventChatMessage(false), 2);
lv_value = StringWord(EventChatMessage(false), 3);
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText((lv_mode + lv_value)));
if ((lv_mode == "TextExpressionAssemble")) {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, TextExpressionAssemble(lv_value));
return true;
}

if ((lv_mode == "StringExternal")) {
UIDisplayMessage(PlayerGroupAll(), c_messageAreaSubtitle, StringExternal(lv_value));
return true;
}

UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Usage: <str|string> <TextExpressionAssemble|StringExternal> <value>"));
}
return true;
}

//--------------------------------------------------------------------------------------------------
void libUTIL_gt_DisplayString_Init () {
libUTIL_gt_DisplayString = TriggerCreate("libUTIL_gt_DisplayString_Func");
TriggerAddEventChatMessage(libUTIL_gt_DisplayString, c_playerAny, "str", false);
TriggerAddEventChatMessage(libUTIL_gt_DisplayString, c_playerAny, "string", false);
}

void libUTIL_InitTriggers () {
libUTIL_gt_MapInit_Init();
libUTIL_gt_ClearTextMessage_Init();
Expand All @@ -728,6 +784,7 @@ void libUTIL_InitTriggers () {
libUTIL_gt_ToggleACTS_Init();
libUTIL_gt_MinionWaveInterval_Init();
libUTIL_gt_FloatingCombatText_Init();
libUTIL_gt_DisplayString_Init();
}

//--------------------------------------------------------------------------------------------------
Expand Down
Binary file not shown.
34 changes: 34 additions & 0 deletions (10)trymemode.stormmap/base.stormdata/Modules/doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,40 @@
"description": "Shows the FCT \"999\" with the style of critical shield (white with explosion style)"
}
]
},
{
"shortCommand": "str",
"command": "string",
"description": [
"Display a string with the value of `TextExpressionAssemble` or `StringExternal`",
"This is pretty useful to quickly shows the string from the functions internally.",
"`mode` must be either `TextExpressionAssemble` or `StringExternal`"
],
"uiAvailable": false,
"parameters": [
{
"name": "mode",
"required": true,
"description": "Defines the mode of the string to be displayed.",
"type": "string"
},
{
"name": "value",
"required": true,
"description": "Defines the value of the string to be displayed",
"type": "string"
}
],
"examples": [
{
"command": "{shortCommand} TextExpressionAssemble Param/Expression/lib_Sprt_B1FD42AF",
"description": "Shows the string \"Set Mastery Ring...\" from supportlib"
},
{
"command": "{command} StringExternal Param/Value/lib_Sprt_F697F4C7",
"description": "Shows the string \"Game Speed should not exceed 8.0....\" from supportlib"
}
]
}
]
},
Expand Down
43 changes: 42 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<a name="meta-top"></a>

# Usage
<sup>*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Fri, 01 Jan 2021 13:16:33 GMT)*</sup>
<sup>*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Mon, 11 Jan 2021 19:36:43 GMT)*</sup>

Generally, most of the functionalities are using chat commands. Simply type the commands in the chat box (like how you would normally chat with teammates).
>Note: Remember to either use allies or all chat channel when try to use the commands. Public chat channels and Private Messages (PM) does not work.
Expand Down Expand Up @@ -50,6 +50,8 @@ Some of the commands have an UI counterpart implemented, which will display a me

- 💭 [Command: `startgame`](#cmd-startgame)

- 💭 [Command: `string`](#cmd-string)

- 💭 [Command: `toggledebugmode`](#cmd-toggledebugmode)

- 💭 [Command: `togglefogofwar`](#cmd-togglefogofwar)
Expand Down Expand Up @@ -568,6 +570,45 @@ Start the game instantly (timer start, gate open, etc).



[\[Return to Table of Contents 🧾\]](#meta-toc)

[\[Return to Top ⬆\]](#meta-top)

<a name="cmd-string"></a>

## (`string` | `str`) `<mode>` `<value>`
<a name="cmd-string-description"></a>

#### ✏ Description:
Display a string with the value of `TextExpressionAssemble` or `StringExternal`
This is pretty useful to quickly shows the string from the functions internally.
`mode` must be either `TextExpressionAssemble` or `StringExternal`

<a name="cmd-string-parameters"></a>

#### ⚙ Parameters:
<mode>
Required: true
Type: string
Usage: Defines the mode of the string to be displayed.
<value>
Required: true
Type: string
Usage: Defines the value of the string to be displayed
<a name="cmd-string-examples"></a>

#### 🔧 Examples:
> str TextExpressionAssemble Param/Expression/lib_Sprt_B1FD42AF
(Shows the string "Set Mastery Ring..." from supportlib)
> string StringExternal Param/Value/lib_Sprt_F697F4C7
(Shows the string "Game Speed should not exceed 8.0...." from supportlib)
<a name="cmd-string-uiAvailability"></a>

#### 🖼 UI Availability:
-**Not Implemented**



[\[Return to Table of Contents 🧾\]](#meta-toc)

[\[Return to Top ⬆\]](#meta-top)
Expand Down

0 comments on commit 0c00533

Please sign in to comment.