Skip to content

Commit f436414

Browse files
author
RootCubed
committed
Fix bug with buttons, make load count field larger
1 parent 038d4a3 commit f436414

4 files changed

Lines changed: 20 additions & 6 deletions

File tree

FinalRetimeWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<Label Grid.Row="2" Grid.Column="1" Content="Loads:" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top" FontSize="15"/>
2727
<Label x:Name="WLoads" Grid.Row="3" Content="--:--.---" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top" FontSize="15"/>
2828
<Label x:Name="Loads" Grid.Row="3" Grid.Column="1" Content="--:--.---" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top" FontSize="15"/>
29-
<Label Grid.Row="4" Grid.ColumnSpan="2" Content="Generated with LoadRetimer v1.3.1" HorizontalAlignment="Center" FontSize="10" />
29+
<Label Grid.Row="4" Grid.ColumnSpan="2" Content="Generated with LoadRetimer v1.4" HorizontalAlignment="Center" FontSize="10" />
3030
<Button Grid.Row="5" Grid.ColumnSpan="2" Content="Close" Click="Button_Click" />
3131
</Grid>
3232
</Window>

Info.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<Grid.ColumnDefinitions>
1818
<ColumnDefinition Width="1*" />
1919
</Grid.ColumnDefinitions>
20-
<Label Content="Load Retimer v1.3.1" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top" FontSize="25"/>
20+
<Label Content="Load Retimer v1.4" HorizontalAlignment="Center" Margin="0,10,0,0" VerticalAlignment="Top" FontSize="25"/>
2121
<TextBlock Grid.Row="1" HorizontalAlignment="Center" TextWrapping="Wrap" VerticalAlignment="Top" Padding="2,0,0,0">
2222
Controls:<LineBreak/>
2323
A/D: go back/forwards 1 frame<LineBreak/>

MainWindow.xaml.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ private void OpenFile_Click(object sender, RoutedEventArgs e) {
194194
}
195195
}
196196

197-
const byte CURR_VERSION = 2;
197+
const byte CURR_VERSION = 3;
198198

199199
private void OpenLoads_Click(object sender, RoutedEventArgs e) {
200200
var ofd = new OpenFileDialog {
@@ -211,7 +211,12 @@ private void OpenLoads_Click(object sender, RoutedEventArgs e) {
211211
} else {
212212
hasTotalRun = version == 1;
213213
}
214-
int loadCount = binReader.ReadByte();
214+
uint loadCount;
215+
if (version >= 3) {
216+
loadCount = binReader.ReadUInt32();
217+
} else {
218+
loadCount = binReader.ReadByte();
219+
}
215220
frameRate = binReader.ReadDouble();
216221
FPSLabel.Content = String.Format("FPS: {0:F2}", frameRate);
217222
if (hasTotalRun) {
@@ -251,7 +256,7 @@ private void SaveLoads_Click(object sender, RoutedEventArgs e) {
251256
} else {
252257
binWriter.Write((byte)0);
253258
}
254-
binWriter.Write((byte)LoadBox.Items.Count);
259+
binWriter.Write((UInt32)LoadBox.Items.Count);
255260
binWriter.Write(frameRate);
256261
if (TotalRunInfo.FrameDuration() > 0) {
257262
binWriter.Write((UInt32)TotalRunInfo.frameStart);
@@ -461,7 +466,7 @@ private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs
461466
private void Window_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
462467
var mouseWasDownOn = e.Source as FrameworkElement;
463468
if (mouseWasDownOn != null) {
464-
if (!(mouseWasDownOn is LoadInfo)) {
469+
if (mouseWasDownOn is not (LoadInfo or System.Windows.Controls.Button)) {
465470
LoadBox.SelectedItem = null;
466471
}
467472
}
@@ -490,6 +495,7 @@ private void Window_SizeChanged(object sender, SizeChangedEventArgs e) {
490495
}
491496

492497
private TimeSpan TrueFramePos() {
498+
if (Video.PlaybackStartTime == null) return new TimeSpan(0);
493499
return (TimeSpan)(Video.FramePosition - Video.PlaybackStartTime);
494500
}
495501
}

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# LoadRetimer
2+
3+
## About
4+
This is a tool I made for the NSMBW speedrunning community. It allows you to easily retime a video of a run without loads (removing all the black frames from loading segments).
5+
The names for Any% loads are hardcoded into the program, but you can switch to manually enter the name of every load if you wish to retime a different category (or even a different game for that matter!)
6+
7+
## .lds files
8+
Load files are stored in a compact, custom format. If you want to view a load file as text, you can upload a .lds file to [this](https://rootcubed.dev/ldsviewer/) site and look at the loads that way.

0 commit comments

Comments
 (0)