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
GPS Marker for grids list command
  • Loading branch information
N1Ran committed Feb 9, 2019
commit aeb591a7a5d9659196a0d15104e3eb7bfcae14f6
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