InitialWindow, design ideas, README troubleshooting

This commit is contained in:
2024-11-26 23:17:51 -06:00
parent 1258020ad9
commit ac8bb58f6c
7 changed files with 144 additions and 39 deletions

13
DESIGN.md Normal file
View File

@@ -0,0 +1,13 @@
- Offer tools for manual editing of bytes, decoding of zstd compressed level files
- Logging into appdata/temp
- Drag and drop
- Manual byte editing
- Suggestion-based editing (e.g. "I think this is the achievement flag")
- Launch Factorio button (select save file automatically)
FLOW
- Open app
- Either drag and drop
- Or press 'Open File'
- Or select from list

View File

@@ -14,9 +14,20 @@ This is a WPF-based tool that can be used to re-enable achievements in [Factorio
If you're having trouble getting _any_ tools to work in this space, that's because this is an experimental and highly volatile method of fixing achievements.
All we are able to do is use best-effort pattern matching with trial and error to attempt to re-enable achievements.
All we are able to do is use best-effort pattern matching with trial and error to attempt to re-enable achievements. This means that it's not guaranteed to work, and could easily break in the future.
I recommend that you
This tool aims to be slightly more configurable and offer a trial-and-error approach that could be more complicated, but works better for a wider range of scenarios.
I made this tool and developed my method from the following sources/discussions online:
- https://www.reddit.com/r/factorio/comments/rlprxh/text_tutorial_for_reenabling_achievements_after/
- https://forums.factorio.com/viewtopic.php?p=623016#p623016
- https://github.com/0x796935/factorio-achievement-restore
- https://0x796935.github.io/
- https://github.com/Rainson12/FactorioSaveGameEnableAchievements
- https://github.com/Rainson12/FactorioSaveGameEnableAchievements/issues/1
- https://github.com/pooreboy/factorio-achievement-restore
- https://www.reddit.com/r/factorio/comments/1gacff0/enabling_achievements_after_using_console_commands/
## Compiling

View File

@@ -2,8 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:factorio_achievements_fixer"
StartupUri="MainWindow.xaml">
StartupUri="InitialWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View File

@@ -0,0 +1,45 @@
<Window x:Class="factorio_achievements_fixer.InitialWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:factorio_achievements_fixer"
mc:Ignorable="d"
Title="Achievements Fixer"
Height="450"
Width="800">
<Grid HorizontalAlignment="Stretch"
DockPanel.Dock="Top"
Height="Auto"
AllowDrop="True"
Drop="Grid_Drop"
DragOver="Grid_DragOver"
Background="Transparent">
<StackPanel Orientation="Vertical"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock Text="Select a Save File, or Drag and Drop it here..."
FontSize="16"
Margin="10"/>
<Button Content="Select File..."
Width="150"
Height="30"
Margin="10"
Click="FixAchievements_Click"/>
<ListView Name="SaveList"
Margin="5"
Height="Auto"
Width="Auto">
<ListView.View>
<GridView>
<GridViewColumn Header="Filename"
DisplayMemberBinding="{Binding Name}"/>
<GridViewColumn Header="Last Modified"
DisplayMemberBinding="{Binding Description}"/>
</GridView>
</ListView.View>
</ListView>
</StackPanel>
</Grid>
</Window>

View File

@@ -0,0 +1,71 @@
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace factorio_achievements_fixer;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class InitialWindow : Window
{
public InitialWindow()
{
// InitializeComponent();
var listView = new ListView
{
Margin = new Thickness(10)
};
var gridView = new GridView();
gridView.Columns.Add(new GridViewColumn
{
Header = "File Name",
DisplayMemberBinding = new Binding("FileName")
});
listView.View = gridView;
var grid = new Grid();
grid.Children.Add(listView);
Content = grid;
}
private void Grid_Drop(object sender, DragEventArgs e)
{
if (!e.Data.GetDataPresent(DataFormats.FileDrop))
return;
var files = (string[])e.Data.GetData(DataFormats.FileDrop) ?? Array.Empty<string>();
if (files.Length != 1)
{
}
}
private void Grid_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(DataFormats.FileDrop))
{
e.Effects = DragDropEffects.Copy;
}
else
{
e.Effects = DragDropEffects.None;
}
}
private void FixAchievements_Click(object sender, RoutedEventArgs e)
{
// handle the fix achievements button click here!
}
}

View File

@@ -1,12 +0,0 @@
<Window x:Class="factorio_achievements_fixer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:factorio_achievements_fixer"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>

View File

@@ -1,23 +0,0 @@
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace factorio_achievements_fixer;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}