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
tweaks
  • Loading branch information
N1Ran committed Jan 25, 2019
commit aca4c2b2b77faa83e437edc799fcb8460ce6d2ae
2 changes: 1 addition & 1 deletion Essentials/AutoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public string VoteDuration
public int Percentage
{
get => _votepercentage;
set => SetValue(ref _votepercentage, value);
set => SetValue(ref _votepercentage, Math.Min(value, 100));
}

[Display(Name = "Day of week", GroupName = "Schedule", Description = "Combined with Scheduled Time, will run the command on the given day of the week at the set time.")]
Expand Down
6 changes: 6 additions & 0 deletions Essentials/Commands/InfoModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using Torch.API.Managers;
using Torch.Mod;
using Torch.Mod.Messages;
using Sandbox.Game;
using Sandbox.Game.World;
using VRage.Game;

namespace Essentials.Commands
Expand Down Expand Up @@ -34,10 +36,14 @@ private static void MessageProcessing(Torch.API.Managers.TorchChatMessage msg, r
return;

consumed = true;
long playerId = MySession.Static.Players.TryGetIdentityId(msg.AuthorSteamId.Value);

if (!string.IsNullOrEmpty(c.ChatResponse))
EssentialsPlugin.Instance.Torch.CurrentSession?.Managers?.GetManager<IChatManagerServer>()?.SendMessageAsOther("Server", c.ChatResponse, MyFontEnum.Blue, msg.AuthorSteamId.Value);
if (!string.IsNullOrEmpty(c.DialogResponse))
ModCommunication.SendMessageTo(new DialogMessage(c.Command, content: c.DialogResponse), msg.AuthorSteamId.Value);
if (!string.IsNullOrEmpty(c.URL))
MyVisualScriptLogicProvider.OpenSteamOverlay($"https://steamcommunity.com/linkfilter/?url={c.URL}", playerId);
}
}
}
2 changes: 1 addition & 1 deletion Essentials/Commands/VotingModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void Vote(string name)
});

Context.Torch.CurrentSession?.Managers?.GetManager<IChatManagerServer>()?.SendMessageAsSelf($"Voting started for {name} by {Context.Player.DisplayName}. " +
$"Use '!yes' to vote and '!no' to retract your vote");
$"Use '!yes' to vote and '!no' to retract your vote");

}

Expand Down
9 changes: 8 additions & 1 deletion Essentials/InfoCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class InfoCommand : ViewModel
private string _command;
private string _chatResponse;
private string _dialogResponse;
private string _urlResponse;

public string Command
{
Expand All @@ -26,7 +27,13 @@ public string DialogResponse
get => _dialogResponse;
set => SetValue(ref _dialogResponse, value);
}


public string URL
{
get => _urlResponse;
set => SetValue(ref _urlResponse, value);
}

public override string ToString()
{
return Command;
Expand Down