Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Source/Client/Settings/MpSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class MpSettings : ModSettings
public bool hideOtherPlayersInColonistBar = false;
public bool hideOtherPlayersQuests = false;

public string mostRecentVersionWelcomed = "";

internal static readonly ColorRGBClient[] DefaultPlayerColors =
{
Expand Down Expand Up @@ -82,6 +83,8 @@ public override void ExposeData()

Scribe_Deep.Look(ref serverSettingsClient, "serverSettings");
serverSettingsClient ??= new ServerSettingsClient();

Scribe_Values.Look(ref mostRecentVersionWelcomed, "playerWelcomedToThisVersion", "");
}
}

Expand Down
9 changes: 6 additions & 3 deletions Source/Client/UI/MainMenuAnimation.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using HarmonyLib;
using Multiplayer.Client.Util;
using RimWorld;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using UnityEngine;
using Verse;
using Random = System.Random;
Expand Down Expand Up @@ -436,4 +437,6 @@ static void Postfix(ref bool __result)
__result = false;
}
}


}
47 changes: 47 additions & 0 deletions Source/Client/Windows/ServerBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,40 @@

namespace Multiplayer.Client
{
public static class WelcomeMessage
{
public static bool welcomedThisSession = false;

public static string version => "MpWelcomeVersion".Translate();


public static string Title()
{
string title = "MpWelcomeTitle".Translate(version) ;
return title;
}
public static TaggedString Message()
{
TaggedString message = "MpWelcomeMessage".Translate() + "\n\n";

int issueCount = 1;
string knownIssueKey = "MpKnownIssue";

//while (LanguageDatabase.activeLanguage.HaveTextForKey(knownIssueKey + issueCount))
foreach (var thing in LanguageDatabase.activeLanguage.keyedReplacements.Where(kvp => kvp.Key.StartsWith(knownIssueKey)))
{
message += "- " + (thing.Key).Translate() + "\n";
issueCount++;
}

message += "\n\n" + "MpWelcomeCompleteList".Translate();
message += "\n\n" + "MpWelcomePrepatcher".Translate();
message += "\n\n" + "MpWelcomeDiscord".Translate();

return message;
}
}

public class ServerBrowser : Window
{
private LanListener lanListener;
Expand All @@ -41,6 +75,19 @@ enum Tabs
Lan, Direct, Steam, Host
}

public override void PostOpen()
{
if ((Multiplayer.settings.mostRecentVersionWelcomed == WelcomeMessage.version && Multiplayer.settings.mostRecentVersionWelcomed != "testing" )|| WelcomeMessage.welcomedThisSession) return;
Find.WindowStack.Add(new Dialog_MessageBox(WelcomeMessage.Message(), title: WelcomeMessage.Title(), buttonBAction: () =>
{
Multiplayer.settings.mostRecentVersionWelcomed = WelcomeMessage.version;
Multiplayer.settings.Write();
}, buttonBText: "MpWelcomeNeverShowButton".Translate()));
WelcomeMessage.welcomedThisSession = true;
}



public override void DoWindowContents(Rect inRect)
{
DrawInfoButtons();
Expand Down
Loading