Cut 10a: cross-zone orbital drop altitudes, squad formation spawns, and wide drop FOV
This commit is contained in:
parent
42b17c168e
commit
26f5438ed5
24 changed files with 1754 additions and 211 deletions
|
|
@ -22,11 +22,13 @@ public sealed partial class MainMenu : CanvasLayer
|
|||
private ImperialChromePanel _menuPanel = null!;
|
||||
private ImperialChromePanel _hostPanel = null!;
|
||||
private LineEdit _callsignEdit = null!;
|
||||
private OptionButton _soloSquadOption = null!;
|
||||
private Label _statusLabel = null!;
|
||||
|
||||
private LineEdit _serverNameEdit = null!;
|
||||
private LineEdit _portEdit = null!;
|
||||
private OptionButton _hostMapOption = null!;
|
||||
private OptionButton _hostSquadOption = null!;
|
||||
private CheckBox _listPublicCheck = null!;
|
||||
private Label _directoryHintLabel = null!;
|
||||
private Label _hostErrorLabel = null!;
|
||||
|
|
@ -42,9 +44,9 @@ public sealed partial class MainMenu : CanvasLayer
|
|||
Layer = 20;
|
||||
}
|
||||
|
||||
public event Action<ArenaMapKind, string>? PlaySoloRequested;
|
||||
public event Action<ArenaMapKind, string, byte>? PlaySoloRequested;
|
||||
public event Action<string>? ServerBrowserRequested;
|
||||
public event Action<int, string, ArenaMapKind, bool, string>? HostLobbyRequested;
|
||||
public event Action<int, string, ArenaMapKind, bool, string, byte>? HostLobbyRequested;
|
||||
public event Action<string>? CallsignChanged;
|
||||
public event Action? QuitRequested;
|
||||
public event Action? ResumeRequested;
|
||||
|
|
@ -97,13 +99,16 @@ public sealed partial class MainMenu : CanvasLayer
|
|||
}
|
||||
}
|
||||
|
||||
public void SetDefaults(string callsign, string directoryUrl, ArenaMapKind defaultMap = ArenaMapKind.Sion, int defaultPort = 3076)
|
||||
public void SetDefaults(string callsign, string directoryUrl, ArenaMapKind defaultMap = ArenaMapKind.Sion, int defaultPort = 3076, byte defaultSquadSize = 3)
|
||||
{
|
||||
_directoryUrl = directoryUrl ?? string.Empty;
|
||||
if (_callsignEdit is not null)
|
||||
{
|
||||
_callsignEdit.Text = SanitizeCallsign(callsign);
|
||||
}
|
||||
int sqIdx = Math.Clamp((int)defaultSquadSize, 1, 4) - 1;
|
||||
_soloSquadOption?.Select(sqIdx);
|
||||
_hostSquadOption?.Select(sqIdx);
|
||||
if (_portEdit is not null)
|
||||
{
|
||||
_portEdit.Text = defaultPort.ToString(CultureInfo.InvariantCulture);
|
||||
|
|
@ -120,6 +125,14 @@ public sealed partial class MainMenu : CanvasLayer
|
|||
}
|
||||
}
|
||||
|
||||
public byte SelectedSoloSquadSize => _soloSquadOption is not null
|
||||
? (byte)Math.Clamp(_soloSquadOption.Selected + 1, 1, 4)
|
||||
: (byte)3;
|
||||
|
||||
public byte SelectedHostSquadSize => _hostSquadOption is not null
|
||||
? (byte)Math.Clamp(_hostSquadOption.Selected + 1, 1, 4)
|
||||
: (byte)3;
|
||||
|
||||
public void SetStatus(string? message, bool isError = false)
|
||||
{
|
||||
if (_statusLabel is null) return;
|
||||
|
|
@ -213,14 +226,26 @@ public sealed partial class MainMenu : CanvasLayer
|
|||
_callsignEdit.TextChanged += txt => CallsignChanged?.Invoke(SanitizeCallsign(txt));
|
||||
callRow.AddChild(_callsignEdit);
|
||||
|
||||
var squadRow = new HBoxContainer();
|
||||
squadRow.AddThemeConstantOverride("separation", 10);
|
||||
vbox.AddChild(squadRow);
|
||||
|
||||
var squadLbl = ImperialChrome.CreateLabel("SQUAD MODE", 12, ImperialChrome.TextMuted);
|
||||
squadLbl.CustomMinimumSize = new Vector2(82f, 0f);
|
||||
squadRow.AddChild(squadLbl);
|
||||
|
||||
_soloSquadOption = CreateSquadOptionButton();
|
||||
_soloSquadOption.ItemSelected += idx => _hostSquadOption?.Select((int)idx);
|
||||
squadRow.AddChild(_soloSquadOption);
|
||||
|
||||
vbox.AddChild(ImperialChrome.MakeRule());
|
||||
|
||||
var playSionBtn = ImperialChrome.CreateButton("PLAY SOLO — SION", ImperialChrome.OliveCol, 14, 38f);
|
||||
playSionBtn.Pressed += () => PlaySoloRequested?.Invoke(ArenaMapKind.Sion, Callsign);
|
||||
playSionBtn.Pressed += () => PlaySoloRequested?.Invoke(ArenaMapKind.Sion, Callsign, SelectedSoloSquadSize);
|
||||
vbox.AddChild(playSionBtn);
|
||||
|
||||
var playDesertBtn = ImperialChrome.CreateButton("PLAY SOLO — DESERT", ImperialChrome.OrangeCol, 14, 38f);
|
||||
playDesertBtn.Pressed += () => PlaySoloRequested?.Invoke(ArenaMapKind.Desert, Callsign);
|
||||
playDesertBtn.Pressed += () => PlaySoloRequested?.Invoke(ArenaMapKind.Desert, Callsign, SelectedSoloSquadSize);
|
||||
vbox.AddChild(playDesertBtn);
|
||||
|
||||
var browserBtn = ImperialChrome.CreateButton("SERVER BROWSER", ImperialChrome.CyanCol, 14, 38f);
|
||||
|
|
@ -314,6 +339,15 @@ public sealed partial class MainMenu : CanvasLayer
|
|||
ImperialChrome.StyleOptionButton(_hostMapOption, ImperialChrome.OliveCol, 13);
|
||||
mapRow.AddChild(_hostMapOption);
|
||||
|
||||
var hostSqRow = new HBoxContainer();
|
||||
hostSqRow.AddThemeConstantOverride("separation", 8);
|
||||
vbox.AddChild(hostSqRow);
|
||||
var hostSqLbl = ImperialChrome.CreateLabel("SQUAD MODE", 11, ImperialChrome.TextMuted);
|
||||
hostSqLbl.CustomMinimumSize = new Vector2(106f, 0f);
|
||||
hostSqRow.AddChild(hostSqLbl);
|
||||
_hostSquadOption = CreateSquadOptionButton();
|
||||
hostSqRow.AddChild(_hostSquadOption);
|
||||
|
||||
_listPublicCheck = new CheckBox
|
||||
{
|
||||
Text = "List on Public Directory",
|
||||
|
|
@ -361,7 +395,22 @@ public sealed partial class MainMenu : CanvasLayer
|
|||
bool listPublic = _listPublicCheck.ButtonPressed;
|
||||
|
||||
SetHostError(null);
|
||||
HostLobbyRequested?.Invoke(port, serverName, mapKind, listPublic, Callsign);
|
||||
HostLobbyRequested?.Invoke(port, serverName, mapKind, listPublic, Callsign, SelectedHostSquadSize);
|
||||
}
|
||||
|
||||
private static OptionButton CreateSquadOptionButton()
|
||||
{
|
||||
var opt = new OptionButton
|
||||
{
|
||||
SizeFlagsHorizontal = Control.SizeFlags.ExpandFill
|
||||
};
|
||||
opt.AddItem("FFA (1)", 0);
|
||||
opt.AddItem("DUO (2)", 1);
|
||||
opt.AddItem("TRIO (3)", 2);
|
||||
opt.AddItem("QUAD (4)", 3);
|
||||
opt.Select(2);
|
||||
ImperialChrome.StyleOptionButton(opt, ImperialChrome.CyanCol, 13);
|
||||
return opt;
|
||||
}
|
||||
|
||||
private void BuildPauseRoot()
|
||||
|
|
|
|||
Loading…
Reference in a new issue