Skip to content

Commit

Permalink
bump osu version, localisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Flutterish committed Aug 13, 2022
1 parent 9e9eac6 commit e8ad86d
Show file tree
Hide file tree
Showing 17 changed files with 177 additions and 42 deletions.
8 changes: 4 additions & 4 deletions osu.Game.Rulesets.Solosu/Beatmaps/SolosuBeatmap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ public override IEnumerable<BeatmapStatistic> GetStatistics () {
var packets = HitObjects.OfType<Packet>();
if ( packets.Any() ) yield return new BeatmapStatistic {
CreateIcon = () => new BeatmapStatisticIcon( BeatmapStatisticsIconType.Circles ),
Name = Localisation.Stats.Strings.Packets,
Name = Localisation.StatsStrings.Packets,
Content = packets.Count().ToString()
};

var streams = HitObjects.OfType<Stream>();
if ( streams.Any() ) yield return new BeatmapStatistic {
CreateIcon = () => new BeatmapStatisticIcon( BeatmapStatisticsIconType.Sliders ),
Name = Localisation.Stats.Strings.Streams,
Name = Localisation.StatsStrings.Streams,
Content = streams.Count().ToString()
};

var multistreams = HitObjects.OfType<MultiLaneStream>();
if ( multistreams.Any() ) yield return new BeatmapStatistic {
CreateIcon = () => new BeatmapStatisticIcon( BeatmapStatisticsIconType.Spinners ),
Name = Localisation.Stats.Strings.MultiStreams,
Name = Localisation.StatsStrings.MultiStreams,
Content = multistreams.Count().ToString()
};

var hardBeats = HitObjects.OfType<HardBeat>();
if ( hardBeats.Any() ) yield return new BeatmapStatistic {
CreateIcon = () => new BeatmapStatisticIcon( BeatmapStatisticsIconType.Circles ),
Name = Localisation.Stats.Strings.Beats,
Name = Localisation.StatsStrings.Beats,
Content = hardBeats.Count().ToString()
};
}
Expand Down
33 changes: 33 additions & 0 deletions osu.Game.Rulesets.Solosu/Localisation/Action.Strings.pl.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="center"><value>Środek</value></data>
<data name="left"><value>Lewo</value></data>
<data name="right"><value>Prawo</value></data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

using osu.Framework.Localisation;

namespace osu.Game.Rulesets.Solosu.Localisation.Action {
public static class Strings {
namespace osu.Game.Rulesets.Solosu.Localisation {
public static class ActionStrings {
private const string PREFIX = "osu.Game.Rulesets.Solosu.Localisation.Action.Strings";
private static string getKey( string key ) => $"{PREFIX}:{key}";

Expand Down
34 changes: 34 additions & 0 deletions osu.Game.Rulesets.Solosu/Localisation/Judgement.Strings.pl.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="great"><value>Nieźle</value></data>
<data name="miss"><value>Błąd</value></data>
<data name="ok"><value>Ok</value></data>
<data name="perfect"><value>Idealnie</value></data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

using osu.Framework.Localisation;

namespace osu.Game.Rulesets.Solosu.Localisation.Judgement {
public static class Strings {
namespace osu.Game.Rulesets.Solosu.Localisation {
public static class JudgementStrings {
private const string PREFIX = "osu.Game.Rulesets.Solosu.Localisation.Judgement.Strings";
private static string getKey( string key ) => $"{PREFIX}:{key}";

Expand Down
32 changes: 32 additions & 0 deletions osu.Game.Rulesets.Solosu/Localisation/Mod.Strings.pl.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="autoplay-description"><value>Pozwól słodziaczkobotowi... czekaj, gdzie on jest?</value></data>
<data name="no-fail-description"><value>Nic nie przebije TCP</value></data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

using osu.Framework.Localisation;

namespace osu.Game.Rulesets.Solosu.Localisation.Mod {
public static class Strings {
namespace osu.Game.Rulesets.Solosu.Localisation {
public static class ModStrings {
private const string PREFIX = "osu.Game.Rulesets.Solosu.Localisation.Mod.Strings";
private static string getKey( string key ) => $"{PREFIX}:{key}";

Expand Down
34 changes: 34 additions & 0 deletions osu.Game.Rulesets.Solosu/Localisation/Stats.Strings.pl.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype"><value>text/microsoft-resx</value></resheader><resheader name="version"><value>1.3</value></resheader><resheader name="reader"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name="writer"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><data name="beats"><value>Hard Beaty</value></data>
<data name="multi-streams"><value>Multi-Streamy</value></data>
<data name="packets"><value>Pakiety</value></data>
<data name="streams"><value>Streamy</value></data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

using osu.Framework.Localisation;

namespace osu.Game.Rulesets.Solosu.Localisation.Stats {
public static class Strings {
namespace osu.Game.Rulesets.Solosu.Localisation {
public static class StatsStrings {
private const string PREFIX = "osu.Game.Rulesets.Solosu.Localisation.Stats.Strings";
private static string getKey( string key ) => $"{PREFIX}:{key}";

Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Solosu/Mods/SolosuModAutoplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public class SolosuModAutoplay : ModAutoplay {
Replay = new SolosuAutoGenerator( beatmap ).Generate(),
};

public override string Description => SolosuRuleset.GetLocalisedHack( Localisation.Mod.Strings.AutoplayDescription );
public override string Description => SolosuRuleset.GetLocalisedHack( Localisation.ModStrings.AutoplayDescription );
}
}
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Solosu/Mods/SolosuModNoFail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

namespace osu.Game.Rulesets.Solosu.Mods {
public class SolosuModNoFail : ModNoFail {
public override string Description => SolosuRuleset.GetLocalisedHack( Localisation.Mod.Strings.NoFailDescription );
public override string Description => SolosuRuleset.GetLocalisedHack( Localisation.ModStrings.NoFailDescription );
}
}
6 changes: 3 additions & 3 deletions osu.Game.Rulesets.Solosu/SolosuInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ public SolosuInputManager ( RulesetInfo ruleset ) : base( ruleset, 0, Simultaneo
}

public enum SolosuAction {
[LocalisableDescription( typeof( Localisation.Action.Strings ), nameof( Localisation.Action.Strings.Left ) )]
[LocalisableDescription( typeof( Localisation.ActionStrings ), nameof( Localisation.ActionStrings.Left ) )]
Left,

// this is for buffered input
[LocalisableDescription( typeof( Localisation.Action.Strings ), nameof( Localisation.Action.Strings.Center ) )]
[LocalisableDescription( typeof( Localisation.ActionStrings ), nameof( Localisation.ActionStrings.Center ) )]
Center,

[LocalisableDescription( typeof( Localisation.Action.Strings ), nameof( Localisation.Action.Strings.Right ) )]
[LocalisableDescription( typeof( Localisation.ActionStrings ), nameof( Localisation.ActionStrings.Right ) )]
Right
}
}
8 changes: 4 additions & 4 deletions osu.Game.Rulesets.Solosu/SolosuRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public override IEnumerable<KeyBinding> GetDefaultKeyBindings ( int variant = 0
public override Drawable CreateIcon () => new SolosuIcon( this );

private Dictionary<HitResult, LocalisableString> results = new Dictionary<HitResult, LocalisableString> {
[ HitResult.Perfect ] = Localisation.Judgement.Strings.Perfect,
[ HitResult.Great ] = Localisation.Judgement.Strings.Great,
[ HitResult.Meh ] = Localisation.Judgement.Strings.Ok,
[ HitResult.Miss ] = Localisation.Judgement.Strings.Miss
[ HitResult.Perfect ] = Localisation.JudgementStrings.Perfect,
[ HitResult.Great ] = Localisation.JudgementStrings.Great,
[ HitResult.Meh ] = Localisation.JudgementStrings.Ok,
[ HitResult.Miss ] = Localisation.JudgementStrings.Miss
};

protected override IEnumerable<HitResult> GetValidHitResults ()
Expand Down
26 changes: 14 additions & 12 deletions osu.Game.Rulesets.Solosu/SolosuTextures.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Textures;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using System;

namespace osu.Game.Rulesets.Solosu {
public static class SolosuTextures {
public static Texture Generate ( int width, int height, Func<int, int, Rgba32> generator ) {
public static Texture Generate ( IRenderer renderer, int width, int height, Func<int, int, Rgba32> generator ) {
Image<Rgba32> image = new Image<Rgba32>( width, height );
image.ProcessPixelRows( rows => {
for ( int y = 0; y < height; y++ ) {
Expand All @@ -16,20 +17,21 @@ public static Texture Generate ( int width, int height, Func<int, int, Rgba32> g
}
} );

Texture texture = new Texture( width, height, true );
Texture texture = renderer.CreateTexture( width, height, true );
texture.SetData( new TextureUpload( image ) );
return texture;
}
public static Texture GeneratePercentile ( int width, int height, Func<double, double, Rgba32> generator )
=> Generate( width, height, ( x, y ) => generator( (double)x / width, (double)y / height ) );
public static Texture GenerateMirroredPercentile ( int width, int height, Func<double, double, Rgba32> generator )
=> Generate( width, height, ( x, y ) => generator( 1 - Math.Abs( 1 - x * 2d / width ), 1 - Math.Abs( 1 - y * 2d / height ) ) );
public static Texture WidthFade ( int width, int height )
=> Generate( width, height, ( x, y ) => new Rgba32( 255, 255, 255, (byte)( 255 - MathF.Abs( 1 - 2f * x / width ) * 255 ) ) );
public static Texture GeneratePercentile ( IRenderer renderer, int width, int height, Func<double, double, Rgba32> generator )
=> Generate( renderer, width, height, ( x, y ) => generator( (double)x / width, (double)y / height ) );
public static Texture GenerateMirroredPercentile ( IRenderer renderer, int width, int height, Func<double, double, Rgba32> generator )
=> Generate( renderer, width, height, ( x, y ) => generator( 1 - Math.Abs( 1 - x * 2d / width ), 1 - Math.Abs( 1 - y * 2d / height ) ) );
public static Texture WidthFade ( IRenderer renderer, int width, int height )
=> Generate( renderer, width, height, ( x, y ) => new Rgba32( 255, 255, 255, (byte)( 255 - MathF.Abs( 1 - 2f * x / width ) * 255 ) ) );

public static Texture FadeLeft ( int width, int height )
=> Generate( width, height, ( x, y ) => new Rgba32( 255, 255, 255, (byte)( 255 * ( width - x ) / width ) ) );
public static Texture FadeLeft ( IRenderer renderer, int width, int height )
=> Generate( renderer, width, height, ( x, y ) => new Rgba32( 255, 255, 255, (byte)( 255 * ( width - x ) / width ) ) );

public static Texture CachedFadeLeft = FadeLeft( 100, 100 );
static Texture cachedFadeLeft;
public static Texture CachedFadeLeft ( IRenderer renderer ) => cachedFadeLeft ??= FadeLeft( renderer, 100, 100 );
}
}
6 changes: 4 additions & 2 deletions osu.Game.Rulesets.Solosu/UI/PlayerByte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input.Bindings;
Expand Down Expand Up @@ -218,10 +219,11 @@ public void MoveTo ( Lane lane ) {
}

private class PlayerLine : CompositeDrawable {
public PlayerLine () {
[BackgroundDependencyLoader]
private void load ( IRenderer renderer ) {
Origin = Anchor.Centre;
Anchor = Anchor.Centre;
AddInternal( new Sprite { Width = 500, Height = 2, Origin = Anchor.Centre, Anchor = Anchor.Centre, Texture = SolosuTextures.WidthFade( 500, 2 ), Alpha = 0.6f } );
AddInternal( new Sprite { Width = 500, Height = 2, Origin = Anchor.Centre, Anchor = Anchor.Centre, Texture = SolosuTextures.WidthFade( renderer, 500, 2 ), Alpha = 0.6f } );
// TODO maybe add the key being held effect from the key overlay when on the side
}
}
Expand Down
10 changes: 4 additions & 6 deletions osu.Game.Rulesets.Solosu/UI/Wireframe.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using osu.Framework.Layout;
Expand Down Expand Up @@ -54,13 +54,11 @@ protected override DrawNode CreateDrawNode ()

private class WireframeDrawNode : DrawNode {
private Wireframe wf;
private Texture texture;
readonly List<Line> lines;
Vector2 size;
IShader shader;
float width = 3;
public WireframeDrawNode ( Wireframe source ) : base( source ) {
texture = Texture.WhitePixel;
wf = source;
lines = wf.Lines;
}
Expand All @@ -71,8 +69,8 @@ public override void ApplyState () {
shader = wf.TextureShader;
}

public override void Draw ( Action<TexturedVertex2D> vertexAction ) {
base.Draw( vertexAction );
public override void Draw ( IRenderer renderer ) {
base.Draw( renderer );

shader.Bind();

Expand All @@ -86,7 +84,7 @@ public override void Draw ( Action<TexturedVertex2D> vertexAction ) {
to -= dif;
var perp = dif.PerpendicularLeft * width / 2;

DrawQuad( texture, new Quad( from + perp, from - perp, to + perp, to - perp ), DrawColourInfo.Colour );
renderer.DrawQuad( renderer.WhitePixel, new Quad( from + perp, from - perp, to + perp, to - perp ), DrawColourInfo.Colour );
}

shader.Unbind();
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Solosu/osu.Game.Rulesets.Solosu.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<EmbeddedResource Include="Resources\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2022.731.1" />
<PackageReference Include="ppy.osu.Game" Version="2022.810.2" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\Samples\Gameplay" />
Expand Down

0 comments on commit e8ad86d

Please sign in to comment.