Skip to content

Commit a4e634a

Browse files
committed
Add non US rom error.. NANIIII!?!?
1 parent aeed353 commit a4e634a

14 files changed

Lines changed: 223 additions & 11 deletions

File tree

DigimonWorldNet6/Frontend.WPF/Frontend.WPF.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
<None Include="Music\**\*.wav">
4040
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
4141
</None>
42+
<Content Include="SFX\**\*.wav">
43+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
44+
</Content>
45+
<Content Include="SFX\**\*.mp3">
46+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
47+
</Content>
4248
</ItemGroup>
4349

4450
<ItemGroup>
268 KB
Loading
216 KB
Binary file not shown.

DigimonWorldNet6/Frontend.WPF/Windows/AboutAndCredits/AboutAndCreditsWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<Label Grid.Row="2" Grid.Column="1" Style="{StaticResource DefaultLabelStyle}" HorizontalAlignment="Left" Content="Ginoshie" />
7474
<Label Grid.Row="3" Grid.Column="1" Style="{StaticResource DefaultLabelStyle}" HorizontalAlignment="Left" Content="{Binding ContactEmailAddress}" />
7575
<Label Grid.Row="4" Grid.Column="1" Style="{StaticResource DefaultLabelStyle}" HorizontalAlignment="Left" Content="{Binding YoutubeAddress}" />
76-
<Label Grid.Row="5" Grid.Column="1" Style="{StaticResource DefaultLabelStyle}" HorizontalAlignment="Left" Content="1.3" />
76+
<Label Grid.Row="5" Grid.Column="1" Style="{StaticResource DefaultLabelStyle}" HorizontalAlignment="Left" Content="1.3.1" />
7777

7878
<StackPanel Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="2"
7979
Orientation="Horizontal"
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<baseClasses:BaseDialogWindow x:Class="DigimonWorld.Frontend.WPF.Windows.GeneralConfig.Dialogs.InvalidRomDialog"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:baseClasses="clr-namespace:DigimonWorld.Frontend.WPF.Windows.BaseClasses"
7+
mc:Ignorable="d"
8+
Title="Unsupported ROM Version"
9+
ResizeMode="NoResize"
10+
SizeToContent="WidthAndHeight"
11+
WindowStyle="None"
12+
AllowsTransparency="True"
13+
Background="Transparent"
14+
WindowStartupLocation="Manual">
15+
16+
<baseClasses:BaseDialogWindow.Resources>
17+
<ResourceDictionary>
18+
<ResourceDictionary.MergedDictionaries>
19+
<ResourceDictionary Source="/ResourceDictionaries/Styles/Buttons/DefaultButtonStyle.xaml" />
20+
</ResourceDictionary.MergedDictionaries>
21+
</ResourceDictionary>
22+
</baseClasses:BaseDialogWindow.Resources>
23+
24+
<Border Background="Transparent" Panel.ZIndex="1" KeyboardNavigation.TabNavigation="None">
25+
<Border CornerRadius="8" BorderBrush="Black" BorderThickness="3" SnapsToDevicePixels="True" UseLayoutRounding="True">
26+
<Border CornerRadius="8" BorderBrush="#4A9FC5" BorderThickness="3" SnapsToDevicePixels="True" UseLayoutRounding="True">
27+
<Border CornerRadius="5" BorderBrush="#90D9FA" BorderThickness="3" SnapsToDevicePixels="True" UseLayoutRounding="True">
28+
<Border CornerRadius="3" BorderBrush="Black" BorderThickness="3" Background="#2E3841" Padding="5">
29+
<StackPanel Margin="5">
30+
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
31+
<Image Height="200"
32+
Source="/Images/Digimon/Nanimon-poop.png"
33+
HorizontalAlignment="Center"
34+
VerticalAlignment="Center"
35+
RenderTransformOrigin="0.5,0.5">
36+
<Image.RenderTransform>
37+
<ScaleTransform ScaleX="-1" />
38+
</Image.RenderTransform>
39+
</Image>
40+
41+
<Border CornerRadius="8" BorderBrush="Black" BorderThickness="3" Background="Black" Margin="10,0,0,0">
42+
<Border CornerRadius="8" BorderBrush="#4A9FC5" BorderThickness="3" Background="#4A9FC5">
43+
<Border CornerRadius="5" BorderBrush="#90D9FA" BorderThickness="3" Background="#2E3841">
44+
<Border CornerRadius="5" BorderBrush="Transparent" BorderThickness="0" Background="#77000000">
45+
<StackPanel Margin="5">
46+
<TextBlock Text="Nanimon"
47+
Foreground="#D4D604"
48+
FontSize="15"
49+
HorizontalAlignment="Left"
50+
VerticalAlignment="Top"
51+
Margin="0,0,0,5"
52+
Width="250"
53+
Height="16"
54+
TextWrapping="Wrap" />
55+
<TextBlock Foreground="#B3B5B1"
56+
FontSize="14"
57+
HorizontalAlignment="Left"
58+
VerticalAlignment="Top"
59+
Margin="0,5"
60+
Width="300"
61+
TextWrapping="Wrap"
62+
Text="Naniiii?! That's not a US ROM!&#x0a;&#x0a;Emulator synchronization only works with the US version. Load up the right ROM and reconnect!" />
63+
</StackPanel>
64+
</Border>
65+
</Border>
66+
</Border>
67+
</Border>
68+
</StackPanel>
69+
70+
<Button Height="45"
71+
Style="{StaticResource DefaultButtonStyle}"
72+
Content="Close"
73+
Padding="15,5"
74+
HorizontalAlignment="Center"
75+
IsCancel="True" />
76+
</StackPanel>
77+
</Border>
78+
</Border>
79+
</Border>
80+
</Border>
81+
</Border>
82+
</baseClasses:BaseDialogWindow>
83+
84+
85+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
namespace DigimonWorld.Frontend.WPF.Windows.GeneralConfig.Dialogs;
2+
3+
public partial class InvalidRomDialog
4+
{
5+
public InvalidRomDialog()
6+
{
7+
InitializeComponent();
8+
DataContext = new InvalidRomDialogViewModel();
9+
}
10+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.IO;
3+
using NAudio.Wave;
4+
5+
namespace DigimonWorld.Frontend.WPF.Windows.GeneralConfig.Dialogs;
6+
7+
public class InvalidRomDialogViewModel
8+
{
9+
public InvalidRomDialogViewModel()
10+
{
11+
try
12+
{
13+
string sfxPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "SFX", "nani.mp3");
14+
15+
if (!File.Exists(sfxPath))
16+
{
17+
return;
18+
}
19+
20+
AudioFileReader audioFile = new(sfxPath);
21+
WaveOutEvent soundOut = new();
22+
soundOut.Init(audioFile);
23+
soundOut.Volume = 1.0f;
24+
soundOut.PlaybackStopped += (_, _) =>
25+
{
26+
soundOut.Dispose();
27+
audioFile.Dispose();
28+
};
29+
soundOut.Play();
30+
} catch (Exception)
31+
{
32+
// Sound playback is non-critical
33+
}
34+
}
35+
}
36+

DigimonWorldNet6/Frontend.WPF/Windows/GeneralConfig/GeneralConfigWindowViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public GeneralConfigWindowViewModel(Window window)
6464
SetEvolutionCalculatorModeVicePanjyamonDisabledCommand = new CommandHandler(() => SetVicePatch(GameVariant.PanjyamonPatch, false));
6565

6666
OpenEmulatorSelectorCommand = new CommandHandler(OpenEmulatorSelector);
67+
ReconnectEmulatorCommand = new CommandHandler(EmulatorLinkEventHub.SignalEmulatorReconnectRequested);
6768
SetEmulatorSyncModeAutoCommand = new CommandHandler(SetEmulatorSyncModeAuto);
6869
SetEmulatorSyncModeManualCommand = new CommandHandler(SetEmulatorSyncModeManual);
6970

@@ -269,6 +270,7 @@ private set
269270
public ICommand SetEvolutionCalculatorModeVicePanjyamonEnabledCommand { get; }
270271
public ICommand SetEvolutionCalculatorModeVicePanjyamonDisabledCommand { get; }
271272
public ICommand OpenEmulatorSelectorCommand { get; }
273+
public ICommand ReconnectEmulatorCommand { get; }
272274
public ICommand SetEmulatorSyncModeAutoCommand { get; }
273275
public ICommand SetEmulatorSyncModeManualCommand { get; }
274276
public ICommand SetTamerVisionShowEvoCommand { get; }

DigimonWorldNet6/Frontend.WPF/Windows/GeneralConfig/UserControls/EmulatorLinkConfigurationSection.xaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,20 @@
6464
MaxWidth="205"
6565
VerticalAlignment="Center"
6666
Margin="0,10,5,0" />
67-
<Button Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Style="{StaticResource DefaultButtonStyle}"
68-
Command="{Binding OpenEmulatorSelectorCommand}"
69-
Content="Select emulator"
70-
Margin="0,10,0,0"
71-
Padding="10"
72-
HorizontalAlignment="Center" />
67+
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal"
68+
Margin="0,10,0,0" HorizontalAlignment="Center">
69+
<Button Style="{StaticResource DefaultButtonStyle}"
70+
Command="{Binding OpenEmulatorSelectorCommand}"
71+
Content="Select emulator"
72+
Padding="10" />
73+
<Button Style="{StaticResource DefaultButtonStyle}"
74+
Command="{Binding ReconnectEmulatorCommand}"
75+
Content=""
76+
Width="45"
77+
Height="45"
78+
Margin="10,0,0,0"
79+
FontSize="26" />
80+
</StackPanel>
7381
</Grid>
7482
</Grid>
7583
</UserControl>

DigimonWorldNet6/Frontend.WPF/Windows/Main/UserControls/EmulatorLink/EmulatorLinkViewModel.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using System;
22
using System.Reactive.Disposables;
33
using System.Reactive.Linq;
4+
using System.Windows;
45
using System.Windows.Input;
56
using DigimonWorld.Frontend.WPF.ViewModelComponents;
7+
using DigimonWorld.Frontend.WPF.Windows.GeneralConfig.Dialogs;
68
using MemoryAccess;
79
using Shared.Enums;
810
using Shared.Services;
@@ -45,7 +47,8 @@ public EmulatorLinkViewModel()
4547

4648
_disposable = new CompositeDisposable(
4749
EmulatorLinkEventHub.EmulatorConnectedObservable.Subscribe(OnEmulatorConnectedChanged),
48-
EmulatorLinkEventHub.EmulatorLinkSyncModeChangedObservable.Subscribe(OnEmulatorSyncModeChanged)
50+
EmulatorLinkEventHub.EmulatorLinkSyncModeChangedObservable.Subscribe(OnEmulatorSyncModeChanged),
51+
EmulatorLinkEventHub.EmulatorInvalidRomDetectedObservable.Subscribe(_ => OnInvalidRomDetected())
4952
);
5053
}
5154

@@ -154,6 +157,19 @@ private void SyncFromEmulator()
154157
IsDisciplined = LiveMemoryReader.Instance.ConditionStats.Discipline >= 50;
155158
}
156159

160+
private static void OnInvalidRomDetected()
161+
{
162+
Application.Current.Dispatcher.Invoke(() =>
163+
{
164+
InvalidRomDialog dialog = new()
165+
{
166+
Owner = Application.Current.MainWindow
167+
};
168+
169+
dialog.ShowDialog();
170+
});
171+
}
172+
157173
public void Dispose()
158174
{
159175
_disposable.Dispose();

0 commit comments

Comments
 (0)