Launcher can be minimized to a small bar in the start menu
A '-' button collapses the fullscreen launcher into a small MSCO bar at the top; the game's start menu is visible and clickable again and its music is unmuted. Clicking the bar opens the launcher; prompts (disconnected, reconnecting, join confirmation, version warning) open it automatically. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
- Geht jetzt auch, **wenn noch niemand fährt** (Sitzposition kommt aus dem Fahrersitz des Spiels); fährt danach jemand
|
||||
los, fährt man mit. Setzt man sich selbst ans Steuer, endet der Beifahrer-Modus
|
||||
|
||||
**Launcher einklappen**
|
||||
- Knopf **–** oben rechts im Launcher: er klappt zu einer kleinen MSCO-Leiste oben zusammen, das Startmenü des Spiels
|
||||
(Optionen, Farbe, Musik ...) ist wieder sichtbar und bedienbar, die Menü-Musik läuft wieder. Klick auf die Leiste
|
||||
öffnet den Launcher. Bei Meldungen (getrennt, neu verbinden, Beitreten bestätigen) klappt er von selbst auf
|
||||
|
||||
**Satsuma vollständiger synchron**
|
||||
- Zustand aller Satsuma-Teile wird jetzt übertragen - auch der Teile, die das Spiel außerhalb des Autos verwaltet
|
||||
(CARPARTS und die Teile-Datenbank): Verschleiß (Kolben, Kupplung, Getriebe, Lichtmaschine ...), beschädigte Teile
|
||||
|
||||
+38
-2
@@ -79,8 +79,14 @@ namespace MSCO
|
||||
/// <summary>Fläche, die das Fenster gerade belegt (GUI-Koordinaten, oben = 0).</summary>
|
||||
public Rect ScreenRect { get; private set; }
|
||||
|
||||
/// <summary>Der Launcher füllt im Hauptmenü immer den ganzen Bildschirm - das Spielmenü dahinter ist gesperrt.</summary>
|
||||
public bool IsOpen { get { return true; } }
|
||||
/// <summary>
|
||||
/// Eingeklappt: nur eine kleine MSCO-Leiste oben, das Startmenü des Spiels (Optionen, Farbe, Musik ...) ist wieder
|
||||
/// sichtbar und bedienbar. Bei Meldungen (getrennt, neu verbinden, beitreten ...) klappt der Launcher von selbst auf.
|
||||
/// </summary>
|
||||
public bool Minimized { get; set; }
|
||||
|
||||
/// <summary>Aufgeklappt füllt der Launcher den ganzen Bildschirm - das Spielmenü dahinter ist dann gesperrt.</summary>
|
||||
public bool IsOpen { get { return !Minimized; } }
|
||||
|
||||
/// <summary>Ist die Maus gerade über dem Fenster bzw. der eingeklappten Leiste?</summary>
|
||||
public bool ContainsMouse()
|
||||
@@ -95,6 +101,11 @@ namespace MSCO
|
||||
EnsureStyles(); // baut die Stile neu, wenn sich die Skalierung ändert (Auflösung gewechselt)
|
||||
vw = Screen.width;
|
||||
vh = Screen.height;
|
||||
// Wichtige Meldungen nie hinter der eingeklappten Leiste verstecken
|
||||
if (Minimized && !mp.IsInSession && (mp.DisconnectNotice != null || mp.PendingJoinHost != null || mp.PendingVersionWarning != null))
|
||||
Minimized = false;
|
||||
if (Minimized && mp.IsReconnecting) Minimized = false;
|
||||
if (Minimized) { DrawMinimized(mp); return; }
|
||||
ScreenRect = new Rect(0, 0, Screen.width, Screen.height);
|
||||
DrawScaled(mp);
|
||||
}
|
||||
@@ -130,6 +141,31 @@ namespace MSCO
|
||||
GUILayout.EndArea();
|
||||
|
||||
DrawStatusBar(mp, new Rect(0, vh - S(StatusHeight), vw, S(StatusHeight)));
|
||||
|
||||
// Einklappen (oben rechts): das Startmenü des Spiels wird wieder sichtbar
|
||||
var minimize = new Rect(vw - S(54), S(12), S(40), S(32));
|
||||
if (GUI.Button(minimize, new GUIContent("–", "Minimize - show the game's start menu"), secondaryStyle)) Minimized = true;
|
||||
}
|
||||
|
||||
/// <summary>Eingeklappt: kleine Leiste oben in der Mitte mit Verbindungsstand - Klick öffnet den Launcher wieder.</summary>
|
||||
void DrawMinimized(MultiplayerManager mp)
|
||||
{
|
||||
float w = S(300), h = S(40);
|
||||
var bar = new Rect(Mathf.Round((vw - w) / 2f), S(10), w, h);
|
||||
ScreenRect = bar;
|
||||
GUI.Box(bar, GUIContent.none, sidebarBox);
|
||||
Texture2D logo = Branding.LogoTexture;
|
||||
float x = bar.x + S(10);
|
||||
if (logo != null)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(x, bar.y + S(6), S(28), S(28)), logo);
|
||||
x += S(36);
|
||||
}
|
||||
Texture2D dot = mp.IsFullyConnected ? texOnline : mp.IsInSession || mp.IsReconnecting ? texPending : texMuted;
|
||||
GUI.DrawTexture(new Rect(x, bar.y + (h - S(8)) / 2f, S(8), S(8)), dot);
|
||||
string text = mp.IsInSession ? "MSCO · " + mp.Players.Count + " player(s) · open" : "MSCO · open multiplayer";
|
||||
GUI.Label(new Rect(x + S(16), bar.y, bar.xMax - x - S(24), h), text, statusStyle);
|
||||
if (GUI.Button(bar, new GUIContent("", "Open the MSCO launcher"), GUIStyle.none)) Minimized = false;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------- Bereiche
|
||||
|
||||
@@ -84,11 +84,21 @@ namespace MSCO
|
||||
var src = (AudioSource)o;
|
||||
if (src == null || src.mute || src.transform.root.name.StartsWith("MSCO")) continue;
|
||||
src.mute = true;
|
||||
mutedByUs.Add(src);
|
||||
muted++;
|
||||
}
|
||||
return muted;
|
||||
}
|
||||
|
||||
static readonly System.Collections.Generic.List<AudioSource> mutedByUs = new System.Collections.Generic.List<AudioSource>();
|
||||
|
||||
/// <summary>Launcher eingeklappt: die von uns stummgeschalteten Menü-Geräusche wieder an.</summary>
|
||||
public static void UnmuteMenuAudio()
|
||||
{
|
||||
foreach (AudioSource src in mutedByUs) if (src != null) src.mute = false;
|
||||
mutedByUs.Clear();
|
||||
}
|
||||
|
||||
public static void StartGame()
|
||||
{
|
||||
PlayMakerFSM fsm;
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace MSCO
|
||||
readonly TrafficSync traffic = new TrafficSync();
|
||||
readonly HingeSync hinges = new HingeSync();
|
||||
readonly ControlSync controls = new ControlSync();
|
||||
bool lobbyWasMinimized;
|
||||
float nextControlResync;
|
||||
readonly Toasts toasts = new Toasts();
|
||||
float nextNeedsSend;
|
||||
@@ -972,7 +973,13 @@ namespace MSCO
|
||||
{
|
||||
nextMenuButtonCheck = Time.realtimeSinceStartup + 0.5f;
|
||||
menuButtonsHidden = MenuHelper.HideGameMenuButtons() > 0;
|
||||
MenuHelper.MuteMenuAudio(); // Launcher im Vollbild: Menü-Musik/-Geräusche aus
|
||||
if (!lobby.Minimized) MenuHelper.MuteMenuAudio(); // Launcher im Vollbild: Menü-Musik/-Geräusche aus
|
||||
}
|
||||
// Launcher eingeklappt: Menü-Musik wieder an; aufgeklappt: wieder aus
|
||||
if (MenuHelper.InMenu && lobby.Minimized != lobbyWasMinimized)
|
||||
{
|
||||
lobbyWasMinimized = lobby.Minimized;
|
||||
if (lobby.Minimized) MenuHelper.UnmuteMenuAudio(); else MenuHelper.MuteMenuAudio();
|
||||
}
|
||||
UpdateOverlayKeys();
|
||||
PersistPendingState(); // Kick-Grund / Neu-Verbinden über das Neuladen der Mods hinweg merken
|
||||
|
||||
Reference in New Issue
Block a user