Skip to content

Commit

Permalink
Prepared for Release
Browse files Browse the repository at this point in the history
 * Will open up Settings Window on first run so that the paths are set correctly.
 * Setup framework for Directory Links (like the Open MBin button but for directories).  However it doesn't quite work yet.
 * Increased Status Message size on Splash Screen
  • Loading branch information
theFisher86 committed Oct 10, 2018
1 parent c214b7c commit da736e8
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 38 deletions.
8 changes: 4 additions & 4 deletions No-Mans-GUI-Development/NoMansGUI/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
</startup>
<userSettings>
<NoMansGUI.Properties.Settings>
<setting name="pathUnpakdFiles" serializeAs="String">
<value>X:\Modding\NMS\UnPakd\</value>
</setting>
<setting name="pathPCBanks" serializeAs="String">
<value>D:\Games\SteamLibrary\steamapps\common\No Man's Sky\GAMEDATA\PCBANKS</value>
<value>blank</value>
</setting>
<setting name="pathModelViewer" serializeAs="String">
<value />
Expand Down Expand Up @@ -57,6 +54,9 @@
<setting name="MainHeight" serializeAs="String">
<value>768</value>
</setting>
<setting name="pathUnpakdFiles" serializeAs="String">
<value>blank</value>
</setting>
</NoMansGUI.Properties.Settings>
</userSettings>
</configuration>
10 changes: 9 additions & 1 deletion No-Mans-GUI-Development/NoMansGUI/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;

namespace NoMansGUI
Expand Down Expand Up @@ -117,7 +118,7 @@ protected override void OnStartup(object sender, System.Windows.StartupEventArgs
m_log.Error(args.Error.Message);
}
IoC.Get<IEventAggregator>().PublishOnUIThread(new LoadingCompletedEvent());

base.OnStartup(sender, ev);
};

Expand Down Expand Up @@ -177,8 +178,15 @@ public void Dispose()

public void Handle(SplashClickEvent message)
{
if(Properties.Settings.Default.pathUnpakdFiles == "blank")
{
MessageBoxResult box = MessageBox.Show("You'll need to add the locations of your Unpakd Files and PCBANKs directory.");
IoC.Get<IWindowManager>().ShowDialog(new SettingsViewModel());
_vm.TryClose();
}
//Display the root view, in this case it's mainwindowviewmodel, the view will be found automagically.
DisplayRootViewFor<IShell>();

//Close the splashscreen
_vm.TryClose();
//Case base startup.
Expand Down
2 changes: 1 addition & 1 deletion No-Mans-GUI-Development/NoMansGUI/Models/MBin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MBin
public string Filepath { get; set; }
public string Name { get; set; }
public string VanillaFilePath { get; set; } // For comparison purposes. Might not ever use this and end up removing it.
public string vanillaName { get; set; } // Used when creating new files that are based on vanilla (custom models, etc)
public string VanillaName { get; set; } // Used when creating new files that are based on vanilla (custom models, etc)
}

public class MBINField : PropertyChangedBase
Expand Down
4 changes: 2 additions & 2 deletions No-Mans-GUI-Development/NoMansGUI/NoMansGUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
<Reference Include="DirectXTexNet, Version=1.0.0.2, Culture=neutral, PublicKeyToken=67e4f5ed452a4f5d, processorArchitecture=MSIL">
<HintPath>..\packages\DirectXTexNet.1.0.0-rc2\lib\net40\DirectXTexNet.dll</HintPath>
</Reference>
<Reference Include="libMBIN, Version=1.58.0.1, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="libMBIN, Version=1.61.0.2, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\libMBIN.dll</HintPath>
<HintPath>X:\Modding\NMS\Tools\libMBIN.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
Expand Down
28 changes: 14 additions & 14 deletions No-Mans-GUI-Development/NoMansGUI/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="NoMansGUI.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="pathUnpakdFiles" Provider="NMSSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">X:\Modding\NMS\UnPakd\</Value>
</Setting>
<Setting Name="pathPCBanks" Provider="NMSSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">D:\Games\SteamLibrary\steamapps\common\No Man's Sky\GAMEDATA\PCBANKS</Value>
<Value Profile="(Default)">blank</Value>
</Setting>
<Setting Name="pathModelViewer" Provider="NMSSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)" />
Expand Down Expand Up @@ -47,5 +44,8 @@
<Setting Name="MainHeight" Provider="NMSSettingsProvider" Type="System.Double" Scope="User">
<Value Profile="(Default)">768</Value>
</Setting>
<Setting Name="pathUnpakdFiles" Provider="NMSSettingsProvider" Type="System.String" Scope="User">
<Value Profile="(Default)">blank</Value>
</Setting>
</Settings>
</SettingsFile>
28 changes: 27 additions & 1 deletion No-Mans-GUI-Development/NoMansGUI/Styles/MbinTemplates.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,33 @@
</Button>
</Grid>
</DataTemplate>


<DataTemplate x:Key="DirLinkTemplate">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Row="0" Padding="0" Grid.Column="0" Height="25" Text="{Binding Name}"/>
<TextBox Grid.Row="1" Padding="0" Grid.Column="0" Height="20" Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Button Content="Open Directory in Tree" Grid.Row="1" Grid.Column="2" Width="100" Height="25">
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<cal:ActionMessage MethodName="OpenDir">
<cal:Parameter Value="$source" />
<cal:Parameter Value="$dataContext" />
</cal:ActionMessage>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Grid>
</DataTemplate>

<DataTemplate x:Key="SingleDataTemplate">
<Grid>
<Grid.RowDefinitions>
Expand Down
10 changes: 10 additions & 0 deletions No-Mans-GUI-Development/NoMansGUI/Utils/Events/MBINEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,14 @@ public OpenMBINEvent(string path)
Path = path;
}
}

public class OpenDirEvent
{
public string Path { get; private set; }

public OpenDirEvent(string path)
{
Path = path;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ public override DataTemplate SelectTemplate(object item, DependencyObject contai

return Application.Current.FindResource("ListDataTemplate") as DataTemplate;
case "string":
if (IsMbinLink(field.Value.ToString()))
switch (IsMbinLink(field.Value.ToString()))
{
return Application.Current.FindResource("MBINlinkTemplate") as DataTemplate;
case 0:
return Application.Current.FindResource("StringDataTemplate") as DataTemplate;
case 1:
return Application.Current.FindResource("MBINlinkTemplate") as DataTemplate;
case 2:
return Application.Current.FindResource("DirLinkTemplate") as DataTemplate;
}
return Application.Current.FindResource("StringDataTemplate") as DataTemplate;
break;
case "vector2f":
case "vector4f":
case "vector6f":
Expand Down Expand Up @@ -81,17 +86,24 @@ public override DataTemplate SelectTemplate(object item, DependencyObject contai
return Application.Current.FindResource("StringDataTemplate") as DataTemplate;
}

private bool IsMbinLink(string value)
private int IsMbinLink(string value)
{
if(value.ContainsAny(@"\", @"/"))
{
string[] a = value.Split('.');
if(a[a.Length - 1].ToLower().Contains("mbin"))
if (value.Contains(".")) // Check if a period exists (to determine if it's a file link or a reference to a directory)
{
string[] a = value.Split('.');
if (a[a.Length - 1].ToLower().Contains("mbin"))
{
return 1; // 1 = mbin
}
}
else
{
return true;
return 2; // 2 = directory
}
}
return false;
return 0; // 0 = not a link
}


Expand Down
9 changes: 9 additions & 0 deletions No-Mans-GUI-Development/NoMansGUI/ViewModels/MBinViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ public void OpenMbin(object sender, MBINField e)
}
}

public void OpenDir(object sender, MBINField e)
{
//string fullpath = Path.Combine(Settings.Default.pathUnpakdFiles, (string)e.Value);
//FileListViewModel.LoadDirectory(fullpath);

//TODO The above doesn't work. Basically here we need to just open the directory in the file tree. I can't figure out how to reference the existing file tree?
MessageBoxResult result = MessageBox.Show("This doesn't work yet.");
}

public override bool IsDirty()
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public string StatusMessage
}
}


public SplashWindowViewModel()
{
//When using IHandle interfaces, we need to call this in the constructor so it knows it should be listening for events.
Expand All @@ -47,6 +48,7 @@ public void Handle(LoadingStatusMessage message)
StatusMessage = message.Message;
}


public void Handle(LoadingCompletedEvent message)
{
StatusMessage = "Click to continue.";
Expand Down
6 changes: 3 additions & 3 deletions No-Mans-GUI-Development/NoMansGUI/Views/SplashWindowView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
</Border.Effect>
<Border BorderThickness="1" CornerRadius="2" BorderBrush="#BFFFFFFF" SnapsToDevicePixels="True">
<Grid x:Name="m_grid">
<Image Width="600" Stretch="Uniform" x:Name="LoadingImage" gif:ImageBehavior.RepeatBehavior="Forever" gif:ImageBehavior.AnimatedSource="pack://application:,,,/NoMansGUI;component/Resources/status_icons/loading.gif" />
<Image Width="600" Stretch="Uniform" x:Name="LoadingImage" gif:ImageBehavior.RepeatBehavior="Forever" gif:ImageBehavior.AnimatedSource="pack://application:,,,/NoMansGUI;component/Resources/status_icons/loading.gif"/>
<TextBlock Width="600" TextWrapping="WrapWithOverflow" TextAlignment="Center" FontSize="20" Text="Please note that this is a PRE ALPHA build and we are not looking for feedback or bug reports just yet. If something's broke we probably know already."/>
<StackPanel Margin="0,0,0,50" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<Label Content="Status: "/>
<Label HorizontalAlignment="Center" VerticalAlignment="Bottom" Content="{Binding StatusMessage}"/>
<Label Content="Status: " FontSize="18"/>
<Label HorizontalAlignment="Center" VerticalAlignment="Bottom" Content="{Binding StatusMessage}" FontSize="20"/>
</StackPanel>
</Grid>
</Border>
Expand Down

0 comments on commit da736e8

Please sign in to comment.