Skip to content

Commit b024051

Browse files
committed
Extra info dropdown on project error
1 parent 827c87a commit b024051

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
lines changed

YAFC/Windows/AboutScreen.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace YAFC
88
{
99
public class AboutScreen : WindowUtility
1010
{
11+
public const string Github = "https://github.com/ShadowTheAge/yafc";
12+
1113
public AboutScreen(Window parent) : base(ImGuiUtils.DefaultScreenPadding)
1214
{
1315
Create("About YAFC", 50, parent);
@@ -30,7 +32,7 @@ protected override void BuildContents(ImGui gui)
3032
using (gui.EnterRow(0.3f))
3133
{
3234
gui.BuildText("Github YAFC page and documentation:");
33-
BuildLink(gui, "https://github.com/ShadowTheAge/yafc");
35+
BuildLink(gui, Github);
3436
}
3537
gui.AllocateSpacing(1.5f);
3638
gui.BuildText("Free and open-source third-party libraries used:", Font.subheader);

YAFC/Windows/MainScreen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ private async void DoCheckForUpdates()
429429
MessageBox.Show((hasAnswer, answer) =>
430430
{
431431
if (answer)
432-
AboutScreen.VisitLink("https://github.com/ShadowTheAge/yafc/releases");
432+
AboutScreen.VisitLink(AboutScreen.Github + "/releases");
433433
}, "Network error", "There were an error while checking versions.", "Open releases url", "Close");
434434
}
435435
}

YAFC/Windows/WelcomeScreen.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,12 @@ protected override void BuildContents(ImGui gui)
8383
else if (errorMessage != null)
8484
{
8585
errorScroll.Build(gui);
86-
gui.BuildText("This error is critical. Unable to load project.");
86+
using (gui.EnterRow())
87+
{
88+
gui.BuildText("This error is critical. Unable to load project.");
89+
if (gui.BuildLink("More info"))
90+
ShowDropDown(gui, gui.lastRect, ProjectErrorMoreInfo, new Padding(0.5f), 30f);
91+
}
8792
if (gui.BuildButton("Back"))
8893
{
8994
errorMessage = null;
@@ -131,6 +136,17 @@ protected override void BuildContents(ImGui gui)
131136
}
132137
}
133138

139+
private void ProjectErrorMoreInfo(ImGui gui, ref bool b)
140+
{
141+
gui.allocator = RectAllocator.LeftAlign;
142+
gui.BuildText("Check that these mods load in Factorio", wrap:true);
143+
gui.BuildText("YAFC only supports loading mods that were loaded in Factorio before. If you add or remove mods or change startup settings, you need to load those in Factorio and then close the game because Factorio writes some files only when exiting", wrap:true);
144+
gui.BuildText("Check that Factorio loads mods from the same folder as YAFC", wrap:true);
145+
if (gui.BuildLink("If this doesn't help, create a github issue"))
146+
AboutScreen.VisitLink(AboutScreen.Github);
147+
gui.BuildText("For these types of errors simple mod list will not be enough. You need to attach a 'New game' savegame for syncing mods, mod versions and mod settings.", wrap:true);
148+
}
149+
134150
private void LanguageSelection(ImGui gui, ref bool closed)
135151
{
136152
gui.spacing = 0f;
@@ -149,7 +165,7 @@ private void LanguageSelection(ImGui gui, ref bool closed)
149165
gui.AllocateSpacing(0.5f);
150166
gui.BuildText("If your language is missing visit");
151167
if (gui.BuildLink("this link for a workaround"))
152-
AboutScreen.VisitLink("https://github.com/ShadowTheAge/yafc/blob/master/Docs/MoreLanguagesSupport.md");
168+
AboutScreen.VisitLink(AboutScreen.Github + "/blob/master/Docs/MoreLanguagesSupport.md");
153169
}
154170

155171
public void Report((string, string) value) => (currentLoad1, currentLoad2) = value;

0 commit comments

Comments
 (0)