Skip to content

Commit

Permalink
Added "Toggle Terrain Indicator" command
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiephan committed Aug 26, 2021
1 parent bf6564a commit f1fe26c
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 1 deletion.
73 changes: 73 additions & 0 deletions (10)trymemode.stormmap/base.stormdata/Modules/LibUtilities.galaxy
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ revealer libUTIL_gv_revealer;
bool libUTIL_gv_isFOWEnabled;
bool libUTIL_gv_isMassCDREnabled;
int libUTIL_gv_massCDRPlayer;
bool libUTIL_gv_terrainIndicatorEnabled;
bool libUTIL_gv_isACTSEnabled;
int libUTIL_gv_crosshair_marker;
bool libUTIL_gv_isCrosshairEnabled;
Expand All @@ -39,6 +40,7 @@ trigger libUTIL_gt_ToggleFOW;
trigger libUTIL_gt_ToggleMassCDR;
trigger libUTIL_gt_RunMassCDR;
trigger libUTIL_gt_ToggleDebugMode;
trigger libUTIL_gt_ToggleTerrainIndicator;
trigger libUTIL_gt_WinGame;
trigger libUTIL_gt_StartGame;
trigger libUTIL_gt_EndGame;
Expand Down Expand Up @@ -342,6 +344,76 @@ void libUTIL_gt_ToggleDebugMode_Init () {
TriggerAddEventChatMessage(libUTIL_gt_ToggleDebugMode, c_playerAny, "toggledebugmode", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: Toggle Terrain Indicator
//--------------------------------------------------------------------------------------------------
bool libUTIL_gt_ToggleTerrainIndicator_Func (bool testConds, bool runActions) {
int init_i;

// Variable Declarations
unit lv_unit;
string[8] lv_collisionEdges;
string[8] lv_unitsWithCollisionEdges;
int lv_i;

// Automatic Variable Declarations
const int auto675D3D77_ae = 6;
const int auto675D3D77_ai = 1;

// Variable Initialization
lv_unit = UnitGroupUnit(UnitGroupSelected(EventPlayer()), 1);
for (init_i = 0; init_i <= 7; init_i += 1) {
lv_collisionEdges[init_i] = "";
}
for (init_i = 0; init_i <= 7; init_i += 1) {
lv_unitsWithCollisionEdges[init_i] = "";
}

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

lv_collisionEdges[0] = "AurielShowCollisionEdges";
lv_collisionEdges[1] = "HanzoShowCollisionEdges";
lv_collisionEdges[2] = "HoggerShowCollisionEdges";
lv_collisionEdges[3] = "JunkratShowCollisionEdges";
lv_collisionEdges[4] = "LucioShowCollisionEdges";
lv_collisionEdges[5] = "NexusHunterShowCollisionEdges";
lv_collisionEdges[6] = "DiabloShowCollisionEdges";
lv_unitsWithCollisionEdges[0] = "HeroAuriel";
lv_unitsWithCollisionEdges[1] = "HeroHanzo";
lv_unitsWithCollisionEdges[2] = "HeroHogger";
lv_unitsWithCollisionEdges[3] = "HeroJunkrat";
lv_unitsWithCollisionEdges[4] = "HeroLucio";
lv_unitsWithCollisionEdges[5] = "HeroNexusHunter";
lv_unitsWithCollisionEdges[6] = "HeroDiablo";
lv_i = 0;
for ( ; ( (auto675D3D77_ai >= 0 && lv_i <= auto675D3D77_ae) || (auto675D3D77_ai < 0 && lv_i >= auto675D3D77_ae) ) ; lv_i += auto675D3D77_ai ) {
if (((UnitGetType(lv_unit) == (lv_unitsWithCollisionEdges[lv_i])))) {
ActorSendTo(libNtve_gf_MainActorofUnit(lv_unit), lv_collisionEdges[lv_i], "Destroy Immediate");
}

}
libUTIL_gv_terrainIndicatorEnabled = !(libUTIL_gv_terrainIndicatorEnabled);
if ((libUTIL_gv_terrainIndicatorEnabled == true)) {
libNtve_gf_SendActorMessageToUnit(lv_unit, ("Create HanzoShowCollisionEdges"));
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Terrain Indicator Enabled"));
}
else {
ActorSendTo(libNtve_gf_MainActorofUnit(lv_unit), "HanzoShowCollisionEdges", "Destroy Immediate");
UIDisplayMessage(PlayerGroupAll(), c_messageAreaDebug, StringToText("Terrain Indicator Disabled"));
}
return true;
}

//--------------------------------------------------------------------------------------------------
void libUTIL_gt_ToggleTerrainIndicator_Init () {
libUTIL_gt_ToggleTerrainIndicator = TriggerCreate("libUTIL_gt_ToggleTerrainIndicator_Func");
TriggerAddEventChatMessage(libUTIL_gt_ToggleTerrainIndicator, c_playerAny, "tti", true);
TriggerAddEventChatMessage(libUTIL_gt_ToggleTerrainIndicator, c_playerAny, "toggleterrainindicator", true);
}

//--------------------------------------------------------------------------------------------------
// Trigger: WinGame
//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1430,6 +1502,7 @@ void libUTIL_InitTriggers () {
libUTIL_gt_ToggleMassCDR_Init();
libUTIL_gt_RunMassCDR_Init();
libUTIL_gt_ToggleDebugMode_Init();
libUTIL_gt_ToggleTerrainIndicator_Init();
libUTIL_gt_WinGame_Init();
libUTIL_gt_StartGame_Init();
libUTIL_gt_EndGame_Init();
Expand Down
Binary file not shown.
19 changes: 19 additions & 0 deletions (10)trymemode.stormmap/base.stormdata/Modules/doc.json
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,25 @@
"description": "Reset the game speed 2 (Normal)."
}
]
},
{
"shortCommand": "tti",
"command": "toggleterrainindicator",
"description": [
"Toggle Terrain Indicator (used by Diablo and Auriel, etc) for any units"
],
"uiAvailable": false,
"parameters": [],
"examples": [
{
"command": "{shortCommand}",
"description": "Toggle Terrain Indicator"
},
{
"command": "{command}",
"description": "Toggle Terrain Indicator"
}
]
}
]
},
Expand Down
39 changes: 38 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a name="meta-top"></a>

# Usage
<sup>*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Tue, 29 Jun 2021 17:29:49 GMT)*</sup>
<sup>*(Generated from [doc.json](./(10)trymemode.stormmap/base.stormdata/Modules/doc.json) at Thu, 26 Aug 2021 17:03:35 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 @@ -83,6 +83,8 @@ Some of the commands have an UI counterpart implemented, which will display a me

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

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

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

- 💭 [Command: `wingame`](#cmd-wingame)
Expand Down Expand Up @@ -1317,6 +1319,41 @@ Run this command to turn off this functionality.
[\[Return to Table of Contents 🧾\]](#meta-toc)
[\[Return to Top ⬆\]](#meta-top)
<a name="cmd-toggleterrainindicator"></a>
## (`toggleterrainindicator` | `tti`)
<a name="cmd-toggleterrainindicator-description"></a>
#### ✏ Description:
Toggle Terrain Indicator (used by Diablo and Auriel, etc) for any units
<a name="cmd-toggleterrainindicator-parameters"></a>
#### ⚙ Parameters:
None
<a name="cmd-toggleterrainindicator-examples"></a>
#### 🔧 Examples:
> tti
(Toggle Terrain Indicator)
> toggleterrainindicator
(Toggle Terrain Indicator)
<a name="cmd-toggleterrainindicator-uiAvailability"></a>
#### 🖼 UI Availability:
- ❌ **Not Implemented**
[\[Return to Table of Contents 🧾\]](#meta-toc)
[\[Return to Top ⬆\]](#meta-top)
Expand Down

0 comments on commit f1fe26c

Please sign in to comment.