-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'things' of https://github.com/Hqlle/Lost-Paradise into …
…things
- Loading branch information
Showing
193 changed files
with
1,979 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using Content.Shared._LostParadise.Roadmap; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface; | ||
using System.Numerics; | ||
|
||
namespace Content.Client._LostParadise.Roadmap | ||
{ | ||
public class RoadmapControl : Control | ||
{ | ||
private readonly RoadmapPrototype _prototype; | ||
private readonly ProgressBar _progressBar; | ||
|
||
public RoadmapControl(RoadmapPrototype prototype) | ||
{ | ||
_prototype = prototype; | ||
_progressBar = new ProgressBar | ||
{ | ||
MinValue = 0, | ||
MaxValue = 100, | ||
Value = _prototype.Progress, | ||
HorizontalExpand = true | ||
}; | ||
|
||
SetupUI(); | ||
} | ||
|
||
private void SetupUI() | ||
{ | ||
Margin = new Thickness(0, 20, 0, 0); | ||
|
||
var vBox = new BoxContainer | ||
{ | ||
Orientation = BoxContainer.LayoutOrientation.Vertical | ||
}; | ||
|
||
var nameButton = new Button | ||
{ | ||
Text = _prototype.Name, | ||
StyleClasses = { "Caution" }, | ||
HorizontalExpand = true | ||
}; | ||
|
||
vBox.AddChild(nameButton); | ||
|
||
var descriptionLabel = new Label { Text = _prototype.Description, FontColorOverride = Color.LightGray }; | ||
var progressLabel = new Label | ||
{ | ||
Text = Loc.GetString("roadmap-progress") + $": {_prototype.Progress}%", | ||
FontColorOverride = Color.White | ||
}; | ||
|
||
var statusBox = new BoxContainer | ||
{ | ||
Orientation = BoxContainer.LayoutOrientation.Horizontal, | ||
HorizontalExpand = true, | ||
SeparationOverride = 5 | ||
}; | ||
|
||
var statusLabel = new Label | ||
{ | ||
Text = Loc.GetString("roadmap-status") + $": {Loc.GetString(_prototype.Status)}", | ||
FontColorOverride = GetStatusColor(), | ||
}; | ||
|
||
statusBox.AddChild(statusLabel); | ||
statusBox.AddChild(new Control { HorizontalExpand = true }); | ||
|
||
vBox.AddChild(descriptionLabel); | ||
vBox.AddChild(progressLabel); | ||
vBox.AddChild(_progressBar); | ||
vBox.AddChild(statusBox); | ||
|
||
var separator = new PanelContainer | ||
{ | ||
Modulate = new Color(0.5f, 0.5f, 0.5f, 1f), | ||
MinSize = new Vector2(0, 2), | ||
HorizontalExpand = true | ||
}; | ||
vBox.AddChild(separator); | ||
|
||
AddChild(vBox); | ||
} | ||
|
||
private Color GetStatusColor() | ||
{ | ||
string status = _prototype.Status; | ||
return status switch | ||
{ | ||
"roadmap-goal-completed" => new Color(0.0f, 1.0f, 0.0f), | ||
"roadmap-goal-progress" => new Color(1.0f, 1.0f, 0.0f), | ||
"roadmap-goal-waiting" => new Color(1.0f, 0.5f, 0.0f), | ||
_ => Color.White | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
using Content.Shared._LostParadise.Roadmap; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface; | ||
using Robust.Shared.IoC; | ||
using Robust.Shared.Prototypes; | ||
using System.Numerics; | ||
using Robust.Client.UserInterface.CustomControls; | ||
using Robust.Client.UserInterface.Controllers; | ||
using System.Linq; | ||
|
||
namespace Content.Client._LostParadise.Roadmap | ||
{ | ||
public sealed class RoadmapUI : UIController | ||
{ | ||
private DefaultWindow _roadmapWindow; | ||
|
||
public RoadmapUI() | ||
{ | ||
_roadmapWindow = new DefaultWindow | ||
{ | ||
Title = Loc.GetString("roadmap-plan-LLP"), | ||
SetSize = new Vector2(600, 600), | ||
Resizable = false | ||
}; | ||
|
||
var panelContainer = new PanelContainer | ||
{ | ||
MinSize = new Vector2(580, 580), | ||
ModulateSelfOverride = Color.Transparent, | ||
Margin = new Thickness(10) | ||
}; | ||
|
||
var scrollContainer = new ScrollContainer | ||
{ | ||
HorizontalExpand = true, | ||
VerticalExpand = true, | ||
Margin = new Thickness(0, 20, 0, 0) | ||
}; | ||
|
||
var phaseList = new BoxContainer | ||
{ | ||
Orientation = BoxContainer.LayoutOrientation.Vertical, | ||
SeparationOverride = 10 | ||
}; | ||
|
||
scrollContainer.AddChild(phaseList); | ||
panelContainer.AddChild(scrollContainer); | ||
_roadmapWindow.AddChild(panelContainer); | ||
|
||
RefreshUI(phaseList); | ||
} | ||
|
||
private void RefreshUI(BoxContainer phaseList) | ||
{ | ||
phaseList.RemoveAllChildren(); | ||
|
||
var roadmapSystem = IoCManager.Resolve<IPrototypeManager>(); | ||
|
||
var roadmapPhases = roadmapSystem.EnumeratePrototypes<RoadmapPrototype>() | ||
.OrderBy<RoadmapPrototype, int>(phase => phase.Order); | ||
|
||
foreach (var phase in roadmapPhases) | ||
{ | ||
var phaseControl = new RoadmapControl(phase); | ||
phaseList.AddChild(phaseControl); | ||
} | ||
} | ||
|
||
public void ToggleRoadmap() | ||
{ | ||
if (_roadmapWindow.IsOpen) | ||
{ | ||
_roadmapWindow.Close(); | ||
} | ||
else | ||
{ | ||
_roadmapWindow.OpenCentered(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Content.Server.Chat.Systems; | ||
using Content.Shared.Administration; | ||
using Content.Shared.Chat; | ||
using Robust.Shared.Console; | ||
using Robust.Shared.Enums; | ||
|
||
namespace Content.Server.Chat.Commands | ||
{ | ||
[AnyCommand] | ||
internal sealed class HiddenMeCommand : IConsoleCommand | ||
{ | ||
public string Command => "hme"; | ||
public string Description => "Perform an action."; | ||
public string Help => "hme <text>"; | ||
|
||
public void Execute(IConsoleShell shell, string argStr, string[] args) | ||
{ | ||
if (shell.Player is not { } player) | ||
{ | ||
shell.WriteError("This command cannot be run from the server."); | ||
return; | ||
} | ||
|
||
if (player.Status != SessionStatus.InGame) | ||
return; | ||
|
||
if (player.AttachedEntity is not {} playerEntity) | ||
{ | ||
shell.WriteError("You don't have an entity!"); | ||
return; | ||
} | ||
|
||
if (args.Length < 1) | ||
return; | ||
|
||
var message = string.Join(" ", args).Trim(); | ||
if (string.IsNullOrEmpty(message)) | ||
return; | ||
|
||
IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ChatSystem>() | ||
.TrySendInGameICMessage(playerEntity, message, InGameICChatType.HiddenEmote, ChatTransmitRange.GhostRangeLimit, false, shell, player); | ||
} | ||
} | ||
} |
Oops, something went wrong.