Skip to content

Commit 30cecd8

Browse files
committed
space used
1 parent 3a8b6f6 commit 30cecd8

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

FF4MapEdit/MainWindow.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@
2121
<ScrollViewer HorizontalScrollBarVisibility="Auto" HorizontalAlignment="Left" Margin="271,35,0,0" VerticalAlignment="Top">
2222
<Image x:Name="Map" HorizontalAlignment="Left" Height="4096" Margin="0,0,0,0" VerticalAlignment="Top" Width="4096" MouseLeftButtonUp="Map_MouseLeftButtonUp" MouseLeftButtonDown="Map_MouseLeftButtonDown" MouseMove="Map_MouseMove"/>
2323
</ScrollViewer>
24+
<Label x:Name="SpaceUsedLabel" Content="" HorizontalAlignment="Left" Margin="10,168,0,0" VerticalAlignment="Top"/>
2425
</Grid>
2526
</Window>

FF4MapEdit/MainWindow.xaml.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ public partial class MainWindow : Window
3131

3232
private bool _painting = false;
3333

34+
private int SpaceUsed
35+
{
36+
set
37+
{
38+
SpaceUsedLabel.Content = $"Space used: {value}/{FF4Rom.OverworldRowDataMaxLength} bytes";
39+
SpaceUsedLabel.Foreground = value > FF4Rom.OverworldRowDataMaxLength ? Brushes.Red : Brushes.Black;
40+
}
41+
}
42+
3443
public MainWindow()
3544
{
3645
InitializeComponent();
@@ -143,6 +152,8 @@ private void Paint(int x, int y)
143152
_rowBitmaps[y].Lock();
144153
_rowBitmaps[y].WritePixels(new Int32Rect(16*x, 0, 16, 16), _rom.Tileset[_selectedTile], 16*2, 0);
145154
_rowBitmaps[y].Unlock();
155+
156+
SpaceUsed = _rom.Map.Length;
146157
}
147158

148159
private void GetClickedTile(object sender, MouseButtonEventArgs e, out int x, out int y)
@@ -171,6 +182,8 @@ private void LoadOverworld()
171182

172183
LoadOverworldTileset();
173184
LoadOverworldTiles();
185+
186+
SpaceUsed = _rom.Map.Length;
174187
}
175188

176189
private void LoadOverworldTileset()

0 commit comments

Comments
 (0)