Skip to content

Commit

Permalink
Rename Team_Fortress_2_Folder to TeamFortress2Folder
Browse files Browse the repository at this point in the history
  • Loading branch information
cooolbros committed Jan 2, 2024
1 parent 10f0026 commit 80994e2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/HUDMerger/Commands/MergeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static bool PathContainsPath(string parentDir, string subDir)
return !relativeDirectory.StartsWith("..") && !Path.IsPathRooted(relativeDirectory);
}

if (PathContainsPath(Path.Join(Properties.Settings.Default.Team_Fortress_2_Folder, "tf\\custom"), _mainWindowViewModel.TargetHUD!.FolderPath) && Process.GetProcessesByName("hl2").Length != 0)
if (PathContainsPath(Path.Join(Properties.Settings.Default.TeamFortress2Folder, "tf\\custom"), _mainWindowViewModel.TargetHUD!.FolderPath) && Process.GetProcessesByName("hl2").Length != 0)
{
MessageBox.Show("HL2 process open, cannot merge!", "HL2 Open Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
Expand Down
6 changes: 3 additions & 3 deletions src/HUDMerger/Properties/Settings.Designer.cs

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

2 changes: 1 addition & 1 deletion src/HUDMerger/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HUDMerger.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="Team_Fortress_2_Folder" Type="System.String" Scope="User">
<Setting Name="TeamFortress2Folder" Type="System.String" Scope="User">
<Value Profile="(Default)">C:\Program Files (x86)\Steam\steamapps\common\Team Fortress 2</Value>
</Setting>
</Settings>
Expand Down
8 changes: 4 additions & 4 deletions src/HUDMerger/Services/HUDFileReaderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public enum FileType : byte

public partial class HUDFileReaderService
{
private readonly Lazy<VPK> TF2MiscDirVPK = new(() => new(Path.Join(Properties.Settings.Default.Team_Fortress_2_Folder, "tf\\tf2_misc_dir.vpk")));
private readonly Lazy<VPK> PlatformMiscDirVPK = new(() => new(Path.Join(Properties.Settings.Default.Team_Fortress_2_Folder, "platform\\platform_misc_dir.vpk")));
private readonly Lazy<VPK> TF2MiscDirVPK = new(() => new(Path.Join(Properties.Settings.Default.TeamFortress2Folder, "tf\\tf2_misc_dir.vpk")));
private readonly Lazy<VPK> PlatformMiscDirVPK = new(() => new(Path.Join(Properties.Settings.Default.TeamFortress2Folder, "platform\\platform_misc_dir.vpk")));

private readonly Dictionary<string, dynamic?> Files = [];

Expand Down Expand Up @@ -64,13 +64,13 @@ void Add(HUD hud, string relativePath, FileType type)
return Encoding.UTF8.GetString(PlatformMiscDirVPK.Value.Read(relativePath));
}

string tfPath = Path.Join(Properties.Settings.Default.Team_Fortress_2_Folder, "tf", relativePath);
string tfPath = Path.Join(Properties.Settings.Default.TeamFortress2Folder, "tf", relativePath);
if (File.Exists(tfPath))
{
return File.ReadAllText(tfPath);
}

string hl2Path = Path.Join(Properties.Settings.Default.Team_Fortress_2_Folder, "hl2", relativePath);
string hl2Path = Path.Join(Properties.Settings.Default.TeamFortress2Folder, "hl2", relativePath);
if (File.Exists(hl2Path))
{
return File.ReadAllText(hl2Path);
Expand Down
2 changes: 1 addition & 1 deletion src/HUDMerger/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<Label FontSize="22" Grid.Row="0" Margin="10,0,0,0">Settings</Label>
<StackPanel Name="SettingsContainer" Grid.Row="1" Margin="10,0,10,10">
<Label Content="Team Fortress 2 Folder" FontSize="15" ToolTip="Path to Team Fortress 2 Installation. Used for extracting required HUD files." />
<TextBox Style="{StaticResource TextBoxStyle1}" HorizontalAlignment="Left" MinWidth="480" Text="{Binding Team_Fortress_2_Folder, Source={x:Static Properties:Settings.Default}, Mode=TwoWay}" />
<TextBox Style="{StaticResource TextBoxStyle1}" HorizontalAlignment="Left" MinWidth="480" Text="{Binding TeamFortress2Folder, Source={x:Static Properties:Settings.Default}, Mode=TwoWay}" />
</StackPanel>
<WrapPanel HorizontalAlignment="Left" VerticalAlignment="Bottom" Grid.Row="2" Margin="10,5,10,10">
<Button Style="{StaticResource EnabledButton}" FontSize="14" Padding="20,8" Click="CancelButton_Click" Margin="0,0,10,0" IsCancel="True">Cancel</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/HUDMerger/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MainWindowViewModel : ViewModelBase
{
private static readonly OpenFolderDialog OpenFolderDialog = new()
{
InitialDirectory = Path.Join(Properties.Settings.Default.Team_Fortress_2_Folder, "tf\\custom\\")
InitialDirectory = Path.Join(Properties.Settings.Default.TeamFortress2Folder, "tf\\custom\\")
};

// File
Expand Down

0 comments on commit 80994e2

Please sign in to comment.