commit 6cbbeaaac06bedbd97d785f2d7a59125a5d134f0 Author: Dean Herbert Date: Fri Aug 26 12:28:23 2016 +0900 Initial commit. diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000..759217430d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +# EditorConfig is awesome: http://editorconfig.org +root = true + +[*.cs] +end_of_line = crlf +insert_final_newline = true +indent_style = space +indent_size = 4 +trim_trailing_whitespace = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..f9cb7c5c9a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,19 @@ +# This won't normalise line endings, but it will ensure that merge drivers use CRLF +* -text eol=crlf + +# Currently in-use binary file extensions +*.blend binary +*.bmp binary +*.dll binary +*.exe binary +*.icns binary +*.ico binary +*.jpg binary +*.osz2 binary +*.pdn binary +*.psd binary +*.PSD binary +*.tga binary +*.ttf binary +*.wav binary +*.xnb binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..b193db3d66 --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +*.pfx +*.user +*DS_Store* +*/bin/ +*/obj/ +*/Build/ +*.suo +*.idea +*.dmg + +*.docstates + +Staging/ + +.dropbox +*desktop.ini +*Icon + +*.dpkg-dist +*.ucf-dist + +packages/* +!packages/repositories.config +.vs/* + +*.userprefs diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..ee1cc80880 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "osu-framework"] + path = osu-framework + url = https://github.com/ppy/osu-framework +[submodule "osu-resources"] + path = osu-resources + url = https://github.com/ppy/osu-resources diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..cb2b6d92db --- /dev/null +++ b/.travis.yml @@ -0,0 +1,2 @@ +language: csharp +solution: osu.sln \ No newline at end of file diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000000..10cef3dd6e --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2007-2016 ppy Pty Ltd . + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000..eb14683e75 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# osu! +[osu! on the web](https://osu.ppy.sh) | [dev chat](https://discord.gg/ppy) + +Rhythm is just a *click* away. The future of osu! and the beginning of an open era! + +# Requirements + +- A desktop platform which can compile .NET 4.5. +- Visual Studio or MonoDevelop is recommended. + +# Contributing + +We welcome all contributions, but keep in mind that we already have a lot of the UI designed. If you wish to work on something with the intention on having it included in the official distribution, please open an issue for discussion and we will give you what you need from a design perspective to proceed. If you want to make *changes* to the design, we recommend you open an issue with your intentions before spending too much time, to ensure no effort is wasted. + +Contributions can be made via pull requests to this repository. We hope to credit and reward larger contributions via a [bounty system](https://goo.gl/nFdoyI). If you're unsure of what you can help with, check out the [list](https://github.com/ppy/osu/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3Abounty) of available issues with bounty. + +Note that while we already have certain standards in place, nothing is set in stone. If you have an issue with the way code is structured; with any libraries we are using; with any processes involved with contributing, *please* bring it up. I welcome all feedback so we can make contributing to this project as pain-free as possible. + +# Licence + +The osu! client code and framework are licensed under the [MIT licence](https://opensource.org/licenses/MIT). Please see [the licence file](LICENCE) for more information. [tl;dr](https://tldrlegal.com/license/mit-license) you can do whatever you want as long as you include the original copyright and license notice in any copy of the software/source. + +Please note that this *does not cover* the usage of the "osu!" or "ppy" branding in any software, resources, advertising or promotion, as this is protected by trademark law. + +Please also note that game resources are covered by a separate licence. Please see the [ppy/osu-resources](https://github.com/ppy/osu-resources) repository for clarifications. diff --git a/osu-framework b/osu-framework new file mode 160000 index 0000000000..f3d00712fd --- /dev/null +++ b/osu-framework @@ -0,0 +1 @@ +Subproject commit f3d00712fd6eceb0c999ccc5e1aecf69e91525b3 diff --git a/osu-resources b/osu-resources new file mode 160000 index 0000000000..8c3cc166e6 --- /dev/null +++ b/osu-resources @@ -0,0 +1 @@ +Subproject commit 8c3cc166e61d0636fb2824fbb56c6059e38a6827 diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs new file mode 100644 index 0000000000..43e2c3a2e8 --- /dev/null +++ b/osu.Desktop/Program.cs @@ -0,0 +1,21 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT License - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using osu.Framework.Desktop; +using osu.Framework.Framework; +using osu.Game; + +namespace osu.Desktop +{ + public static class Program + { + [STAThread] + public static void Main() + { + BasicGameHost host = Host.GetSuitableHost(); + host.Load(new OsuGame()); + host.Run(); + } + } +} diff --git a/osu.Desktop/Properties/app.manifest b/osu.Desktop/Properties/app.manifest new file mode 100644 index 0000000000..979946adba --- /dev/null +++ b/osu.Desktop/Properties/app.manifest @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + * + * + + + + + + + + + + + true + + + diff --git a/osu.Desktop/lazer.ico b/osu.Desktop/lazer.ico new file mode 100644 index 0000000000..0c894dca41 Binary files /dev/null and b/osu.Desktop/lazer.ico differ diff --git a/osu.Desktop/osu!.res b/osu.Desktop/osu!.res new file mode 100644 index 0000000000..72bbe57578 Binary files /dev/null and b/osu.Desktop/osu!.res differ diff --git a/osu.Desktop/osu.Desktop.csproj b/osu.Desktop/osu.Desktop.csproj new file mode 100644 index 0000000000..21f7fbf3a3 --- /dev/null +++ b/osu.Desktop/osu.Desktop.csproj @@ -0,0 +1,172 @@ + + + + {2A66DD92-ADB1-4994-89E2-C94E04ACDA0D} + Debug + AnyCPU + WinExe + Properties + osu.Desktop + osu! + 3CF060CD28877D0E3112948951A64B2A7CEEC909 + codesigning.pfx + false + false + false + + + 3.5 + + + osu.Desktop.Program + OnOutputUpdated + false + LocalIntranet + v4.5 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 2 + 1.0.0.%2a + false + true + 12.0.0 + 2.0 + + + + + + + true + full + false + bin\Debug\ + DEBUG + prompt + 0 + true + false + AnyCPU + true + AllRules.ruleset + false + true + + + none + true + bin\Release\ + CuttingEdge NoUpdate + prompt + 4 + true + false + AnyCPU + true + AllRules.ruleset + false + + + osu!.res + + + bin\Deploy\ + CuttingEdge + true + true + true + AnyCPU + false + prompt + AllRules.ruleset + false + + + + + + + + osu.licenseheader + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + + + {65dc628f-a640-4111-ab35-3a5652bc1e17} + osu.Framework.Desktop + + + {c76bf5b3-985e-4d39-95fe-97c9c879b83a} + osu.Framework + + + {d9a367c9-4c1a-489f-9b05-a0cea2b53b58} + osu.Game.Resources + + + {0d3fbf8a-7464-4cf7-8c90-3e7886df2d4d} + osu.Game + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs new file mode 100644 index 0000000000..2ac7a500ed --- /dev/null +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -0,0 +1,24 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT License - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Configuration; + +namespace osu.Game.Configuration +{ + class OsuConfigManager : ConfigManager + { + protected override void InitialiseDefaults() + { + Set(OsuConfig.Width, 1366); + Set(OsuConfig.Height, 768); + Set(OsuConfig.MouseSensitivity, 1.0); + } + } + + enum OsuConfig + { + Width, + Height, + MouseSensitivity, + } +} diff --git a/osu.Game/GameModes/FieldTest.cs b/osu.Game/GameModes/FieldTest.cs new file mode 100644 index 0000000000..908354af96 --- /dev/null +++ b/osu.Game/GameModes/FieldTest.cs @@ -0,0 +1,134 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT License - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using OpenTK; +using OpenTK.Graphics; +using osu.Framework; +using osu.Framework.GameModes; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; +using osu.Framework.Input; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Threading; + +namespace osu.Game.GameModes +{ + internal class FieldTest : GameMode + { + private AutoSizeContainer container; + + public override void Load() + { + base.Load(); + + OsuGame game = Game as OsuGame; + + Add(new Box() + { + SizeMode = InheritMode.XY, + + Size = new Vector2(1, 1), + Colour = Color4.DarkRed + }); + + ClickableBox button; + Add(button = new ClickableBox(Color4.Pink) + { + Size = new Vector2(50, 50) + }); + + button.Activated += () => ExitMode(); + + Add(container = new AutoSizeContainer() + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }); + + container.Add(new ClickableBox(Color4.SkyBlue) + { + SizeMode = InheritMode.XY, + + Size = Vector2.One + }); + + container.Add(new ClickableBox(Color4.Orange) + { + Size = new Vector2(50, 50), + Anchor = Anchor.TopLeft, + Origin = Anchor.TopLeft + }); + + container.Add(new ClickableBox(Color4.Orange) + { + Size = new Vector2(50, 50), + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight + }); + + container.Add(new ClickableBox(Color4.Orange) + { + Size = new Vector2(50, 50), + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft + }); + + + container.Add(new ClickableBox(Color4.Blue) + { + Size = new Vector2(10, 10), + Anchor = Anchor.Centre, + Origin = Anchor.Centre + }); + + container.Add(new ClickableBox(Color4.Orange) + { + Size = new Vector2(50, 50), + Anchor = Anchor.BottomRight, + Origin = Anchor.BottomRight + }); + + container.Add(new SpriteCircular(game.Textures.Get("coin")) + { + Position = new Vector2(100), + Origin = Anchor.Centre, + Anchor = Anchor.Centre + }); + + Add(new SpriteText(game.Textures) + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + + Text = "12345" + }); + } + + class ClickableBox : Box + { + public ClickableBox(Color4? colour = default(Color4?)) + { + Colour = colour ?? Color4.White; + } + + internal event VoidDelegate Activated; + + protected override bool OnClick(InputState state) + { + Scale = 1.5f; + ScaleTo(1, 500, EasingTypes.In); + + Activated?.Invoke(); + + return true; + } + } + } +} diff --git a/osu.Game/GameModes/FontTest.cs b/osu.Game/GameModes/FontTest.cs new file mode 100644 index 0000000000..935cef3c82 --- /dev/null +++ b/osu.Game/GameModes/FontTest.cs @@ -0,0 +1,51 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT License - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework; +using osu.Framework.GameModes; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics.Containers; + +namespace osu.Game.GameModes +{ + class FontTest : OsuGameMode + { + private FlowContainer flow; + + public override void Load() + { + base.Load(); + + flow = new FlowContainer() + { + Anchor = Anchor.TopLeft, + Direction = FlowDirection.VerticalOnly + }; + Add(flow); + + for (int i = 1; i < 50; i++) + { + SpriteText text = new SpriteText() + { + Text = $@"Font testy at size {i}", + Scale = i + }; + + flow.Add(text); + } + } + + protected override void Update() + { + base.Update(); + } + } +} diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs new file mode 100644 index 0000000000..1bc0b06c8d --- /dev/null +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -0,0 +1,627 @@ +//Copyright (c) 2007-2016 ppy Pty Ltd . +//Licensed under the MIT License - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Drawables; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Transformations; +using osu.Framework.Input; +using osu.Framework.Threading; +using osu.Game.Graphics; +using osu.Game.Graphics.Containers; +using OpenTK; +using OpenTK.Graphics; +using OpenTK.Input; + +namespace osu.Game.GameModes.Menu +{ + internal class ButtonSystem : OsuLargeComponent + { + private FlowContainerWithOrigin buttonFlow; + + const float button_area_height = 128; + const float button_width = 180f; + const float wedge_width = 25.6f; + + private OsuLogo osuLogo; + private Drawable iconFacade; + private Container buttonArea; + + private Button backButton; + private Button settingsButton; + + List