Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added GPS marker option to Grids list command
  • Loading branch information
N1Ran committed Feb 11, 2019
commit e8a59a6c20db310d530bd0f958d940c442a03f14
5 changes: 5 additions & 0 deletions Essentials/Commands/GridModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Text;
using Sandbox;
using Sandbox.Game.Entities;
using Sandbox.ModAPI;
using Torch.API.Managers;
using Torch.Commands;
using Torch.Commands.Permissions;
Expand Down Expand Up @@ -97,7 +98,11 @@ public void List()

if (grid.BigOwners.Contains(id))
{
var gridGPS = MyAPIGateway.Session?.GPS.Create(grid.DisplayName, ($"{grid.DisplayName} - {grid.GridSizeEnum} - {grid.BlocksCount} blocks"), grid.PositionComp.GetPosition(), true);
Comment thread
N1Ran marked this conversation as resolved.
Outdated

sb.AppendLine($"{grid.DisplayName} - {grid.GridSizeEnum} - {grid.BlocksCount} blocks - Position {(EssentialsPlugin.Instance.Config.UtilityShowPosition ? grid.PositionComp.GetPosition().ToString() : "Unknown")}");
if (EssentialsPlugin.Instance.Config.MarkerShowPosition)
MyAPIGateway.Session?.GPS.AddGps(Context.Player.IdentityId, gridGPS);
}
}

Expand Down
9 changes: 9 additions & 0 deletions Essentials/EssentialsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ public bool UtilityShowPosition
set => SetValue(ref _utilityShowPosition, value);
}

private bool _markerShowPosition;

[Display(Name = "Grid list GPS marker",Description ="Show uservers the poition of all grids they own by gps marker")]
public bool MarkerShowPosition
{
get => _markerShowPosition;
set => SetValue(ref _markerShowPosition, value);
}

private int _backpackLimit = 1;
[Display(Name = "Backpack Limit", Description = "Sets the number of backpacks that can belong to any player. Empty backpacks are deleted after 30 seconds, and backpacks which break the limit are deleted in order spawned. Set -1 for no limit.")]
public int BackpackLimit
Expand Down