Skip to content
This repository was archived by the owner on Jan 27, 2022. It is now read-only.

Commit e44a0f5

Browse files
committed
minor cleanup
1 parent 209428c commit e44a0f5

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

MapPacker/AssetPacker.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ public void CopyFiles() {
129129
} else {
130130
parentForm.SetProgress(0);
131131

132+
// rip natively playing sound with dotnet, I ain't using a library for a single gimmick sound, sorry
133+
132134
//SoundPlayer player = new SoundPlayer("/MapPacker;component/sounds/steam_message.wav");
133135
//player.Load();
134136
//player.Play();
@@ -182,6 +184,8 @@ public void PackVPK() {
182184
GetAssetsFromMap($"{path}\\{item}"); // we can assume that prefabs will also be wherever the original map is
183185
GetAssetsFromMap($"{assetPath}\\{item}"); // prefabs *could* also be in the asset directory however
184186
}
187+
} else if (item.EndsWith("vpost")) {
188+
AddAsset(item); // post processing file
185189
}
186190
}
187191
} catch {
@@ -238,7 +242,7 @@ public void GetAssetsFromParticle(string item) {
238242
} else if(assetItem.EndsWith("vmdl")) {
239243
GetAssetsFromModel(assetItem);
240244
} else if(assetItem.EndsWith("vpcf")) {
241-
if(!(item == assetItem)) // if there's a self reference in the particle for some reason
245+
if(!(item == assetItem)) // if there's a self reference in the particle. this is often the case for some reason
242246
GetAssetsFromParticle(assetItem);
243247
}
244248
}
@@ -277,6 +281,8 @@ public static string CleanAssetPath(string item) {
277281
asset = asset.Replace(".vmesh", ".vmesh_c");
278282
} else if(asset.EndsWith("vsnd")) {
279283
asset = asset.Replace("vsnd", "vsnd_c");
284+
} else if(asset.EndsWith("vpost")) {
285+
asset = asset.Replace("vpost", "vpost_c");
280286
}
281287
return asset;
282288
}

MapPacker/MainWindow.xaml.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ private void LinkLabel_Click(object sender, RoutedEventArgs e) {
7272

7373
if(source != null) {
7474

75-
Process.Start(new ProcessStartInfo("cmd", $"/c start {source.NavigateUri.ToString()}") { CreateNoWindow = true });
75+
Process.Start(new ProcessStartInfo("cmd", $"/c start {source.NavigateUri}") { CreateNoWindow = true });
7676
}
7777
}
7878

@@ -157,24 +157,24 @@ public void PrintToConsole(string text, string resource) {
157157

158158
private void ConfirmButton_Click(object sender, RoutedEventArgs e) {
159159

160-
var text = (System.Windows.Controls.RichTextBox)this.FindName("vmapLocation");
160+
var text = (RichTextBox)this.FindName("vmapLocation");
161161
string vmapFile = new TextRange(text.Document.ContentStart, text.Document.ContentEnd).Text.Replace("\r\n", "");
162162
if(!File.Exists(vmapFile)) {
163-
System.Windows.MessageBox.Show("Vmap file path invalid!", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
163+
MessageBox.Show("Vmap file path invalid!", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
164164
return;
165165
}
166166

167167
text = (RichTextBox)this.FindName("assetLocation");
168168
string assetDir = new TextRange(text.Document.ContentStart, text.Document.ContentEnd).Text.Replace("\r\n", "");
169169
if(!Directory.Exists(assetDir)) {
170-
System.Windows.MessageBox.Show("Asset Directory path invalid!", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
170+
MessageBox.Show("Asset Directory path invalid!", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
171171
return;
172172
}
173173

174174
text = (RichTextBox)this.FindName("sboxLocation");
175175
string sboxDir = new TextRange(text.Document.ContentStart, text.Document.ContentEnd).Text.Replace("\r\n", "");
176176
if(!Directory.Exists(sboxDir)) {
177-
System.Windows.MessageBox.Show("s&box Directory path invalid!", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
177+
MessageBox.Show("s&box Directory path invalid!", "Error", MessageBoxButton.OK, MessageBoxImage.Warning);
178178
return;
179179
}
180180

0 commit comments

Comments
 (0)