Skip to content

Commit

Permalink
update libraries and fix song detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jun Villa committed Dec 18, 2023
1 parent 236da71 commit c804554
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 15 deletions.
Binary file modified .vs/osu-trainer/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
8 changes: 6 additions & 2 deletions osu-trainer/BeatmapEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -777,9 +777,13 @@ private Beatmap LoadBeatmap(string beatmapPath)
{
retMap = BeatmapConstructorWrapper(beatmapPath);
}
catch
catch (Exception ex)
{
Console.WriteLine("Bad .osu file format");
Console.WriteLine($"An error occurred while reading {beatmapPath}");
Console.WriteLine("Exception Type: " + ex.GetType().Name);
Console.WriteLine("Message: " + ex.Message);
Console.WriteLine("Stack Trace: " + ex.StackTrace);

OriginalBeatmap = null;
NewBeatmap = null;
return null;
Expand Down
16 changes: 9 additions & 7 deletions osu-trainer/Forms/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using osu_trainer.Controls;
using osu_trainer.Forms;
using OsuMemoryDataProvider;
using OsuMemoryDataProvider.OsuMemoryModels.Direct;
using ProcessMemoryDataFinder.API;
using System;
using System.Collections.Generic;
using System.ComponentModel;
Expand All @@ -24,7 +26,7 @@ public partial class MainForm : Form
// Beatmap
private string userSongsFolder = null;

private IOsuMemoryReader osuReader;
private StructuredOsuMemoryReader osuReader;

// Common Control Lists
private List<Label> dumbLabels;
Expand Down Expand Up @@ -103,7 +105,7 @@ public MainForm()
Hotkeys.Add(Properties.Settings.Default.HotkeyProfile4);

// Init object instances
osuReader = OsuMemoryReader.Instance.GetInstanceForWindowTitleHint("");
osuReader = new StructuredOsuMemoryReader();
editor = new BeatmapEditor(this);

// Add event handlers (observers)
Expand Down Expand Up @@ -691,8 +693,9 @@ private void BeatmapUpdateTimer_Tick(object sender, EventArgs e)

// this can be cleaned up...
// Read memory for current map
string beatmapFilename = osuReader.GetOsuFileName();
string beatmapFolder = osuReader.GetMapFolderName();
osuReader.TryRead(osuReader.OsuMemoryAddresses.Beatmap);
string beatmapFilename = osuReader.OsuMemoryAddresses.Beatmap.OsuFileName;
string beatmapFolder = osuReader.OsuMemoryAddresses.Beatmap.FolderName;

var invalidChars = Path.GetInvalidPathChars();

Expand Down Expand Up @@ -742,9 +745,8 @@ private async void OsuRunningTimer_Tick(object sender, EventArgs e)
Properties.Settings.Default.Save();
}
}
int intStatus = 0;
osuReader.GetCurrentStatus(out intStatus);
OsuMemoryStatus status = (OsuMemoryStatus)intStatus;
osuReader.TryRead(osuReader.OsuMemoryAddresses.GeneralData);
OsuMemoryStatus status = (OsuMemoryStatus)(osuReader.OsuMemoryAddresses.GeneralData.OsuStatus);

if (status == OsuMemoryStatus.SongSelect || status == OsuMemoryStatus.MultiplayerRoom || status == OsuMemoryStatus.MultiplayerSongSelect)
mapSelectScreen = true;
Expand Down
6 changes: 3 additions & 3 deletions osu-trainer/osu-trainer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="FSharp.Core, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\FSharp.Core.7.0.0\lib\netstandard2.0\FSharp.Core.dll</HintPath>
<Reference Include="FSharp.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\FSharp.Core.8.0.100\lib\netstandard2.0\FSharp.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Win32.Registry, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Registry.4.7.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
Expand Down Expand Up @@ -129,7 +129,7 @@
<HintPath>..\packages\NVorbis.0.10.4\lib\net45\NVorbis.dll</HintPath>
</Reference>
<Reference Include="OsuMemoryDataProvider, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\OsuMemoryDataProvider.0.8.12\lib\net472\OsuMemoryDataProvider.dll</HintPath>
<HintPath>..\packages\OsuMemoryDataProvider.0.10.3\lib\net472\OsuMemoryDataProvider.dll</HintPath>
</Reference>
<Reference Include="ProcessMemoryDataFinder, Version=0.8.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ProcessMemoryDataFinder.0.8.5\lib\net472\ProcessMemoryDataFinder.dll</HintPath>
Expand Down
4 changes: 2 additions & 2 deletions osu-trainer/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Core" version="7.0.0" targetFramework="net48" />
<package id="FSharp.Core" version="8.0.100" targetFramework="net48" />
<package id="Microsoft.CSharp" version="4.7.0" targetFramework="net472" />
<package id="Microsoft.Win32.Registry" version="4.7.0" targetFramework="net472" />
<package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.2" targetFramework="net471" />
Expand All @@ -16,7 +16,7 @@
<package id="NAudio.WinMM" version="2.0.1" targetFramework="net472" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net471" />
<package id="NVorbis" version="0.10.4" targetFramework="net472" />
<package id="OsuMemoryDataProvider" version="0.8.12" targetFramework="net472" />
<package id="OsuMemoryDataProvider" version="0.10.3" targetFramework="net48" />
<package id="ProcessMemoryDataFinder" version="0.8.5" targetFramework="net472" />
<package id="System.Buffers" version="4.4.0" targetFramework="net472" />
<package id="System.Data.DataSetExtensions" version="4.5.0" targetFramework="net472" />
Expand Down
2 changes: 1 addition & 1 deletion osu-trainer/version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github repository name: FunOrange/osu-trainer
application name: osu-trainer.exe
current version: 1.7.0
current version: 1.8.0
check for updates: true

0 comments on commit c804554

Please sign in to comment.