mirror of
https://github.com/ppy/osu.git
synced 2025-03-11 15:27:20 +08:00
Merge remote-tracking branch 'upstream/master' into Vidalee-osu-hd-setting
This commit is contained in:
commit
76e58a51b9
43
.gitattributes
vendored
43
.gitattributes
vendored
@ -1,19 +1,24 @@
|
|||||||
# This won't normalise line endings, but it will ensure that merge drivers use CRLF
|
# Autodetect text files and ensure that we normalise their
|
||||||
* -text eol=crlf
|
# line endings to lf internally. When checked out they may
|
||||||
|
# use different line endings.
|
||||||
# Currently in-use binary file extensions
|
* text=auto
|
||||||
*.blend binary
|
|
||||||
*.bmp binary
|
# Check out with crlf (Windows) line endings
|
||||||
*.dll binary
|
*.sln text eol=crlf
|
||||||
*.exe binary
|
*.csproj text eol=crlf
|
||||||
*.icns binary
|
*.cs text diff=csharp eol=crlf
|
||||||
*.ico binary
|
*.resx text eol=crlf
|
||||||
*.jpg binary
|
*.vsixmanifest text eol=crlf
|
||||||
*.osz2 binary
|
packages.config text eol=crlf
|
||||||
*.pdn binary
|
App.config text eol=crlf
|
||||||
*.psd binary
|
*.bat text eol=crlf
|
||||||
*.PSD binary
|
*.cmd text eol=crlf
|
||||||
*.tga binary
|
*.snippet text eol=crlf
|
||||||
*.ttf binary
|
*.manifest text eol=crlf
|
||||||
*.wav binary
|
|
||||||
*.xnb binary
|
# Check out with lf (UNIX) line endings
|
||||||
|
*.sh text eol=lf
|
||||||
|
.gitignore text eol=lf
|
||||||
|
.gitattributes text eol=lf
|
||||||
|
*.md text eol=lf
|
||||||
|
.travis.yml text eol=lf
|
518
.gitignore
vendored
518
.gitignore
vendored
@ -1,259 +1,259 @@
|
|||||||
## Ignore Visual Studio temporary files, build results, and
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
## files generated by popular Visual Studio add-ons.
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
# User-specific files
|
# User-specific files
|
||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
*.userosscache
|
*.userosscache
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
|
||||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
*.userprefs
|
*.userprefs
|
||||||
|
|
||||||
# Build results
|
# Build results
|
||||||
bin/[Dd]ebug/
|
bin/[Dd]ebug/
|
||||||
[Dd]ebugPublic/
|
[Dd]ebugPublic/
|
||||||
[Rr]elease/
|
[Rr]elease/
|
||||||
[Rr]eleases/
|
[Rr]eleases/
|
||||||
bld/
|
bld/
|
||||||
[Bb]in/
|
[Bb]in/
|
||||||
[Oo]bj/
|
[Oo]bj/
|
||||||
[Ll]og/
|
[Ll]og/
|
||||||
|
|
||||||
# Visual Studio 2015 cache/options directory
|
# Visual Studio 2015 cache/options directory
|
||||||
.vs/
|
.vs/
|
||||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
#wwwroot/
|
#wwwroot/
|
||||||
|
|
||||||
# MSTest test Results
|
# MSTest test Results
|
||||||
[Tt]est[Rr]esult*/
|
[Tt]est[Rr]esult*/
|
||||||
[Bb]uild[Ll]og.*
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
# NUNIT
|
# NUNIT
|
||||||
*.VisualState.xml
|
*.VisualState.xml
|
||||||
TestResult.xml
|
TestResult.xml
|
||||||
|
|
||||||
# Build Results of an ATL Project
|
# Build Results of an ATL Project
|
||||||
[Dd]ebugPS/
|
[Dd]ebugPS/
|
||||||
[Rr]eleasePS/
|
[Rr]eleasePS/
|
||||||
dlldata.c
|
dlldata.c
|
||||||
|
|
||||||
# DNX
|
# DNX
|
||||||
project.lock.json
|
project.lock.json
|
||||||
project.fragment.lock.json
|
project.fragment.lock.json
|
||||||
artifacts/
|
artifacts/
|
||||||
|
|
||||||
*_i.c
|
*_i.c
|
||||||
*_p.c
|
*_p.c
|
||||||
*_i.h
|
*_i.h
|
||||||
*.ilk
|
*.ilk
|
||||||
*.meta
|
*.meta
|
||||||
*.obj
|
*.obj
|
||||||
*.pch
|
*.pch
|
||||||
*.pdb
|
*.pdb
|
||||||
*.pgc
|
*.pgc
|
||||||
*.pgd
|
*.pgd
|
||||||
*.rsp
|
*.rsp
|
||||||
*.sbr
|
*.sbr
|
||||||
*.tlb
|
*.tlb
|
||||||
*.tli
|
*.tli
|
||||||
*.tlh
|
*.tlh
|
||||||
*.tmp
|
*.tmp
|
||||||
*.tmp_proj
|
*.tmp_proj
|
||||||
*.log
|
*.log
|
||||||
*.vspscc
|
*.vspscc
|
||||||
*.vssscc
|
*.vssscc
|
||||||
.builds
|
.builds
|
||||||
*.pidb
|
*.pidb
|
||||||
*.svclog
|
*.svclog
|
||||||
*.scc
|
*.scc
|
||||||
|
|
||||||
# Chutzpah Test files
|
# Chutzpah Test files
|
||||||
_Chutzpah*
|
_Chutzpah*
|
||||||
|
|
||||||
# Visual C++ cache files
|
# Visual C++ cache files
|
||||||
ipch/
|
ipch/
|
||||||
*.aps
|
*.aps
|
||||||
*.ncb
|
*.ncb
|
||||||
*.opendb
|
*.opendb
|
||||||
*.opensdf
|
*.opensdf
|
||||||
*.sdf
|
*.sdf
|
||||||
*.cachefile
|
*.cachefile
|
||||||
*.VC.db
|
*.VC.db
|
||||||
*.VC.VC.opendb
|
*.VC.VC.opendb
|
||||||
|
|
||||||
# Visual Studio profiler
|
# Visual Studio profiler
|
||||||
*.psess
|
*.psess
|
||||||
*.vsp
|
*.vsp
|
||||||
*.vspx
|
*.vspx
|
||||||
*.sap
|
*.sap
|
||||||
|
|
||||||
# TFS 2012 Local Workspace
|
# TFS 2012 Local Workspace
|
||||||
$tf/
|
$tf/
|
||||||
|
|
||||||
# Guidance Automation Toolkit
|
# Guidance Automation Toolkit
|
||||||
*.gpState
|
*.gpState
|
||||||
|
|
||||||
# ReSharper is a .NET coding add-in
|
# ReSharper is a .NET coding add-in
|
||||||
_ReSharper*/
|
_ReSharper*/
|
||||||
*.[Rr]e[Ss]harper
|
*.[Rr]e[Ss]harper
|
||||||
*.DotSettings.user
|
*.DotSettings.user
|
||||||
|
|
||||||
# JustCode is a .NET coding add-in
|
# JustCode is a .NET coding add-in
|
||||||
.JustCode
|
.JustCode
|
||||||
|
|
||||||
# TeamCity is a build add-in
|
# TeamCity is a build add-in
|
||||||
_TeamCity*
|
_TeamCity*
|
||||||
|
|
||||||
# DotCover is a Code Coverage Tool
|
# DotCover is a Code Coverage Tool
|
||||||
*.dotCover
|
*.dotCover
|
||||||
|
|
||||||
# NCrunch
|
# NCrunch
|
||||||
_NCrunch_*
|
_NCrunch_*
|
||||||
.*crunch*.local.xml
|
.*crunch*.local.xml
|
||||||
nCrunchTemp_*
|
nCrunchTemp_*
|
||||||
|
|
||||||
# MightyMoose
|
# MightyMoose
|
||||||
*.mm.*
|
*.mm.*
|
||||||
AutoTest.Net/
|
AutoTest.Net/
|
||||||
|
|
||||||
# Web workbench (sass)
|
# Web workbench (sass)
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
|
|
||||||
# Installshield output folder
|
# Installshield output folder
|
||||||
[Ee]xpress/
|
[Ee]xpress/
|
||||||
|
|
||||||
# DocProject is a documentation generator add-in
|
# DocProject is a documentation generator add-in
|
||||||
DocProject/buildhelp/
|
DocProject/buildhelp/
|
||||||
DocProject/Help/*.HxT
|
DocProject/Help/*.HxT
|
||||||
DocProject/Help/*.HxC
|
DocProject/Help/*.HxC
|
||||||
DocProject/Help/*.hhc
|
DocProject/Help/*.hhc
|
||||||
DocProject/Help/*.hhk
|
DocProject/Help/*.hhk
|
||||||
DocProject/Help/*.hhp
|
DocProject/Help/*.hhp
|
||||||
DocProject/Help/Html2
|
DocProject/Help/Html2
|
||||||
DocProject/Help/html
|
DocProject/Help/html
|
||||||
|
|
||||||
# Click-Once directory
|
# Click-Once directory
|
||||||
publish/
|
publish/
|
||||||
|
|
||||||
# Publish Web Output
|
# Publish Web Output
|
||||||
*.[Pp]ublish.xml
|
*.[Pp]ublish.xml
|
||||||
*.azurePubxml
|
*.azurePubxml
|
||||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||||
# but database connection strings (with potential passwords) will be unencrypted
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
*.pubxml
|
*.pubxml
|
||||||
*.publishproj
|
*.publishproj
|
||||||
|
|
||||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
# in these scripts will be unencrypted
|
# in these scripts will be unencrypted
|
||||||
PublishScripts/
|
PublishScripts/
|
||||||
|
|
||||||
# NuGet Packages
|
# NuGet Packages
|
||||||
*.nupkg
|
*.nupkg
|
||||||
# The packages folder can be ignored because of Package Restore
|
# The packages folder can be ignored because of Package Restore
|
||||||
**/packages/*
|
**/packages/*
|
||||||
# except build/, which is used as an MSBuild target.
|
# except build/, which is used as an MSBuild target.
|
||||||
!**/packages/build/
|
!**/packages/build/
|
||||||
# Uncomment if necessary however generally it will be regenerated when needed
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
#!**/packages/repositories.config
|
#!**/packages/repositories.config
|
||||||
# NuGet v3's project.json files produces more ignoreable files
|
# NuGet v3's project.json files produces more ignoreable files
|
||||||
*.nuget.props
|
*.nuget.props
|
||||||
*.nuget.targets
|
*.nuget.targets
|
||||||
|
|
||||||
# Microsoft Azure Build Output
|
# Microsoft Azure Build Output
|
||||||
csx/
|
csx/
|
||||||
*.build.csdef
|
*.build.csdef
|
||||||
|
|
||||||
# Microsoft Azure Emulator
|
# Microsoft Azure Emulator
|
||||||
ecf/
|
ecf/
|
||||||
rcf/
|
rcf/
|
||||||
|
|
||||||
# Windows Store app package directories and files
|
# Windows Store app package directories and files
|
||||||
AppPackages/
|
AppPackages/
|
||||||
BundleArtifacts/
|
BundleArtifacts/
|
||||||
Package.StoreAssociation.xml
|
Package.StoreAssociation.xml
|
||||||
_pkginfo.txt
|
_pkginfo.txt
|
||||||
|
|
||||||
# Visual Studio cache files
|
# Visual Studio cache files
|
||||||
# files ending in .cache can be ignored
|
# files ending in .cache can be ignored
|
||||||
*.[Cc]ache
|
*.[Cc]ache
|
||||||
# but keep track of directories ending in .cache
|
# but keep track of directories ending in .cache
|
||||||
!*.[Cc]ache/
|
!*.[Cc]ache/
|
||||||
|
|
||||||
# Others
|
# Others
|
||||||
ClientBin/
|
ClientBin/
|
||||||
~$*
|
~$*
|
||||||
*~
|
*~
|
||||||
*.dbmdl
|
*.dbmdl
|
||||||
*.dbproj.schemaview
|
*.dbproj.schemaview
|
||||||
*.pfx
|
*.pfx
|
||||||
*.publishsettings
|
*.publishsettings
|
||||||
node_modules/
|
node_modules/
|
||||||
orleans.codegen.cs
|
orleans.codegen.cs
|
||||||
|
|
||||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
#bower_components/
|
#bower_components/
|
||||||
|
|
||||||
# RIA/Silverlight projects
|
# RIA/Silverlight projects
|
||||||
Generated_Code/
|
Generated_Code/
|
||||||
|
|
||||||
# Backup & report files from converting an old project file
|
# Backup & report files from converting an old project file
|
||||||
# to a newer Visual Studio version. Backup files are not needed,
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
# because we have git ;-)
|
# because we have git ;-)
|
||||||
_UpgradeReport_Files/
|
_UpgradeReport_Files/
|
||||||
Backup*/
|
Backup*/
|
||||||
UpgradeLog*.XML
|
UpgradeLog*.XML
|
||||||
UpgradeLog*.htm
|
UpgradeLog*.htm
|
||||||
|
|
||||||
# SQL Server files
|
# SQL Server files
|
||||||
*.mdf
|
*.mdf
|
||||||
*.ldf
|
*.ldf
|
||||||
|
|
||||||
# Business Intelligence projects
|
# Business Intelligence projects
|
||||||
*.rdl.data
|
*.rdl.data
|
||||||
*.bim.layout
|
*.bim.layout
|
||||||
*.bim_*.settings
|
*.bim_*.settings
|
||||||
|
|
||||||
# Microsoft Fakes
|
# Microsoft Fakes
|
||||||
FakesAssemblies/
|
FakesAssemblies/
|
||||||
|
|
||||||
# GhostDoc plugin setting file
|
# GhostDoc plugin setting file
|
||||||
*.GhostDoc.xml
|
*.GhostDoc.xml
|
||||||
|
|
||||||
# Node.js Tools for Visual Studio
|
# Node.js Tools for Visual Studio
|
||||||
.ntvs_analysis.dat
|
.ntvs_analysis.dat
|
||||||
|
|
||||||
# Visual Studio 6 build log
|
# Visual Studio 6 build log
|
||||||
*.plg
|
*.plg
|
||||||
|
|
||||||
# Visual Studio 6 workspace options file
|
# Visual Studio 6 workspace options file
|
||||||
*.opt
|
*.opt
|
||||||
|
|
||||||
# Visual Studio LightSwitch build output
|
# Visual Studio LightSwitch build output
|
||||||
**/*.HTMLClient/GeneratedArtifacts
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
**/*.DesktopClient/GeneratedArtifacts
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
**/*.DesktopClient/ModelManifest.xml
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
**/*.Server/GeneratedArtifacts
|
**/*.Server/GeneratedArtifacts
|
||||||
**/*.Server/ModelManifest.xml
|
**/*.Server/ModelManifest.xml
|
||||||
_Pvt_Extensions
|
_Pvt_Extensions
|
||||||
|
|
||||||
# Paket dependency manager
|
# Paket dependency manager
|
||||||
.paket/paket.exe
|
.paket/paket.exe
|
||||||
paket-files/
|
paket-files/
|
||||||
|
|
||||||
# FAKE - F# Make
|
# FAKE - F# Make
|
||||||
.fake/
|
.fake/
|
||||||
|
|
||||||
# JetBrains Rider
|
# JetBrains Rider
|
||||||
.idea/
|
.idea/
|
||||||
*.sln.iml
|
*.sln.iml
|
||||||
|
|
||||||
# CodeRush
|
# CodeRush
|
||||||
.cr/
|
.cr/
|
||||||
|
|
||||||
# Python Tools for Visual Studio (PTVS)
|
# Python Tools for Visual Studio (PTVS)
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.pyc
|
*.pyc
|
||||||
Staging/
|
Staging/
|
||||||
|
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__catch_.xml
generated
Normal file
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__catch_.xml
generated
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="RulesetTests (catch)" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Catch.Tests/bin/Debug/net471/osu.Game.Rulesets.Catch.Tests.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Rulesets.Catch.Tests" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs>
|
||||||
|
<env name="ASPNETCORE_ENVIRONMENT" value="Development" />
|
||||||
|
<env name="ASPNETCORE_URLS" value="http://localhost:5000" />
|
||||||
|
</envs>
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Catch.Tests/osu.Game.Rulesets.Catch.Tests.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.7.1" />
|
||||||
|
<browser url="http://localhost:5000" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__mania_.xml
generated
Normal file
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__mania_.xml
generated
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="RulesetTests (mania)" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Mania.Tests/bin/Debug/net471/osu.Game.Rulesets.Mania.Tests.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Rulesets.Mania.Tests" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs>
|
||||||
|
<env name="ASPNETCORE_ENVIRONMENT" value="Development" />
|
||||||
|
<env name="ASPNETCORE_URLS" value="http://localhost:5000" />
|
||||||
|
</envs>
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Mania.Tests/osu.Game.Rulesets.Mania.Tests.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.7.1" />
|
||||||
|
<browser url="http://localhost:5000" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__osu__.xml
generated
Normal file
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__osu__.xml
generated
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="RulesetTests (osu!)" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Osu.Tests/bin/Debug/net471/osu.Game.Rulesets.Osu.Tests.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Rulesets.Osu.Tests" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs>
|
||||||
|
<env name="ASPNETCORE_ENVIRONMENT" value="Development" />
|
||||||
|
<env name="ASPNETCORE_URLS" value="http://localhost:5000" />
|
||||||
|
</envs>
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Osu.Tests/osu.Game.Rulesets.Osu.Tests.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.7.1" />
|
||||||
|
<browser url="http://localhost:5000" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__taiko_.xml
generated
Normal file
22
.idea/.idea.osu/.idea/runConfigurations/RulesetTests__taiko_.xml
generated
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="RulesetTests (taiko)" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Taiko.Tests/bin/Debug/net471/osu.Game.Rulesets.Taiko.Tests.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Rulesets.Taiko.Tests" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs>
|
||||||
|
<env name="ASPNETCORE_ENVIRONMENT" value="Development" />
|
||||||
|
<env name="ASPNETCORE_URLS" value="http://localhost:5000" />
|
||||||
|
</envs>
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Rulesets.Taiko.Tests/osu.Game.Rulesets.Taiko.Tests.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.7.1" />
|
||||||
|
<browser url="http://localhost:5000" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
18
.idea/.idea.osu/.idea/runConfigurations/VisualTests__net471_.xml
generated
Normal file
18
.idea/.idea.osu/.idea/runConfigurations/VisualTests__net471_.xml
generated
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="VisualTests (net471)" type="DotNetProject" factoryName=".NET Project" singleton="true">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Tests/bin/Debug/net471/osu.Game.Tests.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Tests" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs />
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Tests/osu.Game.Tests.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.7.1" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
18
.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml
generated
Normal file
18
.idea/.idea.osu/.idea/runConfigurations/VisualTests__netcoreapp2_0_.xml
generated
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="VisualTests (netcoreapp2.0)" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Game.Tests/bin/Debug/netcoreapp2.0/osu.Game.Tests.dll" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Game.Tests" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs />
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Game.Tests/osu.Game.Tests.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETCoreApp,Version=v2.0" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
18
.idea/.idea.osu/.idea/runConfigurations/osu___net471_.xml
generated
Normal file
18
.idea/.idea.osu/.idea/runConfigurations/osu___net471_.xml
generated
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="osu! (net471)" type="DotNetProject" factoryName=".NET Project" singleton="true">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Desktop/bin/Debug/net471/osu!.exe" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Desktop" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs />
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Desktop/osu.Desktop.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETFramework,Version=v4.7.1" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
18
.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml
generated
Normal file
18
.idea/.idea.osu/.idea/runConfigurations/osu___netcoreapp2_0_.xml
generated
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="osu! (netcoreapp2.0)" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/osu.Desktop" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<envs />
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/osu.Desktop/osu.Desktop.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value=".NETCoreApp,Version=v2.0" />
|
||||||
|
<method />
|
||||||
|
</configuration>
|
||||||
|
</component>
|
@ -1,2 +1,2 @@
|
|||||||
language: csharp
|
language: csharp
|
||||||
solution: osu.sln
|
solution: osu.sln
|
109
.vscode/launch.json
vendored
109
.vscode/launch.json
vendored
@ -1,64 +1,111 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [{
|
"configurations": [
|
||||||
"name": "osu! VisualTests (Debug)",
|
{
|
||||||
|
"name": "VisualTests (Debug, net471)",
|
||||||
"windows": {
|
"windows": {
|
||||||
"type": "clr"
|
"type": "clr"
|
||||||
},
|
},
|
||||||
"type": "mono",
|
"type": "mono",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe",
|
"program": "${workspaceRoot}/osu.Game.Tests/bin/Debug/net471/osu.Game.Tests.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Release, net471)",
|
||||||
|
"windows": {
|
||||||
|
"type": "clr"
|
||||||
|
},
|
||||||
|
"type": "mono",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/osu.Game.Tests/bin/Debug/net471/osu.Game.Tests.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "osu! (Debug, net471)",
|
||||||
|
"windows": {
|
||||||
|
"type": "clr"
|
||||||
|
},
|
||||||
|
"type": "mono",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/osu.Desktop/bin/Debug/net471/osu!.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "osu! (Release, net471)",
|
||||||
|
"windows": {
|
||||||
|
"type": "clr"
|
||||||
|
},
|
||||||
|
"type": "mono",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/osu.Desktop/bin/Release/net471/osu!.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Debug, netcoreapp2.0)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "dotnet",
|
||||||
"args": [
|
"args": [
|
||||||
"--tests"
|
"${workspaceRoot}/osu.Game.Tests/bin/Debug/netcoreapp2.0/osu.Game.Tests.dll"
|
||||||
],
|
],
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"preLaunchTask": "Build (Debug)",
|
"preLaunchTask": "Build (Debug, dotnet)",
|
||||||
"runtimeExecutable": null,
|
|
||||||
"env": {},
|
"env": {},
|
||||||
"console": "internalConsole"
|
"console": "internalConsole"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "osu! VisualTests (Release)",
|
"name": "VisualTests (Release, netcoreapp2.0)",
|
||||||
"windows": {
|
"type": "coreclr",
|
||||||
"type": "clr"
|
|
||||||
},
|
|
||||||
"type": "mono",
|
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceRoot}/osu.Desktop/bin/Release/osu!.exe",
|
"program": "dotnet",
|
||||||
"args": [
|
"args": [
|
||||||
"--tests"
|
"${workspaceRoot}/osu.Game.Tests/bin/Debug/netcoreapp2.0/osu.Game.Tests.dll"
|
||||||
],
|
],
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"preLaunchTask": "Build (Release)",
|
"preLaunchTask": "Build (Release, dotnet)",
|
||||||
"runtimeExecutable": null,
|
|
||||||
"env": {},
|
"env": {},
|
||||||
"console": "internalConsole"
|
"console": "internalConsole"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "osu! (Debug)",
|
"name": "osu! (Debug, netcoreapp2.0)",
|
||||||
"windows": {
|
"type": "coreclr",
|
||||||
"type": "clr"
|
|
||||||
},
|
|
||||||
"type": "mono",
|
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceRoot}/osu.Desktop/bin/Debug/osu!.exe",
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/osu.Desktop/bin/Debug/netcoreapp2.0/osu!.dll",
|
||||||
|
],
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"preLaunchTask": "Build (Debug)",
|
"preLaunchTask": "Build (Debug, dotnet)",
|
||||||
"runtimeExecutable": null,
|
|
||||||
"env": {},
|
"env": {},
|
||||||
"console": "internalConsole"
|
"console": "internalConsole"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "osu! (Release)",
|
"name": "osu! (Release, netcoreapp2.0)",
|
||||||
"windows": {
|
"type": "coreclr",
|
||||||
"type": "clr"
|
|
||||||
},
|
|
||||||
"type": "mono",
|
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"program": "${workspaceRoot}/osu.Desktop/bin/Release/osu!.exe",
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/osu.Desktop/bin/Release/netcoreapp2.0/osu!.dll",
|
||||||
|
],
|
||||||
"cwd": "${workspaceRoot}",
|
"cwd": "${workspaceRoot}",
|
||||||
"preLaunchTask": "Build (Release)",
|
"preLaunchTask": "Build (Release, dotnet)",
|
||||||
"runtimeExecutable": null,
|
|
||||||
"env": {},
|
"env": {},
|
||||||
"console": "internalConsole"
|
"console": "internalConsole"
|
||||||
}
|
}
|
||||||
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,3 +0,0 @@
|
|||||||
// Place your settings in this file to overwrite default and user settings.
|
|
||||||
{
|
|
||||||
}
|
|
96
.vscode/tasks.json
vendored
96
.vscode/tasks.json
vendored
@ -2,70 +2,84 @@
|
|||||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
// for the documentation about the tasks.json format
|
// for the documentation about the tasks.json format
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [{
|
"tasks": [
|
||||||
"label": "Build (Debug)",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "msbuild",
|
|
||||||
"args": [
|
|
||||||
"/p:GenerateFullPaths=true",
|
|
||||||
"/p:DebugType=portable",
|
|
||||||
"/m",
|
|
||||||
"/v:m"
|
|
||||||
],
|
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
"isDefault": true
|
|
||||||
},
|
|
||||||
"problemMatcher": "$msCompile"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"label": "Build (Release)",
|
"label": "Build (Debug, msbuild)",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "msbuild",
|
"command": "msbuild",
|
||||||
"args": [
|
"args": [
|
||||||
"/p:Configuration=Release",
|
"/p:TargetFramework=net471",
|
||||||
"/p:DebugType=portable",
|
|
||||||
"/p:GenerateFullPaths=true",
|
"/p:GenerateFullPaths=true",
|
||||||
"/m",
|
"/m",
|
||||||
"/v:m"
|
"/verbosity:m"
|
||||||
],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Clean (Debug)",
|
"label": "Build (Release, msbuild)",
|
||||||
"type": "shell",
|
|
||||||
"command": "msbuild",
|
|
||||||
"args": [
|
|
||||||
"/p:DebugType=portable",
|
|
||||||
"/p:GenerateFullPaths=true",
|
|
||||||
"/m",
|
|
||||||
"/t:Clean",
|
|
||||||
"/v:m"
|
|
||||||
],
|
|
||||||
"problemMatcher": "$msCompile"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "Clean (Release)",
|
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "msbuild",
|
"command": "msbuild",
|
||||||
"args": [
|
"args": [
|
||||||
"/p:Configuration=Release",
|
"/p:Configuration=Release",
|
||||||
|
"/p:TargetFramework=net471",
|
||||||
"/p:GenerateFullPaths=true",
|
"/p:GenerateFullPaths=true",
|
||||||
"/p:DebugType=portable",
|
|
||||||
"/m",
|
"/m",
|
||||||
"/t:Clean",
|
"/verbosity:m"
|
||||||
"/v:m"
|
|
||||||
],
|
],
|
||||||
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "Clean All",
|
"label": "Build (Debug, dotnet)",
|
||||||
"dependsOn": [
|
"type": "shell",
|
||||||
"Clean (Debug)",
|
"command": "dotnet",
|
||||||
"Clean (Release)"
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Desktop",
|
||||||
|
"/p:TargetFramework=netcoreapp2.0",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
],
|
],
|
||||||
|
"group": "build",
|
||||||
"problemMatcher": "$msCompile"
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Release, dotnet)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Desktop",
|
||||||
|
"/p:TargetFramework=netcoreapp2.0",
|
||||||
|
"/p:Configuration=Release",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Restore (net471)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "nuget",
|
||||||
|
"args": [
|
||||||
|
"restore"
|
||||||
|
],
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Restore (netcoreapp2.0)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"restore"
|
||||||
|
],
|
||||||
|
"problemMatcher": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,9 +1,11 @@
|
|||||||
osu!lazer is currently in early stages of development and is not yet ready for end users. Please avoid creating issues or bugs if you do not personally intend to fix them. Some acceptable topics include:
|
osu!lazer is currently still under heavy development!
|
||||||
|
|
||||||
|
Please ensure that you are making an issue for one of the following:
|
||||||
|
|
||||||
|
- A bug with currently implemented features (not features that don't exist)
|
||||||
|
- A feature you are considering adding, so we can collaborate on feedback and design.
|
||||||
- Discussions about technical design decisions
|
- Discussions about technical design decisions
|
||||||
- Bugs that you have found and are personally willing and able to fix
|
|
||||||
- TODO lists of smaller tasks around larger features
|
|
||||||
|
|
||||||
Basically, issues are not a place for you to get help. They are a place for developers to collaborate on the game.
|
|
||||||
|
|
||||||
If your issue qualifies, replace this text with a detailed description of your issue with as much relevant information as you can provide.
|
If your issue qualifies, replace this text with a detailed description of your issue with as much relevant information as you can provide.
|
||||||
|
|
||||||
|
Screenshots and log files are highly welcomed.
|
@ -8,7 +8,7 @@ This is still heavily under development and is not intended for end-user use. Th
|
|||||||
|
|
||||||
# Requirements
|
# Requirements
|
||||||
|
|
||||||
- A desktop platform that can compile .NET 4.6.1. We recommend using [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/) (macOS) or [MonoDevelop](http://www.monodevelop.com/download/) (Linux), all of which are free. [Visual Studio Code](https://code.visualstudio.com/) may also be used but requires further setup steps which are not covered here.
|
- A desktop platform that can compile .NET 4.7.1. We recommend using [Visual Studio Community Edition](https://www.visualstudio.com/) (Windows), [Visual Studio for Mac](https://www.visualstudio.com/vs/visual-studio-mac/) (macOS) or [MonoDevelop](http://www.monodevelop.com/download/) (Linux), all of which are free. [Visual Studio Code](https://code.visualstudio.com/) may also be used but requires further setup steps which are not covered here.
|
||||||
|
|
||||||
# Getting Started
|
# Getting Started
|
||||||
- Clone the repository including submodules (`git clone --recurse-submodules https://github.com/ppy/osu`)
|
- Clone the repository including submodules (`git clone --recurse-submodules https://github.com/ppy/osu`)
|
||||||
|
@ -1,57 +1,46 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
|
||||||
<assemblyIdentity version="1.0.0.0" name="osu!" />
|
<assemblyIdentity version="1.0.0.0" name="osu!" />
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||||
<security>
|
<security>
|
||||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||||
<!-- UAC Manifest Options
|
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||||
If you want to change the Windows User Account Control level replace the
|
</requestedPrivileges>
|
||||||
requestedExecutionLevel node with one of the following.
|
<applicationRequestMinimum>
|
||||||
|
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
</applicationRequestMinimum>
|
||||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
</security>
|
||||||
|
</trustInfo>
|
||||||
If you want to utilize File and Registry Virtualization for backward
|
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||||
compatibility then delete the requestedExecutionLevel node.
|
<application>
|
||||||
-->
|
<!-- Windows Vista -->
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
|
||||||
</requestedPrivileges>
|
<!-- Windows 7 -->
|
||||||
<applicationRequestMinimum>
|
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
||||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
<!-- Windows 8 -->
|
||||||
<PermissionSet class="System.Security.PermissionSet" version="1" Unrestricted="true" ID="Custom" SameSite="site" />
|
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
||||||
</applicationRequestMinimum>
|
<!-- Windows 8.1 -->
|
||||||
</security>
|
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
||||||
</trustInfo>
|
<!-- Windows 10 -->
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||||
<application>
|
</application>
|
||||||
<!-- Windows Vista -->
|
</compatibility>
|
||||||
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
|
<asmv3:application>
|
||||||
<!-- Windows 7 -->
|
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
||||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
|
<dpiAware>true</dpiAware>
|
||||||
<!-- Windows 8 -->
|
</asmv3:windowsSettings>
|
||||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
|
</asmv3:application>
|
||||||
<!-- Windows 8.1 -->
|
<dependency>
|
||||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
|
<dependentAssembly>
|
||||||
<!-- Windows 10 -->
|
<assemblyIdentity
|
||||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
type="win32"
|
||||||
</application>
|
name="Microsoft.Windows.Common-Controls"
|
||||||
</compatibility>
|
version="6.0.0.0"
|
||||||
<asmv3:application>
|
processorArchitecture="*"
|
||||||
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
|
publicKeyToken="6595b64144ccf1df"
|
||||||
<dpiAware>true</dpiAware>
|
language="*"
|
||||||
</asmv3:windowsSettings>
|
/>
|
||||||
</asmv3:application>
|
</dependentAssembly>
|
||||||
<dependency>
|
</dependency>
|
||||||
<dependentAssembly>
|
</asmv1:assembly>
|
||||||
<assemblyIdentity
|
|
||||||
type="win32"
|
|
||||||
name="Microsoft.Windows.Common-Controls"
|
|
||||||
version="6.0.0.0"
|
|
||||||
processorArchitecture="*"
|
|
||||||
publicKeyToken="6595b64144ccf1df"
|
|
||||||
language="*"
|
|
||||||
/>
|
|
||||||
</dependentAssembly>
|
|
||||||
</dependency>
|
|
||||||
</asmv1:assembly>
|
|
53
appveyor.yml
53
appveyor.yml
@ -1,29 +1,26 @@
|
|||||||
# 2017-09-14
|
clone_depth: 1
|
||||||
clone_depth: 1
|
version: '{branch}-{build}'
|
||||||
version: '{branch}-{build}'
|
image: Visual Studio 2017
|
||||||
image: Visual Studio 2017
|
configuration: Debug
|
||||||
configuration: Debug
|
cache:
|
||||||
cache:
|
- C:\ProgramData\chocolatey\bin -> appveyor.yml
|
||||||
- C:\ProgramData\chocolatey\bin -> appveyor.yml
|
- C:\ProgramData\chocolatey\lib -> appveyor.yml
|
||||||
- C:\ProgramData\chocolatey\lib -> appveyor.yml
|
- inspectcode -> appveyor.yml
|
||||||
- inspectcode -> appveyor.yml
|
- packages -> **\packages.config
|
||||||
- packages -> **\packages.config
|
install:
|
||||||
install:
|
- cmd: git submodule update --init --recursive --depth=5
|
||||||
- cmd: git submodule update --init --recursive --depth=5
|
- cmd: choco install resharper-clt -y
|
||||||
- cmd: choco install resharper-clt -y
|
- cmd: choco install nvika -y
|
||||||
- cmd: choco install nvika -y
|
- cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.4/CodeFileSanity.exe
|
||||||
- cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.4/CodeFileSanity.exe
|
before_build:
|
||||||
before_build:
|
- cmd: CodeFileSanity.exe
|
||||||
- cmd: CodeFileSanity.exe
|
- cmd: nuget restore -verbosity quiet
|
||||||
- cmd: nuget restore -verbosity quiet
|
environment:
|
||||||
build:
|
TargetFramework: net471
|
||||||
project: osu.sln
|
build:
|
||||||
parallel: true
|
project: osu.sln
|
||||||
verbosity: minimal
|
parallel: true
|
||||||
test:
|
verbosity: minimal
|
||||||
assemblies:
|
after_build:
|
||||||
only:
|
- cmd: inspectcode --o="inspectcodereport.xml" --projects:osu.Game* --caches-home="inspectcode" osu.sln > NUL
|
||||||
- 'osu.Desktop\**\*.dll'
|
|
||||||
after_build:
|
|
||||||
- cmd: inspectcode --o="inspectcodereport.xml" --projects:osu.Game* --caches-home="inspectcode" osu.sln > NUL
|
|
||||||
- cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors
|
- cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors
|
34
appveyor_deploy.yml
Normal file
34
appveyor_deploy.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- release
|
||||||
|
skip_tags: true
|
||||||
|
skip_branch_with_pr: true
|
||||||
|
clone_depth: 1
|
||||||
|
version: '{branch}-{build}'
|
||||||
|
image: Visual Studio 2017
|
||||||
|
configuration: Debug
|
||||||
|
cache:
|
||||||
|
- packages -> **\packages.config
|
||||||
|
install:
|
||||||
|
- cmd: git submodule update --init --recursive --depth=5
|
||||||
|
before_build:
|
||||||
|
- cmd: nuget restore -verbosity quiet
|
||||||
|
build:
|
||||||
|
project: osu.Desktop.Deploy/osu.Desktop.Deploy.csproj
|
||||||
|
verbosity: minimal
|
||||||
|
after_build:
|
||||||
|
- ps: iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
|
||||||
|
- appveyor DownloadFile https://puu.sh/A6g5K/4d08705438.enc # signing certificate
|
||||||
|
- cmd: appveyor-tools\secure-file -decrypt 4d08705438.enc -secret %decode_secret% -out %HOMEPATH%\deanherbert.pfx
|
||||||
|
- appveyor DownloadFile https://puu.sh/A6g75/fdc6f19b04.enc # deploy configuration
|
||||||
|
- cmd: appveyor-tools\secure-file -decrypt fdc6f19b04.enc -secret %decode_secret% -out osu.Desktop.Deploy\bin\Debug\net471\osu.Desktop.Deploy.exe.config
|
||||||
|
- cd osu.Desktop.Deploy\bin\Debug\net471\
|
||||||
|
- osu.Desktop.Deploy.exe %code_signing_password%
|
||||||
|
environment:
|
||||||
|
TargetFramework: net471
|
||||||
|
decode_secret:
|
||||||
|
secure: i67IC2xj6DjjxmA6Oj2jing3+MwzLkq6CbGsjfZ7rdY=
|
||||||
|
code_signing_password:
|
||||||
|
secure: 34tLNqvjmmZEi97MLKfrnQ==
|
||||||
|
artifacts:
|
||||||
|
- path: 'Releases\*'
|
@ -1 +1 @@
|
|||||||
Subproject commit 6915954abdba64e72f698aa58698b00159f3678d
|
Subproject commit 0773d895d9aa0729995cd4a23efc28238e35ceed
|
@ -1 +1 @@
|
|||||||
Subproject commit 92ec3d10b12c5e9bfc1d3b05d3db174a506efd6d
|
Subproject commit c3848d8b1c84966abe851d915bcca878415614b4
|
29
osu.Desktop.Deploy/.vscode/launch.json
vendored
Normal file
29
osu.Desktop.Deploy/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [{
|
||||||
|
"name": "Deploy (Debug)",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "mono",
|
||||||
|
"program": "${workspaceRoot}/bin/Debug/net471/osu.Desktop.Deploy.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Deploy (Release)",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "clr",
|
||||||
|
"program": "${workspaceRoot}/bin/Release/net471/osu.Desktop.Deploy.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
64
osu.Desktop.Deploy/.vscode/tasks.json
vendored
Normal file
64
osu.Desktop.Deploy/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"command": "msbuild",
|
||||||
|
"type": "shell",
|
||||||
|
"suppressTaskName": true,
|
||||||
|
"args": [
|
||||||
|
"/property:GenerateFullPaths=true",
|
||||||
|
"/property:DebugType=portable",
|
||||||
|
"/verbosity:minimal",
|
||||||
|
"/m" //parallel compiling support.
|
||||||
|
],
|
||||||
|
"tasks": [{
|
||||||
|
"taskName": "Build (Debug)",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
},
|
||||||
|
"problemMatcher": [
|
||||||
|
"$msCompile"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskName": "Build (Release)",
|
||||||
|
"group": "build",
|
||||||
|
"args": [
|
||||||
|
"/property:Configuration=Release"
|
||||||
|
],
|
||||||
|
"problemMatcher": [
|
||||||
|
"$msCompile"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskName": "Clean (Debug)",
|
||||||
|
"args": [
|
||||||
|
"/target:Clean"
|
||||||
|
],
|
||||||
|
"problemMatcher": [
|
||||||
|
"$msCompile"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskName": "Clean (Release)",
|
||||||
|
"args": [
|
||||||
|
"/target:Clean",
|
||||||
|
"/property:Configuration=Release"
|
||||||
|
],
|
||||||
|
"problemMatcher": [
|
||||||
|
"$msCompile"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"taskName": "Clean All",
|
||||||
|
"dependsOn": [
|
||||||
|
"Clean (Debug)",
|
||||||
|
"Clean (Release)"
|
||||||
|
],
|
||||||
|
"problemMatcher": [
|
||||||
|
"$msCompile"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,40 +1,21 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
-->
|
-->
|
||||||
<configuration>
|
<configuration>
|
||||||
<appSettings>
|
<appSettings>
|
||||||
<add key="StagingFolder" value="Staging" />
|
<add key="StagingFolder" value="Staging" />
|
||||||
<add key="ReleasesFolder" value="Releases" />
|
<add key="ReleasesFolder" value="Releases" />
|
||||||
<add key="GitHubAccessToken" value="" />
|
<add key="GitHubAccessToken" value="" />
|
||||||
<add key="GitHubUsername" value="ppy" />
|
<add key="GitHubUsername" value="ppy" />
|
||||||
<add key="GitHubRepoName" value="osu" />
|
<add key="GitHubRepoName" value="osu" />
|
||||||
<add key="ProjectName" value="osu.Desktop" />
|
<add key="ProjectName" value="osu.Desktop" />
|
||||||
<add key="NuSpecName" value="osu.Desktop\osu.nuspec" />
|
<add key="NuSpecName" value="osu.Desktop\osu.nuspec" />
|
||||||
<add key="SolutionName" value="osu" />
|
<add key="SolutionName" value="osu" />
|
||||||
<add key="TargetName" value="osu.Desktop" />
|
<add key="TargetName" value="osu.Desktop" />
|
||||||
<add key="PackageName" value="osulazer" />
|
<add key="PackageName" value="osulazer" />
|
||||||
<add key="IconName" value="lazer.ico" />
|
<add key="IconName" value="lazer.ico" />
|
||||||
<add key="CodeSigningCertificate" value="" />
|
<add key="CodeSigningCertificate" value="" />
|
||||||
</appSettings>
|
</appSettings>
|
||||||
<startup>
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
|
||||||
</startup>
|
|
||||||
<runtime>
|
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="DeltaCompressionDotNet.MsDelta" publicKeyToken="46b2138a390abf55" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-0.18.1.0" newVersion="0.18.1.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
|
||||||
</runtime>
|
|
||||||
</configuration>
|
</configuration>
|
@ -1,16 +1,16 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace osu.Desktop.Deploy
|
namespace osu.Desktop.Deploy
|
||||||
{
|
{
|
||||||
public class GitHubObject
|
public class GitHubObject
|
||||||
{
|
{
|
||||||
[JsonProperty(@"id")]
|
[JsonProperty(@"id")]
|
||||||
public int Id;
|
public int Id;
|
||||||
|
|
||||||
[JsonProperty(@"name")]
|
[JsonProperty(@"name")]
|
||||||
public string Name;
|
public string Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,28 +1,28 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace osu.Desktop.Deploy
|
namespace osu.Desktop.Deploy
|
||||||
{
|
{
|
||||||
public class GitHubRelease
|
public class GitHubRelease
|
||||||
{
|
{
|
||||||
[JsonProperty(@"id")]
|
[JsonProperty(@"id")]
|
||||||
public int Id;
|
public int Id;
|
||||||
|
|
||||||
[JsonProperty(@"tag_name")]
|
[JsonProperty(@"tag_name")]
|
||||||
public string TagName => $"v{Name}";
|
public string TagName => $"v{Name}";
|
||||||
|
|
||||||
[JsonProperty(@"name")]
|
[JsonProperty(@"name")]
|
||||||
public string Name;
|
public string Name;
|
||||||
|
|
||||||
[JsonProperty(@"draft")]
|
[JsonProperty(@"draft")]
|
||||||
public bool Draft;
|
public bool Draft;
|
||||||
|
|
||||||
[JsonProperty(@"prerelease")]
|
[JsonProperty(@"prerelease")]
|
||||||
public bool PreRelease;
|
public bool PreRelease;
|
||||||
|
|
||||||
[JsonProperty(@"upload_url")]
|
[JsonProperty(@"upload_url")]
|
||||||
public string UploadUrl;
|
public string UploadUrl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,431 +1,471 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
using System.Management.Automation;
|
||||||
using osu.Framework.IO.Network;
|
using Newtonsoft.Json;
|
||||||
using FileWebRequest = osu.Framework.IO.Network.FileWebRequest;
|
using osu.Framework.IO.Network;
|
||||||
using WebRequest = osu.Framework.IO.Network.WebRequest;
|
using FileWebRequest = osu.Framework.IO.Network.FileWebRequest;
|
||||||
|
using WebRequest = osu.Framework.IO.Network.WebRequest;
|
||||||
namespace osu.Desktop.Deploy
|
|
||||||
{
|
namespace osu.Desktop.Deploy
|
||||||
internal static class Program
|
{
|
||||||
{
|
internal static class Program
|
||||||
private const string nuget_path = @"packages\NuGet.CommandLine.4.3.0\tools\NuGet.exe";
|
{
|
||||||
private const string squirrel_path = @"packages\squirrel.windows.1.7.8\tools\Squirrel.exe";
|
private static string packages => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".nuget", "packages");
|
||||||
private const string msbuild_path = @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe";
|
private static string nugetPath => Path.Combine(packages, @"nuget.commandline\4.5.1\tools\NuGet.exe");
|
||||||
|
private static string squirrelPath => Path.Combine(packages, @"squirrel.windows\1.7.8\tools\Squirrel.exe");
|
||||||
public static string StagingFolder = ConfigurationManager.AppSettings["StagingFolder"];
|
private const string msbuild_path = @"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe";
|
||||||
public static string ReleasesFolder = ConfigurationManager.AppSettings["ReleasesFolder"];
|
|
||||||
public static string GitHubAccessToken = ConfigurationManager.AppSettings["GitHubAccessToken"];
|
public static string StagingFolder = ConfigurationManager.AppSettings["StagingFolder"];
|
||||||
public static string GitHubUsername = ConfigurationManager.AppSettings["GitHubUsername"];
|
public static string ReleasesFolder = ConfigurationManager.AppSettings["ReleasesFolder"];
|
||||||
public static string GitHubRepoName = ConfigurationManager.AppSettings["GitHubRepoName"];
|
public static string GitHubAccessToken = ConfigurationManager.AppSettings["GitHubAccessToken"];
|
||||||
public static string SolutionName = ConfigurationManager.AppSettings["SolutionName"];
|
public static string GitHubUsername = ConfigurationManager.AppSettings["GitHubUsername"];
|
||||||
public static string ProjectName = ConfigurationManager.AppSettings["ProjectName"];
|
public static string GitHubRepoName = ConfigurationManager.AppSettings["GitHubRepoName"];
|
||||||
public static string NuSpecName = ConfigurationManager.AppSettings["NuSpecName"];
|
public static string SolutionName = ConfigurationManager.AppSettings["SolutionName"];
|
||||||
public static string TargetNames = ConfigurationManager.AppSettings["TargetName"];
|
public static string ProjectName = ConfigurationManager.AppSettings["ProjectName"];
|
||||||
public static string PackageName = ConfigurationManager.AppSettings["PackageName"];
|
public static string NuSpecName = ConfigurationManager.AppSettings["NuSpecName"];
|
||||||
public static string IconName = ConfigurationManager.AppSettings["IconName"];
|
public static string TargetNames = ConfigurationManager.AppSettings["TargetName"];
|
||||||
public static string CodeSigningCertificate = ConfigurationManager.AppSettings["CodeSigningCertificate"];
|
public static string PackageName = ConfigurationManager.AppSettings["PackageName"];
|
||||||
|
public static string IconName = ConfigurationManager.AppSettings["IconName"];
|
||||||
public static string GitHubApiEndpoint => $"https://api.github.com/repos/{GitHubUsername}/{GitHubRepoName}/releases";
|
public static string CodeSigningCertificate = ConfigurationManager.AppSettings["CodeSigningCertificate"];
|
||||||
public static string GitHubReleasePage => $"https://github.com/{GitHubUsername}/{GitHubRepoName}/releases";
|
|
||||||
|
public static string GitHubApiEndpoint => $"https://api.github.com/repos/{GitHubUsername}/{GitHubRepoName}/releases";
|
||||||
/// <summary>
|
public static string GitHubReleasePage => $"https://github.com/{GitHubUsername}/{GitHubRepoName}/releases";
|
||||||
/// How many previous build deltas we want to keep when publishing.
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
private const int keep_delta_count = 3;
|
/// How many previous build deltas we want to keep when publishing.
|
||||||
|
/// </summary>
|
||||||
private static string codeSigningCmd => string.IsNullOrEmpty(codeSigningPassword) ? "" : $"-n \"/a /f {codeSigningCertPath} /p {codeSigningPassword} /t http://timestamp.comodoca.com/authenticode\"";
|
private const int keep_delta_count = 4;
|
||||||
|
|
||||||
private static string homeDir => Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
private static string codeSigningCmd => string.IsNullOrEmpty(codeSigningPassword) ? "" : $"-n \"/a /f {codeSigningCertPath} /p {codeSigningPassword} /t http://timestamp.comodoca.com/authenticode\"";
|
||||||
private static string codeSigningCertPath => Path.Combine(homeDir, CodeSigningCertificate);
|
|
||||||
private static string solutionPath => Environment.CurrentDirectory;
|
private static string homeDir => Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
|
||||||
private static string stagingPath => Path.Combine(solutionPath, StagingFolder);
|
private static string codeSigningCertPath => Path.Combine(homeDir, CodeSigningCertificate);
|
||||||
private static string iconPath => Path.Combine(solutionPath, ProjectName, IconName);
|
private static string solutionPath => Environment.CurrentDirectory;
|
||||||
|
private static string stagingPath => Path.Combine(solutionPath, StagingFolder);
|
||||||
private static string nupkgFilename(string ver) => $"{PackageName}.{ver}.nupkg";
|
private static string iconPath => Path.Combine(solutionPath, ProjectName, IconName);
|
||||||
private static string nupkgDistroFilename(string ver) => $"{PackageName}-{ver}-full.nupkg";
|
|
||||||
|
private static string nupkgFilename(string ver) => $"{PackageName}.{ver}.nupkg";
|
||||||
private static readonly Stopwatch sw = new Stopwatch();
|
private static string nupkgDistroFilename(string ver) => $"{PackageName}-{ver}-full.nupkg";
|
||||||
|
|
||||||
private static string codeSigningPassword;
|
private static readonly Stopwatch sw = new Stopwatch();
|
||||||
|
|
||||||
public static void Main(string[] args)
|
private static string codeSigningPassword;
|
||||||
{
|
|
||||||
displayHeader();
|
private static bool interactive;
|
||||||
|
|
||||||
findSolutionPath();
|
public static void Main(string[] args)
|
||||||
|
{
|
||||||
if (!Directory.Exists(ReleasesFolder))
|
interactive = args.Length == 0;
|
||||||
{
|
|
||||||
write("WARNING: No release directory found. Make sure you want this!", ConsoleColor.Yellow);
|
displayHeader();
|
||||||
Directory.CreateDirectory(ReleasesFolder);
|
|
||||||
}
|
findSolutionPath();
|
||||||
|
|
||||||
checkGitHubReleases();
|
if (!Directory.Exists(ReleasesFolder))
|
||||||
|
{
|
||||||
refreshDirectory(StagingFolder);
|
write("WARNING: No release directory found. Make sure you want this!", ConsoleColor.Yellow);
|
||||||
|
Directory.CreateDirectory(ReleasesFolder);
|
||||||
//increment build number until we have a unique one.
|
}
|
||||||
string verBase = DateTime.Now.ToString("yyyy.Mdd.");
|
|
||||||
int increment = 0;
|
checkGitHubReleases();
|
||||||
while (Directory.GetFiles(ReleasesFolder, $"*{verBase}{increment}*").Any())
|
|
||||||
increment++;
|
refreshDirectory(StagingFolder);
|
||||||
|
|
||||||
string version = $"{verBase}{increment}";
|
//increment build number until we have a unique one.
|
||||||
|
string verBase = DateTime.Now.ToString("yyyy.Mdd.");
|
||||||
Console.ForegroundColor = ConsoleColor.White;
|
int increment = 0;
|
||||||
Console.Write($"Ready to deploy {version}: ");
|
while (Directory.GetFiles(ReleasesFolder, $"*{verBase}{increment}*").Any())
|
||||||
Console.ReadLine();
|
increment++;
|
||||||
|
|
||||||
sw.Start();
|
string version = $"{verBase}{increment}";
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(CodeSigningCertificate))
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
{
|
Console.Write($"Ready to deploy {version}!");
|
||||||
Console.Write("Enter code signing password: ");
|
pauseIfInteractive();
|
||||||
codeSigningPassword = readLineMasked();
|
|
||||||
}
|
sw.Start();
|
||||||
|
|
||||||
write("Restoring NuGet packages...");
|
if (!string.IsNullOrEmpty(CodeSigningCertificate))
|
||||||
runCommand(nuget_path, "restore " + solutionPath);
|
{
|
||||||
|
Console.Write("Enter code signing password: ");
|
||||||
write("Updating AssemblyInfo...");
|
codeSigningPassword = args.Length > 0 ? args[0] : readLineMasked();
|
||||||
updateAssemblyInfo(version);
|
}
|
||||||
|
|
||||||
write("Running build process...");
|
write("Updating AssemblyInfo...");
|
||||||
foreach (string targetName in TargetNames.Split(','))
|
updateCsprojVersion(version);
|
||||||
runCommand(msbuild_path, $"/v:quiet /m /t:{targetName.Replace('.', '_')} /p:OutputPath={stagingPath};Targets=\"Clean;Build\";Configuration=Release {SolutionName}.sln");
|
updateAppveyorVersion(version);
|
||||||
|
|
||||||
write("Creating NuGet deployment package...");
|
write("Running build process...");
|
||||||
runCommand(nuget_path, $"pack {NuSpecName} -Version {version} -Properties Configuration=Deploy -OutputDirectory {stagingPath} -BasePath {stagingPath}");
|
foreach (string targetName in TargetNames.Split(','))
|
||||||
|
runCommand(msbuild_path, $"/v:quiet /m /t:{targetName.Replace('.', '_')} /p:OutputPath={stagingPath};Targets=\"Clean;Build\";Configuration=Release {SolutionName}.sln");
|
||||||
//prune once before checking for files so we can avoid erroring on files which aren't even needed for this build.
|
|
||||||
pruneReleases();
|
write("Creating NuGet deployment package...");
|
||||||
|
runCommand(nugetPath, $"pack {NuSpecName} -Version {version} -Properties Configuration=Deploy -OutputDirectory {stagingPath} -BasePath {stagingPath}");
|
||||||
checkReleaseFiles();
|
|
||||||
|
//prune once before checking for files so we can avoid erroring on files which aren't even needed for this build.
|
||||||
write("Running squirrel build...");
|
pruneReleases();
|
||||||
runCommand(squirrel_path, $"--releasify {stagingPath}\\{nupkgFilename(version)} --setupIcon {iconPath} --icon {iconPath} {codeSigningCmd} --no-msi");
|
|
||||||
|
checkReleaseFiles();
|
||||||
//prune again to clean up before upload.
|
|
||||||
pruneReleases();
|
write("Running squirrel build...");
|
||||||
|
runCommand(squirrelPath, $"--releasify {stagingPath}\\{nupkgFilename(version)} --setupIcon {iconPath} --icon {iconPath} {codeSigningCmd} --no-msi");
|
||||||
//rename setup to install.
|
|
||||||
File.Copy(Path.Combine(ReleasesFolder, "Setup.exe"), Path.Combine(ReleasesFolder, "install.exe"), true);
|
//prune again to clean up before upload.
|
||||||
File.Delete(Path.Combine(ReleasesFolder, "Setup.exe"));
|
pruneReleases();
|
||||||
|
|
||||||
uploadBuild(version);
|
//rename setup to install.
|
||||||
|
File.Copy(Path.Combine(ReleasesFolder, "Setup.exe"), Path.Combine(ReleasesFolder, "install.exe"), true);
|
||||||
//reset assemblyinfo.
|
File.Delete(Path.Combine(ReleasesFolder, "Setup.exe"));
|
||||||
updateAssemblyInfo("0.0.0");
|
|
||||||
|
uploadBuild(version);
|
||||||
write("Done!", ConsoleColor.White);
|
|
||||||
Console.ReadLine();
|
//reset assemblyinfo.
|
||||||
}
|
updateCsprojVersion("0.0.0");
|
||||||
|
|
||||||
private static void displayHeader()
|
write("Done!", ConsoleColor.White);
|
||||||
{
|
pauseIfInteractive();
|
||||||
Console.ForegroundColor = ConsoleColor.Red;
|
}
|
||||||
Console.WriteLine();
|
|
||||||
Console.WriteLine(" Please note that OSU! and PPY are registered trademarks and as such covered by trademark law.");
|
private static void displayHeader()
|
||||||
Console.WriteLine(" Do not distribute builds of this project publicly that make use of these.");
|
{
|
||||||
Console.ResetColor();
|
Console.ForegroundColor = ConsoleColor.Red;
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
}
|
Console.WriteLine(" Please note that OSU! and PPY are registered trademarks and as such covered by trademark law.");
|
||||||
|
Console.WriteLine(" Do not distribute builds of this project publicly that make use of these.");
|
||||||
/// <summary>
|
Console.ResetColor();
|
||||||
/// Ensure we have all the files in the release directory which are expected to be there.
|
Console.WriteLine();
|
||||||
/// This should have been accounted for in earlier steps, and just serves as a verification step.
|
}
|
||||||
/// </summary>
|
|
||||||
private static void checkReleaseFiles()
|
/// <summary>
|
||||||
{
|
/// Ensure we have all the files in the release directory which are expected to be there.
|
||||||
if (!canGitHub) return;
|
/// This should have been accounted for in earlier steps, and just serves as a verification step.
|
||||||
|
/// </summary>
|
||||||
var releaseLines = getReleaseLines();
|
private static void checkReleaseFiles()
|
||||||
|
{
|
||||||
//ensure we have all files necessary
|
if (!canGitHub) return;
|
||||||
foreach (var l in releaseLines)
|
|
||||||
if (!File.Exists(Path.Combine(ReleasesFolder, l.Filename)))
|
var releaseLines = getReleaseLines();
|
||||||
error($"Local file missing {l.Filename}");
|
|
||||||
}
|
//ensure we have all files necessary
|
||||||
|
foreach (var l in releaseLines)
|
||||||
private static IEnumerable<ReleaseLine> getReleaseLines() => File.ReadAllLines(Path.Combine(ReleasesFolder, "RELEASES")).Select(l => new ReleaseLine(l));
|
if (!File.Exists(Path.Combine(ReleasesFolder, l.Filename)))
|
||||||
|
error($"Local file missing {l.Filename}");
|
||||||
private static void pruneReleases()
|
}
|
||||||
{
|
|
||||||
if (!canGitHub) return;
|
private static IEnumerable<ReleaseLine> getReleaseLines() => File.ReadAllLines(Path.Combine(ReleasesFolder, "RELEASES")).Select(l => new ReleaseLine(l));
|
||||||
|
|
||||||
write("Pruning RELEASES...");
|
private static void pruneReleases()
|
||||||
|
{
|
||||||
var releaseLines = getReleaseLines().ToList();
|
if (!canGitHub) return;
|
||||||
|
|
||||||
var fulls = releaseLines.Where(l => l.Filename.Contains("-full")).Reverse().Skip(1);
|
write("Pruning RELEASES...");
|
||||||
|
|
||||||
//remove any FULL releases (except most recent)
|
var releaseLines = getReleaseLines().ToList();
|
||||||
foreach (var l in fulls)
|
|
||||||
{
|
var fulls = releaseLines.Where(l => l.Filename.Contains("-full")).Reverse().Skip(1);
|
||||||
write($"- Removing old release {l.Filename}", ConsoleColor.Yellow);
|
|
||||||
File.Delete(Path.Combine(ReleasesFolder, l.Filename));
|
//remove any FULL releases (except most recent)
|
||||||
releaseLines.Remove(l);
|
foreach (var l in fulls)
|
||||||
}
|
{
|
||||||
|
write($"- Removing old release {l.Filename}", ConsoleColor.Yellow);
|
||||||
//remove excess deltas
|
File.Delete(Path.Combine(ReleasesFolder, l.Filename));
|
||||||
var deltas = releaseLines.Where(l => l.Filename.Contains("-delta")).ToArray();
|
releaseLines.Remove(l);
|
||||||
if (deltas.Length > keep_delta_count)
|
}
|
||||||
{
|
|
||||||
foreach (var l in deltas.Take(deltas.Length - keep_delta_count))
|
//remove excess deltas
|
||||||
{
|
var deltas = releaseLines.Where(l => l.Filename.Contains("-delta")).ToArray();
|
||||||
write($"- Removing old delta {l.Filename}", ConsoleColor.Yellow);
|
if (deltas.Length > keep_delta_count)
|
||||||
File.Delete(Path.Combine(ReleasesFolder, l.Filename));
|
{
|
||||||
releaseLines.Remove(l);
|
foreach (var l in deltas.Take(deltas.Length - keep_delta_count))
|
||||||
}
|
{
|
||||||
}
|
write($"- Removing old delta {l.Filename}", ConsoleColor.Yellow);
|
||||||
|
File.Delete(Path.Combine(ReleasesFolder, l.Filename));
|
||||||
var lines = new List<string>();
|
releaseLines.Remove(l);
|
||||||
releaseLines.ForEach(l => lines.Add(l.ToString()));
|
}
|
||||||
File.WriteAllLines(Path.Combine(ReleasesFolder, "RELEASES"), lines);
|
}
|
||||||
}
|
|
||||||
|
var lines = new List<string>();
|
||||||
private static void uploadBuild(string version)
|
releaseLines.ForEach(l => lines.Add(l.ToString()));
|
||||||
{
|
File.WriteAllLines(Path.Combine(ReleasesFolder, "RELEASES"), lines);
|
||||||
if (!canGitHub || string.IsNullOrEmpty(CodeSigningCertificate))
|
}
|
||||||
return;
|
|
||||||
|
private static void uploadBuild(string version)
|
||||||
write("Publishing to GitHub...");
|
{
|
||||||
|
if (!canGitHub || string.IsNullOrEmpty(CodeSigningCertificate))
|
||||||
write($"- Creating release {version}...", ConsoleColor.Yellow);
|
return;
|
||||||
var req = new JsonWebRequest<GitHubRelease>($"{GitHubApiEndpoint}")
|
|
||||||
{
|
write("Publishing to GitHub...");
|
||||||
Method = HttpMethod.POST,
|
|
||||||
};
|
write($"- Creating release {version}...", ConsoleColor.Yellow);
|
||||||
req.AddRaw(JsonConvert.SerializeObject(new GitHubRelease
|
var req = new JsonWebRequest<GitHubRelease>($"{GitHubApiEndpoint}")
|
||||||
{
|
{
|
||||||
Name = version,
|
Method = HttpMethod.POST,
|
||||||
Draft = true,
|
};
|
||||||
PreRelease = true
|
req.AddRaw(JsonConvert.SerializeObject(new GitHubRelease
|
||||||
}));
|
{
|
||||||
req.AuthenticatedBlockingPerform();
|
Name = version,
|
||||||
|
Draft = true,
|
||||||
var assetUploadUrl = req.ResponseObject.UploadUrl.Replace("{?name,label}", "?name={0}");
|
PreRelease = true
|
||||||
foreach (var a in Directory.GetFiles(ReleasesFolder).Reverse()) //reverse to upload RELEASES first.
|
}));
|
||||||
{
|
req.AuthenticatedBlockingPerform();
|
||||||
write($"- Adding asset {a}...", ConsoleColor.Yellow);
|
|
||||||
var upload = new WebRequest(assetUploadUrl, Path.GetFileName(a))
|
var assetUploadUrl = req.ResponseObject.UploadUrl.Replace("{?name,label}", "?name={0}");
|
||||||
{
|
foreach (var a in Directory.GetFiles(ReleasesFolder).Reverse()) //reverse to upload RELEASES first.
|
||||||
Method = HttpMethod.POST,
|
{
|
||||||
Timeout = 240000,
|
write($"- Adding asset {a}...", ConsoleColor.Yellow);
|
||||||
ContentType = "application/octet-stream",
|
var upload = new WebRequest(assetUploadUrl, Path.GetFileName(a))
|
||||||
};
|
{
|
||||||
|
Method = HttpMethod.POST,
|
||||||
upload.AddRaw(File.ReadAllBytes(a));
|
Timeout = 240000,
|
||||||
upload.AuthenticatedBlockingPerform();
|
ContentType = "application/octet-stream",
|
||||||
}
|
};
|
||||||
|
|
||||||
openGitHubReleasePage();
|
upload.AddRaw(File.ReadAllBytes(a));
|
||||||
}
|
upload.AuthenticatedBlockingPerform();
|
||||||
|
}
|
||||||
private static void openGitHubReleasePage() => Process.Start(GitHubReleasePage);
|
|
||||||
|
openGitHubReleasePage();
|
||||||
private static bool canGitHub => !string.IsNullOrEmpty(GitHubAccessToken);
|
}
|
||||||
|
|
||||||
private static void checkGitHubReleases()
|
private static void openGitHubReleasePage() => Process.Start(GitHubReleasePage);
|
||||||
{
|
|
||||||
if (!canGitHub) return;
|
private static bool canGitHub => !string.IsNullOrEmpty(GitHubAccessToken);
|
||||||
|
|
||||||
write("Checking GitHub releases...");
|
private static void checkGitHubReleases()
|
||||||
var req = new JsonWebRequest<List<GitHubRelease>>($"{GitHubApiEndpoint}");
|
{
|
||||||
req.AuthenticatedBlockingPerform();
|
if (!canGitHub) return;
|
||||||
|
|
||||||
var lastRelease = req.ResponseObject.FirstOrDefault();
|
write("Checking GitHub releases...");
|
||||||
|
var req = new JsonWebRequest<List<GitHubRelease>>($"{GitHubApiEndpoint}");
|
||||||
if (lastRelease == null)
|
req.AuthenticatedBlockingPerform();
|
||||||
return;
|
|
||||||
|
var lastRelease = req.ResponseObject.FirstOrDefault();
|
||||||
if (lastRelease.Draft)
|
|
||||||
{
|
if (lastRelease == null)
|
||||||
openGitHubReleasePage();
|
return;
|
||||||
error("There's a pending draft release! You probably don't want to push a build with this present.");
|
|
||||||
}
|
if (lastRelease.Draft)
|
||||||
|
{
|
||||||
//there's a previous release for this project.
|
openGitHubReleasePage();
|
||||||
var assetReq = new JsonWebRequest<List<GitHubObject>>($"{GitHubApiEndpoint}/{lastRelease.Id}/assets");
|
error("There's a pending draft release! You probably don't want to push a build with this present.");
|
||||||
assetReq.AuthenticatedBlockingPerform();
|
}
|
||||||
var assets = assetReq.ResponseObject;
|
|
||||||
|
//there's a previous release for this project.
|
||||||
//make sure our RELEASES file is the same as the last build on the server.
|
var assetReq = new JsonWebRequest<List<GitHubObject>>($"{GitHubApiEndpoint}/{lastRelease.Id}/assets");
|
||||||
var releaseAsset = assets.FirstOrDefault(a => a.Name == "RELEASES");
|
assetReq.AuthenticatedBlockingPerform();
|
||||||
|
var assets = assetReq.ResponseObject;
|
||||||
//if we don't have a RELEASES asset then the previous release likely wasn't a Squirrel one.
|
|
||||||
if (releaseAsset == null) return;
|
//make sure our RELEASES file is the same as the last build on the server.
|
||||||
|
var releaseAsset = assets.FirstOrDefault(a => a.Name == "RELEASES");
|
||||||
write($"Last GitHub release was {lastRelease.Name}.");
|
|
||||||
|
//if we don't have a RELEASES asset then the previous release likely wasn't a Squirrel one.
|
||||||
bool requireDownload = false;
|
if (releaseAsset == null) return;
|
||||||
|
|
||||||
if (!File.Exists(Path.Combine(ReleasesFolder, nupkgDistroFilename(lastRelease.Name))))
|
write($"Last GitHub release was {lastRelease.Name}.");
|
||||||
{
|
|
||||||
write("Last version's package not found locally.", ConsoleColor.Red);
|
bool requireDownload = false;
|
||||||
requireDownload = true;
|
|
||||||
}
|
if (!File.Exists(Path.Combine(ReleasesFolder, nupkgDistroFilename(lastRelease.Name))))
|
||||||
else
|
{
|
||||||
{
|
write("Last version's package not found locally.", ConsoleColor.Red);
|
||||||
var lastReleases = new RawFileWebRequest($"{GitHubApiEndpoint}/assets/{releaseAsset.Id}");
|
requireDownload = true;
|
||||||
lastReleases.AuthenticatedBlockingPerform();
|
}
|
||||||
if (File.ReadAllText(Path.Combine(ReleasesFolder, "RELEASES")) != lastReleases.ResponseString)
|
else
|
||||||
{
|
{
|
||||||
write("Server's RELEASES differed from ours.", ConsoleColor.Red);
|
var lastReleases = new RawFileWebRequest($"{GitHubApiEndpoint}/assets/{releaseAsset.Id}");
|
||||||
requireDownload = true;
|
lastReleases.AuthenticatedBlockingPerform();
|
||||||
}
|
if (File.ReadAllText(Path.Combine(ReleasesFolder, "RELEASES")) != lastReleases.ResponseString)
|
||||||
}
|
{
|
||||||
|
write("Server's RELEASES differed from ours.", ConsoleColor.Red);
|
||||||
if (!requireDownload) return;
|
requireDownload = true;
|
||||||
|
}
|
||||||
write("Refreshing local releases directory...");
|
}
|
||||||
refreshDirectory(ReleasesFolder);
|
|
||||||
|
if (!requireDownload) return;
|
||||||
foreach (var a in assets)
|
|
||||||
{
|
write("Refreshing local releases directory...");
|
||||||
if (a.Name.EndsWith(".exe")) continue;
|
refreshDirectory(ReleasesFolder);
|
||||||
|
|
||||||
write($"- Downloading {a.Name}...", ConsoleColor.Yellow);
|
foreach (var a in assets)
|
||||||
new FileWebRequest(Path.Combine(ReleasesFolder, a.Name), $"{GitHubApiEndpoint}/assets/{a.Id}").AuthenticatedBlockingPerform();
|
{
|
||||||
}
|
if (a.Name.EndsWith(".exe")) continue;
|
||||||
}
|
|
||||||
|
write($"- Downloading {a.Name}...", ConsoleColor.Yellow);
|
||||||
private static void refreshDirectory(string directory)
|
new FileWebRequest(Path.Combine(ReleasesFolder, a.Name), $"{GitHubApiEndpoint}/assets/{a.Id}").AuthenticatedBlockingPerform();
|
||||||
{
|
}
|
||||||
if (Directory.Exists(directory))
|
}
|
||||||
Directory.Delete(directory, true);
|
|
||||||
Directory.CreateDirectory(directory);
|
private static void refreshDirectory(string directory)
|
||||||
}
|
{
|
||||||
|
if (Directory.Exists(directory))
|
||||||
private static void updateAssemblyInfo(string version)
|
Directory.Delete(directory, true);
|
||||||
{
|
Directory.CreateDirectory(directory);
|
||||||
string file = Path.Combine(ProjectName, "Properties", "AssemblyInfo.cs");
|
}
|
||||||
|
|
||||||
var l1 = File.ReadAllLines(file);
|
private static void updateCsprojVersion(string version)
|
||||||
List<string> l2 = new List<string>();
|
{
|
||||||
foreach (var l in l1)
|
var toUpdate = new[] { "<Version>", "<FileVersion>" };
|
||||||
{
|
string file = Path.Combine(ProjectName, $"{ProjectName}.csproj");
|
||||||
if (l.StartsWith("[assembly: AssemblyVersion("))
|
|
||||||
l2.Add($"[assembly: AssemblyVersion(\"{version}\")]");
|
var l1 = File.ReadAllLines(file);
|
||||||
else if (l.StartsWith("[assembly: AssemblyFileVersion("))
|
List<string> l2 = new List<string>();
|
||||||
l2.Add($"[assembly: AssemblyFileVersion(\"{version}\")]");
|
foreach (var l in l1)
|
||||||
else
|
{
|
||||||
l2.Add(l);
|
string line = l;
|
||||||
}
|
|
||||||
|
foreach (var tag in toUpdate)
|
||||||
File.WriteAllLines(file, l2);
|
{
|
||||||
}
|
int startIndex = l.IndexOf(tag, StringComparison.InvariantCulture);
|
||||||
|
if (startIndex == -1)
|
||||||
/// <summary>
|
continue;
|
||||||
/// Find the base path of the active solution (git checkout location)
|
startIndex += tag.Length;
|
||||||
/// </summary>
|
|
||||||
private static void findSolutionPath()
|
int endIndex = l.IndexOf("<", startIndex, StringComparison.InvariantCulture);
|
||||||
{
|
line = $"{l.Substring(0, startIndex)}{version}{l.Substring(endIndex)}";
|
||||||
string path = Path.GetDirectoryName(Environment.CommandLine.Replace("\"", "").Trim());
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(path))
|
l2.Add(line);
|
||||||
path = Environment.CurrentDirectory;
|
}
|
||||||
|
|
||||||
while (!File.Exists(Path.Combine(path, $"{SolutionName}.sln")))
|
File.WriteAllLines(file, l2);
|
||||||
path = path.Remove(path.LastIndexOf('\\'));
|
}
|
||||||
path += "\\";
|
|
||||||
|
/// <summary>
|
||||||
Environment.CurrentDirectory = path;
|
/// Find the base path of the active solution (git checkout location)
|
||||||
}
|
/// </summary>
|
||||||
|
private static void findSolutionPath()
|
||||||
private static bool runCommand(string command, string args)
|
{
|
||||||
{
|
string path = Path.GetDirectoryName(Environment.CommandLine.Replace("\"", "").Trim());
|
||||||
var psi = new ProcessStartInfo(command, args)
|
|
||||||
{
|
if (string.IsNullOrEmpty(path))
|
||||||
WorkingDirectory = solutionPath,
|
path = Environment.CurrentDirectory;
|
||||||
CreateNoWindow = true,
|
|
||||||
RedirectStandardOutput = true,
|
while (!File.Exists(Path.Combine(path, $"{SolutionName}.sln")))
|
||||||
RedirectStandardError = true,
|
path = path.Remove(path.LastIndexOf(Path.DirectorySeparatorChar));
|
||||||
UseShellExecute = false,
|
path += Path.DirectorySeparatorChar;
|
||||||
WindowStyle = ProcessWindowStyle.Hidden
|
|
||||||
};
|
Environment.CurrentDirectory = path;
|
||||||
|
}
|
||||||
Process p = Process.Start(psi);
|
|
||||||
if (p == null) return false;
|
private static bool runCommand(string command, string args)
|
||||||
|
{
|
||||||
string output = p.StandardOutput.ReadToEnd();
|
var psi = new ProcessStartInfo(command, args)
|
||||||
output += p.StandardError.ReadToEnd();
|
{
|
||||||
|
WorkingDirectory = solutionPath,
|
||||||
if (p.ExitCode == 0) return true;
|
CreateNoWindow = true,
|
||||||
|
RedirectStandardOutput = true,
|
||||||
write(output);
|
RedirectStandardError = true,
|
||||||
error($"Command {command} {args} failed!");
|
UseShellExecute = false,
|
||||||
return false;
|
WindowStyle = ProcessWindowStyle.Hidden
|
||||||
}
|
};
|
||||||
|
|
||||||
private static string readLineMasked()
|
Process p = Process.Start(psi);
|
||||||
{
|
if (p == null) return false;
|
||||||
var fg = Console.ForegroundColor;
|
|
||||||
Console.ForegroundColor = Console.BackgroundColor;
|
string output = p.StandardOutput.ReadToEnd();
|
||||||
var ret = Console.ReadLine();
|
output += p.StandardError.ReadToEnd();
|
||||||
Console.ForegroundColor = fg;
|
|
||||||
|
if (p.ExitCode == 0) return true;
|
||||||
return ret;
|
|
||||||
}
|
write(output);
|
||||||
|
error($"Command {command} {args} failed!");
|
||||||
private static void error(string message)
|
return false;
|
||||||
{
|
}
|
||||||
Console.ForegroundColor = ConsoleColor.Red;
|
|
||||||
Console.WriteLine($"FATAL ERROR: {message}");
|
private static string readLineMasked()
|
||||||
|
{
|
||||||
Console.ReadLine();
|
var fg = Console.ForegroundColor;
|
||||||
Environment.Exit(-1);
|
Console.ForegroundColor = Console.BackgroundColor;
|
||||||
}
|
var ret = Console.ReadLine();
|
||||||
|
Console.ForegroundColor = fg;
|
||||||
private static void write(string message, ConsoleColor col = ConsoleColor.Gray)
|
|
||||||
{
|
return ret;
|
||||||
if (sw.ElapsedMilliseconds > 0)
|
}
|
||||||
{
|
|
||||||
Console.ForegroundColor = ConsoleColor.Green;
|
private static void error(string message)
|
||||||
Console.Write(sw.ElapsedMilliseconds.ToString().PadRight(8));
|
{
|
||||||
}
|
Console.ForegroundColor = ConsoleColor.Red;
|
||||||
Console.ForegroundColor = col;
|
Console.WriteLine($"FATAL ERROR: {message}");
|
||||||
Console.WriteLine(message);
|
|
||||||
}
|
pauseIfInteractive();
|
||||||
|
Environment.Exit(-1);
|
||||||
public static void AuthenticatedBlockingPerform(this WebRequest r)
|
}
|
||||||
{
|
|
||||||
r.AddHeader("Authorization", $"token {GitHubAccessToken}");
|
private static void pauseIfInteractive()
|
||||||
r.Perform();
|
{
|
||||||
}
|
if (interactive)
|
||||||
}
|
Console.ReadLine();
|
||||||
|
else
|
||||||
internal class RawFileWebRequest : WebRequest
|
Console.WriteLine();
|
||||||
{
|
}
|
||||||
public RawFileWebRequest(string url) : base(url)
|
|
||||||
{
|
private static bool updateAppveyorVersion(string version)
|
||||||
}
|
{
|
||||||
|
try
|
||||||
protected override string Accept => "application/octet-stream";
|
{
|
||||||
}
|
using (PowerShell ps = PowerShell.Create())
|
||||||
|
{
|
||||||
internal class ReleaseLine
|
ps.AddScript($"Update-AppveyorBuild -Version \"{version}\"");
|
||||||
{
|
ps.Invoke();
|
||||||
public string Hash;
|
}
|
||||||
public string Filename;
|
return true;
|
||||||
public int Filesize;
|
}
|
||||||
|
catch
|
||||||
public ReleaseLine(string line)
|
{
|
||||||
{
|
// we don't have appveyor and don't care
|
||||||
var split = line.Split(' ');
|
}
|
||||||
Hash = split[0];
|
|
||||||
Filename = split[1];
|
return false;
|
||||||
Filesize = int.Parse(split[2]);
|
}
|
||||||
}
|
|
||||||
|
private static void write(string message, ConsoleColor col = ConsoleColor.Gray)
|
||||||
public override string ToString() => $"{Hash} {Filename} {Filesize}";
|
{
|
||||||
}
|
if (sw.ElapsedMilliseconds > 0)
|
||||||
}
|
{
|
||||||
|
Console.ForegroundColor = ConsoleColor.Green;
|
||||||
|
Console.Write(sw.ElapsedMilliseconds.ToString().PadRight(8));
|
||||||
|
}
|
||||||
|
Console.ForegroundColor = col;
|
||||||
|
Console.WriteLine(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AuthenticatedBlockingPerform(this WebRequest r)
|
||||||
|
{
|
||||||
|
r.AddHeader("Authorization", $"token {GitHubAccessToken}");
|
||||||
|
r.Perform();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class RawFileWebRequest : WebRequest
|
||||||
|
{
|
||||||
|
public RawFileWebRequest(string url) : base(url)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string Accept => "application/octet-stream";
|
||||||
|
}
|
||||||
|
|
||||||
|
internal class ReleaseLine
|
||||||
|
{
|
||||||
|
public string Hash;
|
||||||
|
public string Filename;
|
||||||
|
public int Filesize;
|
||||||
|
|
||||||
|
public ReleaseLine(string line)
|
||||||
|
{
|
||||||
|
var split = line.Split(' ');
|
||||||
|
Hash = split[0];
|
||||||
|
Filename = split[1];
|
||||||
|
Filesize = int.Parse(split[2]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString() => $"{Hash} {Filename} {Filesize}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("osu.Desktop.Deploy")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("")]
|
|
||||||
[assembly: AssemblyProduct("osu.Desktop.Deploy")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 2017")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("baea2f74-0315-4667-84e0-acac0b4bf785")]
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -1,123 +1,19 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Import Project="..\osu.Game.props" />
|
||||||
<Import Project="..\osu.Game.props" />
|
<PropertyGroup Label="Project">
|
||||||
<PropertyGroup>
|
<TargetFrameworks>net471</TargetFrameworks>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<OutputType>Exe</OutputType>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProjectGuid>{BAEA2F74-0315-4667-84E0-ACAC0B4BF785}</ProjectGuid>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<OutputType>Exe</OutputType>
|
</PropertyGroup>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<ItemGroup Label="Project References">
|
||||||
<RootNamespace>osu.Desktop.Deploy</RootNamespace>
|
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||||
<AssemblyName>osu.Desktop.Deploy</AssemblyName>
|
</ItemGroup>
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<ItemGroup Label="Package References">
|
||||||
<FileAlignment>512</FileAlignment>
|
<PackageReference Include="NuGet.CommandLine" Version="4.5.1" />
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<PackageReference Include="NUnit" Version="3.10.1" />
|
||||||
</PropertyGroup>
|
<PackageReference Include="squirrel.windows" Version="1.7.8" Condition="'$(TargetFramework)' == 'net471'" />
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.4.0" />
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
<PackageReference Include="System.Management.Automation.dll" Version="10.0.10586" />
|
||||||
<DebugSymbols>true</DebugSymbols>
|
</ItemGroup>
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<StartupObject>osu.Desktop.Deploy.Program</StartupObject>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="DeltaCompressionDotNet, Version=1.1.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.1.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SharpCompress, Version=0.18.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Squirrel, Version=1.7.8.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\Squirrel.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Configuration" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="GitHubObject.cs" />
|
|
||||||
<Compile Include="GitHubRelease.cs" />
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="App.config">
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="packages.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
|
|
||||||
<Project>{C76BF5B3-985E-4D39-95FE-97C9C879B83A}</Project>
|
|
||||||
<Name>osu.Framework</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
</Project>
|
@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
-->
|
|
||||||
<packages>
|
|
||||||
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net452" />
|
|
||||||
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net452" />
|
|
||||||
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net461" />
|
|
||||||
<package id="NuGet.CommandLine" version="4.3.0" targetFramework="net461" developmentDependency="true" />
|
|
||||||
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
|
|
||||||
<package id="Splat" version="2.0.0" targetFramework="net452" />
|
|
||||||
<package id="squirrel.windows" version="1.7.8" targetFramework="net461" />
|
|
||||||
</packages>
|
|
@ -1,25 +0,0 @@
|
|||||||
<configuration>
|
|
||||||
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
|
|
||||||
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
|
|
||||||
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
|
|
||||||
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
|
|
||||||
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
|
|
||||||
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
|
|
||||||
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
|
|
||||||
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
|
|
||||||
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
|
|
||||||
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
|
||||||
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
|
||||||
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
|
||||||
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
|
||||||
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
|
||||||
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
|
|
||||||
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
|
|
||||||
<!-- XQuartz compatibility (X11 on Mac) -->
|
|
||||||
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
|
|
||||||
</configuration>
|
|
@ -1,121 +1,120 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Drawing;
|
using System.IO;
|
||||||
using System.IO;
|
using System.Linq;
|
||||||
using System.Linq;
|
using System.Reflection;
|
||||||
using System.Reflection;
|
using System.Threading.Tasks;
|
||||||
using System.Threading.Tasks;
|
using osu.Desktop.Overlays;
|
||||||
using Microsoft.Win32;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Desktop.Overlays;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Game;
|
||||||
using osu.Framework.Platform;
|
using OpenTK.Input;
|
||||||
using osu.Game;
|
using Microsoft.Win32;
|
||||||
using OpenTK.Input;
|
|
||||||
|
namespace osu.Desktop
|
||||||
namespace osu.Desktop
|
{
|
||||||
{
|
internal class OsuGameDesktop : OsuGame
|
||||||
internal class OsuGameDesktop : OsuGame
|
{
|
||||||
{
|
private readonly bool noVersionOverlay;
|
||||||
private readonly bool noVersionOverlay;
|
|
||||||
|
public OsuGameDesktop(string[] args = null)
|
||||||
public OsuGameDesktop(string[] args = null)
|
: base(args)
|
||||||
: base(args)
|
{
|
||||||
{
|
noVersionOverlay = args?.Any(a => a == "--no-version-overlay") ?? false;
|
||||||
noVersionOverlay = args?.Any(a => a == "--no-version-overlay") ?? false;
|
}
|
||||||
}
|
|
||||||
|
public override Storage GetStorageForStableInstall()
|
||||||
public override Storage GetStorageForStableInstall()
|
{
|
||||||
{
|
try
|
||||||
try
|
{
|
||||||
{
|
return new StableStorage();
|
||||||
return new StableStorage();
|
}
|
||||||
}
|
catch
|
||||||
catch
|
{
|
||||||
{
|
return null;
|
||||||
return null;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// A method of accessing an osu-stable install in a controlled fashion.
|
||||||
/// A method of accessing an osu-stable install in a controlled fashion.
|
/// </summary>
|
||||||
/// </summary>
|
private class StableStorage : DesktopStorage
|
||||||
private class StableStorage : DesktopStorage
|
{
|
||||||
{
|
protected override string LocateBasePath()
|
||||||
protected override string LocateBasePath()
|
{
|
||||||
{
|
bool checkExists(string p) => Directory.Exists(Path.Combine(p, "Songs"));
|
||||||
bool checkExists(string p) => Directory.Exists(Path.Combine(p, "Songs"));
|
|
||||||
|
string stableInstallPath;
|
||||||
string stableInstallPath;
|
|
||||||
|
try
|
||||||
try
|
{
|
||||||
{
|
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
||||||
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey("osu"))
|
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(String.Empty).ToString().Split('"')[1].Replace("osu!.exe", "");
|
||||||
stableInstallPath = key?.OpenSubKey(@"shell\open\command")?.GetValue(String.Empty).ToString().Split('"')[1].Replace("osu!.exe", "");
|
|
||||||
|
if (checkExists(stableInstallPath))
|
||||||
if (checkExists(stableInstallPath))
|
return stableInstallPath;
|
||||||
return stableInstallPath;
|
}
|
||||||
}
|
catch
|
||||||
catch
|
{
|
||||||
{
|
}
|
||||||
}
|
|
||||||
|
stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!");
|
||||||
stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"osu!");
|
if (checkExists(stableInstallPath))
|
||||||
if (checkExists(stableInstallPath))
|
return stableInstallPath;
|
||||||
return stableInstallPath;
|
|
||||||
|
stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu");
|
||||||
stableInstallPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".osu");
|
if (checkExists(stableInstallPath))
|
||||||
if (checkExists(stableInstallPath))
|
return stableInstallPath;
|
||||||
return stableInstallPath;
|
|
||||||
|
return null;
|
||||||
return null;
|
}
|
||||||
}
|
|
||||||
|
public StableStorage()
|
||||||
public StableStorage()
|
: base(string.Empty)
|
||||||
: base(string.Empty)
|
{
|
||||||
{
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
protected override void LoadComplete()
|
||||||
protected override void LoadComplete()
|
{
|
||||||
{
|
base.LoadComplete();
|
||||||
base.LoadComplete();
|
|
||||||
|
if (!noVersionOverlay)
|
||||||
if (!noVersionOverlay)
|
{
|
||||||
{
|
LoadComponentAsync(new VersionManager { Depth = int.MinValue }, v =>
|
||||||
LoadComponentAsync(new VersionManager { Depth = int.MinValue }, v =>
|
{
|
||||||
{
|
Add(v);
|
||||||
Add(v);
|
v.State = Visibility.Visible;
|
||||||
v.State = Visibility.Visible;
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public override void SetHost(GameHost host)
|
||||||
public override void SetHost(GameHost host)
|
{
|
||||||
{
|
base.SetHost(host);
|
||||||
base.SetHost(host);
|
var desktopWindow = host.Window as DesktopGameWindow;
|
||||||
var desktopWindow = host.Window as DesktopGameWindow;
|
if (desktopWindow != null)
|
||||||
if (desktopWindow != null)
|
{
|
||||||
{
|
desktopWindow.CursorState |= CursorState.Hidden;
|
||||||
desktopWindow.CursorState |= CursorState.Hidden;
|
|
||||||
|
desktopWindow.SetIconFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico"));
|
||||||
desktopWindow.Icon = new Icon(Assembly.GetExecutingAssembly().GetManifestResourceStream(GetType(), "lazer.ico"));
|
desktopWindow.Title = Name;
|
||||||
desktopWindow.Title = Name;
|
|
||||||
|
desktopWindow.FileDrop += fileDrop;
|
||||||
desktopWindow.FileDrop += fileDrop;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private void fileDrop(object sender, FileDropEventArgs e)
|
||||||
private void fileDrop(object sender, FileDropEventArgs e)
|
{
|
||||||
{
|
var filePaths = new[] { e.FileName };
|
||||||
var filePaths = new [] { e.FileName };
|
|
||||||
|
var firstExtension = Path.GetExtension(filePaths.First());
|
||||||
var firstExtension = Path.GetExtension(filePaths.First());
|
|
||||||
|
if (filePaths.Any(f => Path.GetExtension(f) != firstExtension)) return;
|
||||||
if (filePaths.Any(f => Path.GetExtension(f) != firstExtension)) return;
|
|
||||||
|
Task.Factory.StartNew(() => Import(filePaths), TaskCreationOptions.LongRunning);
|
||||||
Task.Factory.StartNew(() => Import(filePaths), TaskCreationOptions.LongRunning);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
164
osu.Desktop/Overlays/SquirrelUpdateManager.cs
Normal file
164
osu.Desktop/Overlays/SquirrelUpdateManager.cs
Normal file
@ -0,0 +1,164 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
#if NET_FRAMEWORK
|
||||||
|
using System;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Framework.Graphics.Colour;
|
||||||
|
using osu.Framework.Graphics.Shapes;
|
||||||
|
using osu.Framework.Logging;
|
||||||
|
using osu.Game;
|
||||||
|
using osu.Game.Graphics;
|
||||||
|
using osu.Game.Overlays;
|
||||||
|
using osu.Game.Overlays.Notifications;
|
||||||
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
|
using Squirrel;
|
||||||
|
|
||||||
|
namespace osu.Desktop.Overlays
|
||||||
|
{
|
||||||
|
public class SquirrelUpdateManager : Component
|
||||||
|
{
|
||||||
|
private UpdateManager updateManager;
|
||||||
|
private NotificationOverlay notificationOverlay;
|
||||||
|
|
||||||
|
public void PrepareUpdate()
|
||||||
|
{
|
||||||
|
// Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here
|
||||||
|
UpdateManager.RestartAppWhenExited().Wait();
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(NotificationOverlay notification, OsuGameBase game)
|
||||||
|
{
|
||||||
|
notificationOverlay = notification;
|
||||||
|
|
||||||
|
if (game.IsDeployedBuild)
|
||||||
|
Schedule(() => checkForUpdateAsync());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null)
|
||||||
|
{
|
||||||
|
//should we schedule a retry on completion of this check?
|
||||||
|
bool scheduleRetry = true;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (updateManager == null) updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true);
|
||||||
|
|
||||||
|
var info = await updateManager.CheckForUpdate(!useDeltaPatching);
|
||||||
|
if (info.ReleasesToApply.Count == 0)
|
||||||
|
//no updates available. bail and retry later.
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (notification == null)
|
||||||
|
{
|
||||||
|
notification = new UpdateProgressNotification(this) { State = ProgressNotificationState.Active };
|
||||||
|
Schedule(() => notificationOverlay.Post(notification));
|
||||||
|
}
|
||||||
|
|
||||||
|
notification.Progress = 0;
|
||||||
|
notification.Text = @"Downloading update...";
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await updateManager.DownloadReleases(info.ReleasesToApply, p => notification.Progress = p / 100f);
|
||||||
|
|
||||||
|
notification.Progress = 0;
|
||||||
|
notification.Text = @"Installing update...";
|
||||||
|
|
||||||
|
await updateManager.ApplyReleases(info, p => notification.Progress = p / 100f);
|
||||||
|
|
||||||
|
notification.State = ProgressNotificationState.Completed;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
if (useDeltaPatching)
|
||||||
|
{
|
||||||
|
Logger.Error(e, @"delta patching failed!");
|
||||||
|
|
||||||
|
//could fail if deltas are unavailable for full update path (https://github.com/Squirrel/Squirrel.Windows/issues/959)
|
||||||
|
//try again without deltas.
|
||||||
|
checkForUpdateAsync(false, notification);
|
||||||
|
scheduleRetry = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Logger.Error(e, @"update failed!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// we'll ignore this and retry later. can be triggered by no internet connection or thread abortion.
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (scheduleRetry)
|
||||||
|
{
|
||||||
|
if (notification != null)
|
||||||
|
notification.State = ProgressNotificationState.Cancelled;
|
||||||
|
|
||||||
|
//check again in 30 minutes.
|
||||||
|
Scheduler.AddDelayed(() => checkForUpdateAsync(), 60000 * 30);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
updateManager?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private class UpdateProgressNotification : ProgressNotification
|
||||||
|
{
|
||||||
|
private readonly SquirrelUpdateManager updateManager;
|
||||||
|
private OsuGame game;
|
||||||
|
|
||||||
|
public UpdateProgressNotification(SquirrelUpdateManager updateManager)
|
||||||
|
{
|
||||||
|
this.updateManager = updateManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Notification CreateCompletionNotification()
|
||||||
|
{
|
||||||
|
return new ProgressCompletionNotification
|
||||||
|
{
|
||||||
|
Text = @"Update ready to install. Click to restart!",
|
||||||
|
Activated = () =>
|
||||||
|
{
|
||||||
|
updateManager.PrepareUpdate();
|
||||||
|
game.GracefullyExit();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OsuColour colours, OsuGame game)
|
||||||
|
{
|
||||||
|
this.game = game;
|
||||||
|
|
||||||
|
IconContent.AddRange(new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Colour = ColourInfo.GradientVertical(colours.YellowDark, colours.Yellow)
|
||||||
|
},
|
||||||
|
new SpriteIcon
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Icon = FontAwesome.fa_upload,
|
||||||
|
Colour = Color4.White,
|
||||||
|
Size = new Vector2(20),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
@ -1,266 +1,142 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Development;
|
||||||
using osu.Framework.Development;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Game;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Game.Configuration;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Game.Graphics;
|
||||||
using osu.Framework.Logging;
|
using osu.Game.Graphics.Sprites;
|
||||||
using osu.Game;
|
using osu.Game.Overlays;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Overlays.Notifications;
|
||||||
using osu.Game.Graphics;
|
using OpenTK;
|
||||||
using osu.Game.Graphics.Sprites;
|
using OpenTK.Graphics;
|
||||||
using osu.Game.Overlays;
|
|
||||||
using osu.Game.Overlays.Notifications;
|
namespace osu.Desktop.Overlays
|
||||||
using OpenTK;
|
{
|
||||||
using OpenTK.Graphics;
|
public class VersionManager : OverlayContainer
|
||||||
using Squirrel;
|
{
|
||||||
|
private OsuConfigManager config;
|
||||||
namespace osu.Desktop.Overlays
|
private OsuGameBase game;
|
||||||
{
|
private NotificationOverlay notificationOverlay;
|
||||||
public class VersionManager : OverlayContainer
|
|
||||||
{
|
public override bool HandleKeyboardInput => false;
|
||||||
private UpdateManager updateManager;
|
public override bool HandleMouseInput => false;
|
||||||
private NotificationOverlay notificationOverlay;
|
|
||||||
private OsuConfigManager config;
|
[BackgroundDependencyLoader]
|
||||||
private OsuGameBase game;
|
private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config)
|
||||||
|
{
|
||||||
public override bool HandleKeyboardInput => false;
|
notificationOverlay = notification;
|
||||||
public override bool HandleMouseInput => false;
|
this.config = config;
|
||||||
|
this.game = game;
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(NotificationOverlay notification, OsuColour colours, TextureStore textures, OsuGameBase game, OsuConfigManager config)
|
AutoSizeAxes = Axes.Both;
|
||||||
{
|
Anchor = Anchor.BottomCentre;
|
||||||
notificationOverlay = notification;
|
Origin = Anchor.BottomCentre;
|
||||||
this.config = config;
|
|
||||||
this.game = game;
|
Alpha = 0;
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
Children = new Drawable[]
|
||||||
Anchor = Anchor.BottomCentre;
|
{
|
||||||
Origin = Anchor.BottomCentre;
|
new FillFlowContainer
|
||||||
|
{
|
||||||
Alpha = 0;
|
AutoSizeAxes = Axes.Both,
|
||||||
|
Direction = FillDirection.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
AutoSizeAxes = Axes.Both,
|
AutoSizeAxes = Axes.Both,
|
||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Horizontal,
|
||||||
Children = new Drawable[]
|
Spacing = new Vector2(5),
|
||||||
{
|
Anchor = Anchor.TopCentre,
|
||||||
new FillFlowContainer
|
Origin = Anchor.TopCentre,
|
||||||
{
|
Children = new Drawable[]
|
||||||
AutoSizeAxes = Axes.Both,
|
{
|
||||||
Direction = FillDirection.Horizontal,
|
new OsuSpriteText
|
||||||
Spacing = new Vector2(5),
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Font = @"Exo2.0-Bold",
|
||||||
Origin = Anchor.TopCentre,
|
Text = game.Name
|
||||||
Children = new Drawable[]
|
},
|
||||||
{
|
new OsuSpriteText
|
||||||
new OsuSpriteText
|
{
|
||||||
{
|
Colour = DebugUtils.IsDebug ? colours.Red : Color4.White,
|
||||||
Font = @"Exo2.0-Bold",
|
Text = game.Version
|
||||||
Text = game.Name
|
},
|
||||||
},
|
}
|
||||||
new OsuSpriteText
|
},
|
||||||
{
|
new OsuSpriteText
|
||||||
Colour = DebugUtils.IsDebug ? colours.Red : Color4.White,
|
{
|
||||||
Text = game.Version
|
Anchor = Anchor.TopCentre,
|
||||||
},
|
Origin = Anchor.TopCentre,
|
||||||
}
|
TextSize = 12,
|
||||||
},
|
Colour = colours.Yellow,
|
||||||
new OsuSpriteText
|
Font = @"Venera",
|
||||||
{
|
Text = @"Development Build"
|
||||||
Anchor = Anchor.TopCentre,
|
},
|
||||||
Origin = Anchor.TopCentre,
|
new Sprite
|
||||||
TextSize = 12,
|
{
|
||||||
Colour = colours.Yellow,
|
Anchor = Anchor.TopCentre,
|
||||||
Font = @"Venera",
|
Origin = Anchor.TopCentre,
|
||||||
Text = @"Development Build"
|
Texture = textures.Get(@"Menu/dev-build-footer"),
|
||||||
},
|
},
|
||||||
new Sprite
|
}
|
||||||
{
|
}
|
||||||
Anchor = Anchor.TopCentre,
|
};
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Texture = textures.Get(@"Menu/dev-build-footer"),
|
#if NET_FRAMEWORK
|
||||||
},
|
Add(new SquirrelUpdateManager());
|
||||||
}
|
#endif
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
protected override void LoadComplete()
|
||||||
if (game.IsDeployedBuild)
|
{
|
||||||
checkForUpdateAsync();
|
base.LoadComplete();
|
||||||
}
|
|
||||||
|
var version = game.Version;
|
||||||
protected override void LoadComplete()
|
var lastVersion = config.Get<string>(OsuSetting.Version);
|
||||||
{
|
if (game.IsDeployedBuild && version != lastVersion)
|
||||||
base.LoadComplete();
|
{
|
||||||
|
config.Set(OsuSetting.Version, version);
|
||||||
var version = game.Version;
|
|
||||||
var lastVersion = config.Get<string>(OsuSetting.Version);
|
// only show a notification if we've previously saved a version to the config file (ie. not the first run).
|
||||||
if (game.IsDeployedBuild && version != lastVersion)
|
if (!string.IsNullOrEmpty(lastVersion))
|
||||||
{
|
notificationOverlay.Post(new UpdateCompleteNotification(version));
|
||||||
config.Set(OsuSetting.Version, version);
|
}
|
||||||
|
}
|
||||||
// only show a notification if we've previously saved a version to the config file (ie. not the first run).
|
|
||||||
if (!string.IsNullOrEmpty(lastVersion))
|
private class UpdateCompleteNotification : SimpleNotification
|
||||||
notificationOverlay.Post(new UpdateCompleteNotification(version));
|
{
|
||||||
}
|
public UpdateCompleteNotification(string version)
|
||||||
}
|
{
|
||||||
|
Text = $"You are now running osu!lazer {version}.\nClick to see what's new!";
|
||||||
private class UpdateCompleteNotification : SimpleNotification
|
Icon = FontAwesome.fa_check_square;
|
||||||
{
|
Activated = delegate
|
||||||
public UpdateCompleteNotification(string version)
|
{
|
||||||
{
|
Process.Start($"https://github.com/ppy/osu/releases/tag/v{version}");
|
||||||
Text = $"You are now running osu!lazer {version}.\nClick to see what's new!";
|
return true;
|
||||||
Icon = FontAwesome.fa_check_square;
|
};
|
||||||
Activated = delegate
|
}
|
||||||
{
|
|
||||||
Process.Start($"https://github.com/ppy/osu/releases/tag/v{version}");
|
[BackgroundDependencyLoader]
|
||||||
return true;
|
private void load(OsuColour colours)
|
||||||
};
|
{
|
||||||
}
|
IconBackgound.Colour = colours.BlueDark;
|
||||||
|
}
|
||||||
[BackgroundDependencyLoader]
|
}
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
protected override void PopIn()
|
||||||
IconBackgound.Colour = colours.BlueDark;
|
{
|
||||||
}
|
this.FadeIn(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void PopOut()
|
||||||
{
|
{
|
||||||
base.Dispose(isDisposing);
|
}
|
||||||
updateManager?.Dispose();
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void checkForUpdateAsync(bool useDeltaPatching = true, UpdateProgressNotification notification = null)
|
|
||||||
{
|
|
||||||
//should we schedule a retry on completion of this check?
|
|
||||||
bool scheduleRetry = true;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (updateManager == null) updateManager = await UpdateManager.GitHubUpdateManager(@"https://github.com/ppy/osu", @"osulazer", null, null, true);
|
|
||||||
|
|
||||||
var info = await updateManager.CheckForUpdate(!useDeltaPatching);
|
|
||||||
if (info.ReleasesToApply.Count == 0)
|
|
||||||
//no updates available. bail and retry later.
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (notification == null)
|
|
||||||
{
|
|
||||||
notification = new UpdateProgressNotification { State = ProgressNotificationState.Active };
|
|
||||||
Schedule(() => notificationOverlay.Post(notification));
|
|
||||||
}
|
|
||||||
|
|
||||||
Schedule(() =>
|
|
||||||
{
|
|
||||||
notification.Progress = 0;
|
|
||||||
notification.Text = @"Downloading update...";
|
|
||||||
});
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await updateManager.DownloadReleases(info.ReleasesToApply, p => Schedule(() => notification.Progress = p / 100f));
|
|
||||||
|
|
||||||
Schedule(() =>
|
|
||||||
{
|
|
||||||
notification.Progress = 0;
|
|
||||||
notification.Text = @"Installing update...";
|
|
||||||
});
|
|
||||||
|
|
||||||
await updateManager.ApplyReleases(info, p => Schedule(() => notification.Progress = p / 100f));
|
|
||||||
|
|
||||||
Schedule(() => notification.State = ProgressNotificationState.Completed);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
if (useDeltaPatching)
|
|
||||||
{
|
|
||||||
Logger.Error(e, @"delta patching failed!");
|
|
||||||
|
|
||||||
//could fail if deltas are unavailable for full update path (https://github.com/Squirrel/Squirrel.Windows/issues/959)
|
|
||||||
//try again without deltas.
|
|
||||||
checkForUpdateAsync(false, notification);
|
|
||||||
scheduleRetry = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Logger.Error(e, @"update failed!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception)
|
|
||||||
{
|
|
||||||
// we'll ignore this and retry later. can be triggered by no internet connection or thread abortion.
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (scheduleRetry)
|
|
||||||
{
|
|
||||||
//check again in 30 minutes.
|
|
||||||
Scheduler.AddDelayed(() => checkForUpdateAsync(), 60000 * 30);
|
|
||||||
if (notification != null)
|
|
||||||
notification.State = ProgressNotificationState.Cancelled;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PopIn()
|
|
||||||
{
|
|
||||||
this.FadeIn(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void PopOut()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private class UpdateProgressNotification : ProgressNotification
|
|
||||||
{
|
|
||||||
private OsuGame game;
|
|
||||||
|
|
||||||
protected override Notification CreateCompletionNotification() => new ProgressCompletionNotification
|
|
||||||
{
|
|
||||||
Text = @"Update ready to install. Click to restart!",
|
|
||||||
Activated = () =>
|
|
||||||
{
|
|
||||||
// Squirrel returns execution to us after the update process is started, so it's safe to use Wait() here
|
|
||||||
UpdateManager.RestartAppWhenExited().Wait();
|
|
||||||
game.GracefullyExit();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours, OsuGame game)
|
|
||||||
{
|
|
||||||
this.game = game;
|
|
||||||
|
|
||||||
IconContent.AddRange(new Drawable[]
|
|
||||||
{
|
|
||||||
new Box
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
Colour = ColourInfo.GradientVertical(colours.YellowDark, colours.Yellow)
|
|
||||||
},
|
|
||||||
new SpriteIcon
|
|
||||||
{
|
|
||||||
Anchor = Anchor.Centre,
|
|
||||||
Origin = Anchor.Centre,
|
|
||||||
Icon = FontAwesome.fa_upload,
|
|
||||||
Colour = Color4.White,
|
|
||||||
Size = new Vector2(20),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,63 +1,66 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime;
|
using osu.Framework;
|
||||||
using osu.Framework;
|
using osu.Framework.Platform;
|
||||||
using osu.Framework.Platform;
|
using osu.Game.IPC;
|
||||||
using osu.Game.IPC;
|
#if NET_FRAMEWORK
|
||||||
|
using System.Runtime;
|
||||||
namespace osu.Desktop
|
#endif
|
||||||
{
|
|
||||||
public static class Program
|
namespace osu.Desktop
|
||||||
{
|
{
|
||||||
[STAThread]
|
public static class Program
|
||||||
public static int Main(string[] args)
|
{
|
||||||
{
|
[STAThread]
|
||||||
if (!RuntimeInfo.IsMono)
|
public static int Main(string[] args)
|
||||||
useMulticoreJit();
|
{
|
||||||
|
// required to initialise native SQLite libraries on some platforms.
|
||||||
// Back up the cwd before DesktopGameHost changes it
|
|
||||||
var cwd = Environment.CurrentDirectory;
|
if (!RuntimeInfo.IsMono)
|
||||||
|
useMulticoreJit();
|
||||||
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true))
|
|
||||||
{
|
// Back up the cwd before DesktopGameHost changes it
|
||||||
if (!host.IsPrimaryInstance)
|
var cwd = Environment.CurrentDirectory;
|
||||||
{
|
|
||||||
var importer = new ArchiveImportIPCChannel(host);
|
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true))
|
||||||
// Restore the cwd so relative paths given at the command line work correctly
|
{
|
||||||
Directory.SetCurrentDirectory(cwd);
|
if (!host.IsPrimaryInstance)
|
||||||
foreach (var file in args)
|
{
|
||||||
{
|
var importer = new ArchiveImportIPCChannel(host);
|
||||||
Console.WriteLine(@"Importing {0}", file);
|
// Restore the cwd so relative paths given at the command line work correctly
|
||||||
if (!importer.ImportAsync(Path.GetFullPath(file)).Wait(3000))
|
Directory.SetCurrentDirectory(cwd);
|
||||||
throw new TimeoutException(@"IPC took too long to send");
|
foreach (var file in args)
|
||||||
}
|
{
|
||||||
}
|
Console.WriteLine(@"Importing {0}", file);
|
||||||
else
|
if (!importer.ImportAsync(Path.GetFullPath(file)).Wait(3000))
|
||||||
{
|
throw new TimeoutException(@"IPC took too long to send");
|
||||||
switch (args.FirstOrDefault() ?? string.Empty)
|
}
|
||||||
{
|
}
|
||||||
case "--tests":
|
else
|
||||||
host.Run(new OsuTestBrowser());
|
{
|
||||||
break;
|
switch (args.FirstOrDefault() ?? string.Empty)
|
||||||
default:
|
{
|
||||||
host.Run(new OsuGameDesktop(args));
|
default:
|
||||||
break;
|
host.Run(new OsuGameDesktop(args));
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return 0;
|
|
||||||
}
|
return 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
private static void useMulticoreJit()
|
|
||||||
{
|
private static void useMulticoreJit()
|
||||||
var directory = Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Profiles"));
|
{
|
||||||
ProfileOptimization.SetProfileRoot(directory.FullName);
|
#if NET_FRAMEWORK
|
||||||
ProfileOptimization.StartProfile("Startup.Profile");
|
var directory = Directory.CreateDirectory(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Profiles"));
|
||||||
}
|
ProfileOptimization.SetProfileRoot(directory.FullName);
|
||||||
}
|
ProfileOptimization.StartProfile("Startup.Profile");
|
||||||
}
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,28 +0,0 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("osu!lazer")]
|
|
||||||
[assembly: AssemblyDescription("click the circles. to the beat.")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("ppy Pty Ltd")]
|
|
||||||
[assembly: AssemblyProduct("osu!lazer")]
|
|
||||||
[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("b0cb1d48-e4c2-4612-a347-beea7b1a71e7")]
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("0.0.0")]
|
|
@ -1,44 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /></startup>
|
|
||||||
<runtime>
|
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-0.18.1.0" newVersion="0.18.1.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
|
||||||
</runtime>
|
|
||||||
</configuration>
|
|
@ -1,284 +1,39 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="14.0">
|
<Import Project="..\osu.Game.props" />
|
||||||
<Import Project="..\osu.Game.props" />
|
<PropertyGroup Label="Project">
|
||||||
<PropertyGroup>
|
<TargetFrameworks>net471;netcoreapp2.0</TargetFrameworks>
|
||||||
<ProjectGuid>{419659FD-72EA-4678-9EB8-B22A746CED70}</ProjectGuid>
|
<OutputType>WinExe</OutputType>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<OutputType>WinExe</OutputType>
|
<Description>click the circles. to the beat.</Description>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AssemblyName>osu!</AssemblyName>
|
||||||
<RootNamespace>osu.Desktop</RootNamespace>
|
<Title>osu!lazer</Title>
|
||||||
<AssemblyName>osu!</AssemblyName>
|
<Product>osu!lazer</Product>
|
||||||
<ManifestCertificateThumbprint>3CF060CD28877D0E3112948951A64B2A7CEEC909</ManifestCertificateThumbprint>
|
<ApplicationIcon>lazer.ico</ApplicationIcon>
|
||||||
<ManifestKeyFile>codesigning.pfx</ManifestKeyFile>
|
<Version>0.0.0.0</Version>
|
||||||
<GenerateManifests>false</GenerateManifests>
|
<FileVersion>0.0.0.0</FileVersion>
|
||||||
<SignManifests>false</SignManifests>
|
</PropertyGroup>
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
<PropertyGroup Label="Defines">
|
||||||
<FileUpgradeFlags>
|
<DefineConstants Condition="'$(TargetFramework)' == 'net471'">$(DefineConstants);NET_FRAMEWORK</DefineConstants>
|
||||||
</FileUpgradeFlags>
|
</PropertyGroup>
|
||||||
<OldToolsVersion>3.5</OldToolsVersion>
|
<PropertyGroup>
|
||||||
<UpgradeBackupLocation>
|
<StartupObject>osu.Desktop.Program</StartupObject>
|
||||||
</UpgradeBackupLocation>
|
</PropertyGroup>
|
||||||
<StartupObject>osu.Desktop.Program</StartupObject>
|
<ItemGroup Label="Project References">
|
||||||
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj" />
|
||||||
<SignAssembly>false</SignAssembly>
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<TargetZone>LocalIntranet</TargetZone>
|
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj" />
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj" />
|
||||||
<PublishUrl>publish\</PublishUrl>
|
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj" />
|
||||||
<Install>true</Install>
|
<ProjectReference Include="..\osu-resources\osu.Game.Resources\osu.Game.Resources.csproj" />
|
||||||
<InstallFrom>Disk</InstallFrom>
|
<PackageReference Include="Microsoft.Win32.Registry" Version="4.4.0" />
|
||||||
<UpdateEnabled>false</UpdateEnabled>
|
</ItemGroup>
|
||||||
<UpdateMode>Foreground</UpdateMode>
|
<ItemGroup Label="Package References">
|
||||||
<UpdateInterval>7</UpdateInterval>
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.0.1" />
|
||||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
<PackageReference Include="squirrel.windows" Version="1.7.8" Condition="'$(TargetFramework)' == 'net471'" />
|
||||||
<UpdatePeriodically>false</UpdatePeriodically>
|
</ItemGroup>
|
||||||
<UpdateRequired>false</UpdateRequired>
|
<ItemGroup Label="Resources">
|
||||||
<MapFileExtensions>true</MapFileExtensions>
|
<EmbeddedResource Include="lazer.ico" />
|
||||||
<ApplicationRevision>2</ApplicationRevision>
|
</ItemGroup>
|
||||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
|
||||||
<ProductVersion>12.0.0</ProductVersion>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
<TargetFrameworkProfile>
|
|
||||||
</TargetFrameworkProfile>
|
|
||||||
<NuGetPackageImportStamp>
|
|
||||||
</NuGetPackageImportStamp>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>0</WarningLevel>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
<Commandlineparameters>
|
|
||||||
</Commandlineparameters>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>none</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>CuttingEdge NoUpdate</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<Prefer32Bit>false</Prefer32Bit>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<Win32Resource>
|
|
||||||
</Win32Resource>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<ApplicationIcon>lazer.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'VisualTests|AnyCPU'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG</DefineConstants>
|
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
|
||||||
<WarningLevel>0</WarningLevel>
|
|
||||||
<NoStdLib>true</NoStdLib>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<StartArguments>--tests</StartArguments>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="DeltaCompressionDotNet, Version=1.1.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.1.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.MsDelta.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.1.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Mono.Cecil.0.9.6.4\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="mscorlib" />
|
|
||||||
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\NuGet.Squirrel.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
|
||||||
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SharpCompress, Version=0.18.1.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SharpCompress.0.18.1\lib\net45\SharpCompress.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Splat, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\Splat.2.0.0\lib\Net45\Splat.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.provider.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c301db686d0bd12, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Squirrel, Version=1.7.8.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\squirrel.windows.1.7.8\lib\Net45\Squirrel.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Drawing" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
|
|
||||||
<HintPath>$(SolutionDir)\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="app.config" />
|
|
||||||
<None Include="OpenTK.dll.config" />
|
|
||||||
<None Include="osu!.res" />
|
|
||||||
<None Include="packages.config" />
|
|
||||||
<None Include="Properties\app.manifest" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
|
|
||||||
<Install>true</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="OsuGameDesktop.cs" />
|
|
||||||
<Compile Include="OsuTestBrowser.cs" />
|
|
||||||
<Compile Include="Overlays\VersionManager.cs" />
|
|
||||||
<Compile Include="Program.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="lazer.ico" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
|
|
||||||
<Project>{c76bf5b3-985e-4d39-95fe-97c9c879b83a}</Project>
|
|
||||||
<Name>osu.Framework</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu-resources\osu.Game.Resources\osu.Game.Resources.csproj">
|
|
||||||
<Project>{d9a367c9-4c1a-489f-9b05-a0cea2b53b58}</Project>
|
|
||||||
<Name>osu.Game.Resources</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj">
|
|
||||||
<Project>{58f6c80c-1253-4a0e-a465-b8c85ebeadf3}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Catch</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Mania\osu.Game.Rulesets.Mania.csproj">
|
|
||||||
<Project>{48f4582b-7687-4621-9cbe-5c24197cb536}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Mania</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Osu\osu.Game.Rulesets.Osu.csproj">
|
|
||||||
<Project>{c92a607b-1fdd-4954-9f92-03ff547d9080}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Osu</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Rulesets.Taiko\osu.Game.Rulesets.Taiko.csproj">
|
|
||||||
<Project>{f167e17a-7de6-4af5-b920-a5112296c695}</Project>
|
|
||||||
<Name>osu.Game.Rulesets.Taiko</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game.Tests\osu.Game.Tests.csproj">
|
|
||||||
<Project>{54377672-20b1-40af-8087-5cf73bf3953a}</Project>
|
|
||||||
<Name>osu.Game.Tests</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2a66dd92-adb1-4994-89e2-c94e04acda0d}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
<ProjectExtensions>
|
|
||||||
<VisualStudio>
|
|
||||||
</VisualStudio>
|
|
||||||
</ProjectExtensions>
|
|
||||||
<PropertyGroup>
|
|
||||||
<PreBuildEvent>
|
|
||||||
</PreBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<PostBuildEvent>
|
|
||||||
</PostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" />
|
|
||||||
</Project>
|
</Project>
|
@ -16,11 +16,9 @@
|
|||||||
<language>en-AU</language>
|
<language>en-AU</language>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="*.exe" target="lib\net45\" exclude="**vshost**"/>
|
<file src="**.exe" target="lib\net45\" exclude="**vshost**"/>
|
||||||
<file src="*.dll" target="lib\net45\"/>
|
<file src="**.dll" target="lib\net45\"/>
|
||||||
<file src="*.config" target="lib\net45\"/>
|
<file src="**.config" target="lib\net45\"/>
|
||||||
<file src="x86\*.dll" target="lib\net45\x86\"/>
|
|
||||||
<file src="x64\*.dll" target="lib\net45\x64\"/>
|
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
|
|
||||||
|
@ -1,20 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
||||||
Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
||||||
-->
|
|
||||||
<packages>
|
|
||||||
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net45" />
|
|
||||||
<package id="Mono.Cecil" version="0.9.6.4" targetFramework="net45" />
|
|
||||||
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
|
|
||||||
<package id="SharpCompress" version="0.18.1" targetFramework="net461" />
|
|
||||||
<package id="Splat" version="2.0.0" targetFramework="net45" />
|
|
||||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.core" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.lib.e_sqlite3.osx" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.lib.e_sqlite3.v110_xp" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.provider.e_sqlite3.net45" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="squirrel.windows" version="1.7.8" targetFramework="net461" />
|
|
||||||
<package id="System.ValueTuple" version="4.4.0" targetFramework="net461" />
|
|
||||||
</packages>
|
|
59
osu.Game.Rulesets.Catch.Tests/.vscode/launch.json
vendored
Normal file
59
osu.Game.Rulesets.Catch.Tests/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Debug, net471)",
|
||||||
|
"windows": {
|
||||||
|
"type": "clr"
|
||||||
|
},
|
||||||
|
"type": "mono",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Catch.Tests.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Release, net471)",
|
||||||
|
"windows": {
|
||||||
|
"type": "clr"
|
||||||
|
},
|
||||||
|
"type": "mono",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Catch.Tests.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Debug, netcoreapp2.0)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Catch.Tests.dll"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug, dotnet)",
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Release, netcoreapp2.0)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Catch.Tests.dll"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release, dotnet)",
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
87
osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json
vendored
Normal file
87
osu.Game.Rulesets.Catch.Tests/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build (Debug, msbuild)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "msbuild",
|
||||||
|
"args": [
|
||||||
|
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||||
|
"/p:TargetFramework=net471",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Release, msbuild)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "msbuild",
|
||||||
|
"args": [
|
||||||
|
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||||
|
"/p:Configuration=Release",
|
||||||
|
"/p:TargetFramework=net471",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Debug, dotnet)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||||
|
"/p:TargetFramework=netcoreapp2.0",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Release, dotnet)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Game.Rulesets.Catch.Tests.csproj",
|
||||||
|
"/p:TargetFramework=netcoreapp2.0",
|
||||||
|
"/p:Configuration=Release",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Restore (net471)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "nuget",
|
||||||
|
"args": [
|
||||||
|
"restore"
|
||||||
|
],
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Restore (netcoreapp2.0)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"restore"
|
||||||
|
],
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,67 +1,67 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Beatmaps;
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
public class CatchBeatmapConversionTest : BeatmapConversionTest<ConvertValue>
|
public class CatchBeatmapConversionTest : BeatmapConversionTest<ConvertValue>
|
||||||
{
|
{
|
||||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Catch";
|
protected override string ResourceAssembly => "osu.Game.Rulesets.Catch";
|
||||||
|
|
||||||
[TestCase("basic"), Ignore("See: https://github.com/ppy/osu/issues/2149")]
|
[TestCase("basic"), Ignore("See: https://github.com/ppy/osu/issues/2232")]
|
||||||
public new void Test(string name)
|
public new void Test(string name)
|
||||||
{
|
{
|
||||||
base.Test(name);
|
base.Test(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
||||||
{
|
{
|
||||||
if (hitObject is JuiceStream stream)
|
if (hitObject is JuiceStream stream)
|
||||||
{
|
{
|
||||||
foreach (var nested in stream.NestedHitObjects)
|
foreach (var nested in stream.NestedHitObjects)
|
||||||
{
|
{
|
||||||
yield return new ConvertValue
|
yield return new ConvertValue
|
||||||
{
|
{
|
||||||
StartTime = nested.StartTime,
|
StartTime = nested.StartTime,
|
||||||
Position = ((CatchHitObject)nested).X * CatchPlayfield.BASE_WIDTH
|
Position = ((CatchHitObject)nested).X * CatchPlayfield.BASE_WIDTH
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yield return new ConvertValue
|
yield return new ConvertValue
|
||||||
{
|
{
|
||||||
StartTime = hitObject.StartTime,
|
StartTime = hitObject.StartTime,
|
||||||
Position = ((CatchHitObject)hitObject).X * CatchPlayfield.BASE_WIDTH
|
Position = ((CatchHitObject)hitObject).X * CatchPlayfield.BASE_WIDTH
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IBeatmapConverter CreateConverter(Beatmap beatmap) => new CatchBeatmapConverter();
|
protected override IBeatmapConverter CreateConverter(Beatmap beatmap) => new CatchBeatmapConverter();
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConvertValue : IEquatable<ConvertValue>
|
public struct ConvertValue : IEquatable<ConvertValue>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A sane value to account for osu!stable using ints everwhere.
|
/// A sane value to account for osu!stable using ints everwhere.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const float conversion_lenience = 2;
|
private const float conversion_lenience = 2;
|
||||||
|
|
||||||
public double StartTime;
|
public double StartTime;
|
||||||
public float Position;
|
public float Position;
|
||||||
|
|
||||||
public bool Equals(ConvertValue other)
|
public bool Equals(ConvertValue other)
|
||||||
=> Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience)
|
=> Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience)
|
||||||
&& Precision.AlmostEquals(Position, other.Position, conversion_lenience);
|
&& Precision.AlmostEquals(Position, other.Position, conversion_lenience);
|
||||||
}
|
}
|
||||||
}
|
}
|
62
osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
Normal file
62
osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
|
using osu.Game.Screens.Play;
|
||||||
|
using osu.Game.Tests.Visual;
|
||||||
|
using OpenTK;
|
||||||
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
|
{
|
||||||
|
public class TestCaseAutoJuiceStream : TestCasePlayer
|
||||||
|
{
|
||||||
|
public TestCaseAutoJuiceStream()
|
||||||
|
: base(new CatchRuleset())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Beatmap CreateBeatmap(Ruleset ruleset)
|
||||||
|
{
|
||||||
|
var beatmap = new Beatmap
|
||||||
|
{
|
||||||
|
BeatmapInfo = new BeatmapInfo
|
||||||
|
{
|
||||||
|
BaseDifficulty = new BeatmapDifficulty { CircleSize = 6, SliderMultiplier = 3 },
|
||||||
|
Ruleset = ruleset.RulesetInfo
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
for (int i = 0; i < 100; i++)
|
||||||
|
{
|
||||||
|
float width = (i % 10 + 1) / 20f;
|
||||||
|
|
||||||
|
beatmap.HitObjects.Add(new JuiceStream
|
||||||
|
{
|
||||||
|
X = 0.5f - width / 2,
|
||||||
|
ControlPoints = new List<Vector2>
|
||||||
|
{
|
||||||
|
Vector2.Zero,
|
||||||
|
new Vector2(width * CatchPlayfield.BASE_WIDTH, 0)
|
||||||
|
},
|
||||||
|
CurveType = CurveType.Linear,
|
||||||
|
Distance = width * CatchPlayfield.BASE_WIDTH,
|
||||||
|
StartTime = i * 2000,
|
||||||
|
NewCombo = i % 8 == 0
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return beatmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset)
|
||||||
|
{
|
||||||
|
beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() });
|
||||||
|
return base.CreatePlayer(beatmap, ruleset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,49 +1,47 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseBananaShower : Game.Tests.Visual.TestCasePlayer
|
public class TestCaseBananaShower : Game.Tests.Visual.TestCasePlayer
|
||||||
{
|
{
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
{
|
{
|
||||||
typeof(BananaShower),
|
typeof(BananaShower),
|
||||||
typeof(DrawableBananaShower),
|
typeof(DrawableBananaShower),
|
||||||
|
|
||||||
typeof(CatchRuleset),
|
typeof(CatchRuleset),
|
||||||
typeof(CatchRulesetContainer),
|
typeof(CatchRulesetContainer),
|
||||||
};
|
};
|
||||||
|
|
||||||
public TestCaseBananaShower()
|
public TestCaseBananaShower()
|
||||||
: base(new CatchRuleset())
|
: base(new CatchRuleset())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Beatmap CreateBeatmap()
|
protected override Beatmap CreateBeatmap(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap
|
var beatmap = new Beatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = new BeatmapInfo
|
BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
BaseDifficulty = new BeatmapDifficulty
|
BaseDifficulty = new BeatmapDifficulty { CircleSize = 6 },
|
||||||
{
|
Ruleset = ruleset.RulesetInfo
|
||||||
CircleSize = 6,
|
}
|
||||||
}
|
};
|
||||||
}
|
|
||||||
};
|
beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 5000, NewCombo = true });
|
||||||
|
|
||||||
beatmap.HitObjects.Add(new BananaShower { StartTime = 200, Duration = 5000, NewCombo = true });
|
return beatmap;
|
||||||
|
}
|
||||||
return beatmap;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +1,15 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseCatchPlayer : Game.Tests.Visual.TestCasePlayer
|
public class TestCaseCatchPlayer : Game.Tests.Visual.TestCasePlayer
|
||||||
{
|
{
|
||||||
public TestCaseCatchPlayer() : base(new CatchRuleset())
|
public TestCaseCatchPlayer() : base(new CatchRuleset())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,37 +1,36 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseCatchStacker : Game.Tests.Visual.TestCasePlayer
|
public class TestCaseCatchStacker : Game.Tests.Visual.TestCasePlayer
|
||||||
{
|
{
|
||||||
public TestCaseCatchStacker()
|
public TestCaseCatchStacker()
|
||||||
: base(new CatchRuleset())
|
: base(new CatchRuleset())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Beatmap CreateBeatmap()
|
protected override Beatmap CreateBeatmap(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap
|
var beatmap = new Beatmap
|
||||||
{
|
{
|
||||||
BeatmapInfo = new BeatmapInfo
|
BeatmapInfo = new BeatmapInfo
|
||||||
{
|
{
|
||||||
BaseDifficulty = new BeatmapDifficulty
|
BaseDifficulty = new BeatmapDifficulty { CircleSize = 6 },
|
||||||
{
|
Ruleset = ruleset.RulesetInfo
|
||||||
CircleSize = 6,
|
}
|
||||||
}
|
};
|
||||||
}
|
|
||||||
};
|
|
||||||
|
for (int i = 0; i < 512; i++)
|
||||||
for (int i = 0; i < 512; i++)
|
beatmap.HitObjects.Add(new Fruit { X = 0.5f + i / 2048f * (i % 10 - 5), StartTime = i * 100, NewCombo = i % 8 == 0 });
|
||||||
beatmap.HitObjects.Add(new Fruit { X = 0.5f + i / 2048f * (i % 10 - 5), StartTime = i * 100, NewCombo = i % 8 == 0 });
|
|
||||||
|
return beatmap;
|
||||||
return beatmap;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
@ -1,61 +1,61 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseCatcherArea : OsuTestCase
|
public class TestCaseCatcherArea : OsuTestCase
|
||||||
{
|
{
|
||||||
private RulesetInfo catchRuleset;
|
private RulesetInfo catchRuleset;
|
||||||
private TestCatcherArea catcherArea;
|
private TestCatcherArea catcherArea;
|
||||||
|
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
{
|
{
|
||||||
typeof(CatcherArea),
|
typeof(CatcherArea),
|
||||||
};
|
};
|
||||||
|
|
||||||
public TestCaseCatcherArea()
|
public TestCaseCatcherArea()
|
||||||
{
|
{
|
||||||
AddSliderStep<float>("CircleSize", 0, 8, 5, createCatcher);
|
AddSliderStep<float>("CircleSize", 0, 8, 5, createCatcher);
|
||||||
AddToggleStep("Hyperdash", t => catcherArea.ToggleHyperDash(t));
|
AddToggleStep("Hyperdash", t => catcherArea.ToggleHyperDash(t));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createCatcher(float size)
|
private void createCatcher(float size)
|
||||||
{
|
{
|
||||||
Child = new CatchInputManager(catchRuleset)
|
Child = new CatchInputManager(catchRuleset)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Child = catcherArea = new TestCatcherArea(new BeatmapDifficulty { CircleSize = size })
|
Child = catcherArea = new TestCatcherArea(new BeatmapDifficulty { CircleSize = size })
|
||||||
{
|
{
|
||||||
Anchor = Anchor.CentreLeft,
|
Anchor = Anchor.CentreLeft,
|
||||||
Origin = Anchor.BottomLeft
|
Origin = Anchor.BottomLeft
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(RulesetStore rulesets)
|
private void load(RulesetStore rulesets)
|
||||||
{
|
{
|
||||||
catchRuleset = rulesets.GetRuleset(2);
|
catchRuleset = rulesets.GetRuleset(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestCatcherArea : CatcherArea
|
private class TestCatcherArea : CatcherArea
|
||||||
{
|
{
|
||||||
public TestCatcherArea(BeatmapDifficulty beatmapDifficulty)
|
public TestCatcherArea(BeatmapDifficulty beatmapDifficulty)
|
||||||
: base(beatmapDifficulty)
|
: base(beatmapDifficulty)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ToggleHyperDash(bool status) => MovableCatcher.HyperDashModifier = status ? 2 : 1;
|
public void ToggleHyperDash(bool status) => MovableCatcher.HyperDashModifier = status ? 2 : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,104 +1,74 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
using osu.Game.Tests.Visual;
|
||||||
using osu.Game.Tests.Visual;
|
using OpenTK;
|
||||||
using OpenTK;
|
|
||||||
using OpenTK.Graphics;
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
|
{
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
[TestFixture]
|
||||||
{
|
public class TestCaseFruitObjects : OsuTestCase
|
||||||
[TestFixture]
|
{
|
||||||
public class TestCaseFruitObjects : OsuTestCase
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||||
{
|
{
|
||||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
typeof(CatchHitObject),
|
||||||
{
|
typeof(Fruit),
|
||||||
typeof(CatchHitObject),
|
typeof(Droplet),
|
||||||
typeof(Fruit),
|
typeof(DrawableCatchHitObject),
|
||||||
typeof(Droplet),
|
typeof(DrawableFruit),
|
||||||
typeof(DrawableCatchHitObject),
|
typeof(DrawableDroplet),
|
||||||
typeof(DrawableFruit),
|
typeof(Pulp),
|
||||||
typeof(DrawableDroplet),
|
};
|
||||||
typeof(Pulp),
|
|
||||||
};
|
public TestCaseFruitObjects()
|
||||||
|
{
|
||||||
public TestCaseFruitObjects()
|
Add(new GridContainer
|
||||||
{
|
{
|
||||||
Add(new GridContainer
|
RelativeSizeAxes = Axes.Both,
|
||||||
{
|
Content = new[]
|
||||||
RelativeSizeAxes = Axes.Both,
|
{
|
||||||
Content = new[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
new Drawable[]
|
createDrawable(0),
|
||||||
{
|
createDrawable(1),
|
||||||
createDrawable(0),
|
createDrawable(2),
|
||||||
createDrawable(1),
|
},
|
||||||
createDrawable(2),
|
new Drawable[]
|
||||||
},
|
{
|
||||||
new Drawable[]
|
createDrawable(3),
|
||||||
{
|
createDrawable(4),
|
||||||
createDrawable(3),
|
createDrawable(5),
|
||||||
createDrawable(4),
|
},
|
||||||
createDrawable(5),
|
}
|
||||||
},
|
});
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
private DrawableFruit createDrawable(int index)
|
||||||
|
{
|
||||||
private DrawableFruit createDrawable(int index)
|
var fruit = new Fruit
|
||||||
{
|
{
|
||||||
var fruit = new Fruit
|
StartTime = 1000000000000,
|
||||||
{
|
IndexInBeatmap = index,
|
||||||
StartTime = 1000000000000,
|
Scale = 1.5f,
|
||||||
IndexInBeatmap = index,
|
};
|
||||||
Scale = 1.5f,
|
|
||||||
};
|
return new DrawableFruit(fruit)
|
||||||
|
{
|
||||||
fruit.ComboColour = colourForRrepesentation(fruit.VisualRepresentation);
|
Anchor = Anchor.Centre,
|
||||||
|
RelativePositionAxes = Axes.Both,
|
||||||
return new DrawableFruit(fruit)
|
Position = Vector2.Zero,
|
||||||
{
|
Alpha = 1,
|
||||||
Anchor = Anchor.Centre,
|
LifetimeStart = double.NegativeInfinity,
|
||||||
RelativePositionAxes = Axes.Both,
|
LifetimeEnd = double.PositiveInfinity,
|
||||||
Position = Vector2.Zero,
|
};
|
||||||
Alpha = 1,
|
}
|
||||||
LifetimeStart = double.NegativeInfinity,
|
}
|
||||||
LifetimeEnd = double.PositiveInfinity,
|
}
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private Color4 colourForRrepesentation(FruitVisualRepresentation representation)
|
|
||||||
{
|
|
||||||
switch (representation)
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
case FruitVisualRepresentation.Pear:
|
|
||||||
return new Color4(17, 136, 170, 255);
|
|
||||||
case FruitVisualRepresentation.Grape:
|
|
||||||
return new Color4(204, 102, 0, 255);
|
|
||||||
case FruitVisualRepresentation.Raspberry:
|
|
||||||
return new Color4(121, 9, 13, 255);
|
|
||||||
case FruitVisualRepresentation.Pineapple:
|
|
||||||
return new Color4(102, 136, 0, 255);
|
|
||||||
case FruitVisualRepresentation.Banana:
|
|
||||||
switch (RNG.Next(0, 3))
|
|
||||||
{
|
|
||||||
default:
|
|
||||||
return new Color4(255, 240, 0, 255);
|
|
||||||
case 1:
|
|
||||||
return new Color4(255, 192, 0, 255);
|
|
||||||
case 2:
|
|
||||||
return new Color4(214, 221, 28, 255);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,29 +1,30 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseHyperdash : Game.Tests.Visual.TestCasePlayer
|
public class TestCaseHyperdash : Game.Tests.Visual.TestCasePlayer
|
||||||
{
|
{
|
||||||
public TestCaseHyperdash()
|
public TestCaseHyperdash()
|
||||||
: base(new CatchRuleset())
|
: base(new CatchRuleset())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override Beatmap CreateBeatmap()
|
protected override Beatmap CreateBeatmap(Ruleset ruleset)
|
||||||
{
|
{
|
||||||
var beatmap = new Beatmap();
|
var beatmap = new Beatmap { BeatmapInfo = { Ruleset = ruleset.RulesetInfo } };
|
||||||
|
|
||||||
for (int i = 0; i < 512; i++)
|
|
||||||
if (i % 5 < 3)
|
for (int i = 0; i < 512; i++)
|
||||||
beatmap.HitObjects.Add(new Fruit { X = i % 10 < 5 ? 0.02f : 0.98f, StartTime = i * 100, NewCombo = i % 8 == 0 });
|
if (i % 5 < 3)
|
||||||
|
beatmap.HitObjects.Add(new Fruit { X = i % 10 < 5 ? 0.02f : 0.98f, StartTime = i * 100, NewCombo = i % 8 == 0 });
|
||||||
return beatmap;
|
|
||||||
}
|
return beatmap;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
@ -1,16 +1,16 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Tests
|
namespace osu.Game.Rulesets.Catch.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
|
public class TestCasePerformancePoints : Game.Tests.Visual.TestCasePerformancePoints
|
||||||
{
|
{
|
||||||
public TestCasePerformancePoints()
|
public TestCasePerformancePoints()
|
||||||
: base(new CatchRuleset())
|
: base(new CatchRuleset())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<Import Project="..\osu.TestProject.props" />
|
||||||
|
<PropertyGroup Label="Project">
|
||||||
|
<OutputType>WinExe</OutputType>
|
||||||
|
<TargetFrameworks>netcoreapp2.0;net471</TargetFrameworks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Label="Project References">
|
||||||
|
<ProjectReference Include="..\osu.Game.Rulesets.Catch\osu.Game.Rulesets.Catch.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@ -1,68 +1,68 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Beatmaps
|
namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||||
{
|
{
|
||||||
public class CatchBeatmapConverter : BeatmapConverter<CatchHitObject>
|
public class CatchBeatmapConverter : BeatmapConverter<CatchHitObject>
|
||||||
{
|
{
|
||||||
protected override IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };
|
protected override IEnumerable<Type> ValidConversionTypes { get; } = new[] { typeof(IHasXPosition) };
|
||||||
|
|
||||||
protected override IEnumerable<CatchHitObject> ConvertHitObject(HitObject obj, Beatmap beatmap)
|
protected override IEnumerable<CatchHitObject> ConvertHitObject(HitObject obj, Beatmap beatmap)
|
||||||
{
|
{
|
||||||
var curveData = obj as IHasCurve;
|
var curveData = obj as IHasCurve;
|
||||||
var positionData = obj as IHasXPosition;
|
var positionData = obj as IHasXPosition;
|
||||||
var comboData = obj as IHasCombo;
|
var comboData = obj as IHasCombo;
|
||||||
var endTime = obj as IHasEndTime;
|
var endTime = obj as IHasEndTime;
|
||||||
|
|
||||||
if (positionData == null)
|
if (positionData == null)
|
||||||
yield break;
|
yield break;
|
||||||
|
|
||||||
if (curveData != null)
|
if (curveData != null)
|
||||||
{
|
{
|
||||||
yield return new JuiceStream
|
yield return new JuiceStream
|
||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
ControlPoints = curveData.ControlPoints,
|
ControlPoints = curveData.ControlPoints,
|
||||||
CurveType = curveData.CurveType,
|
CurveType = curveData.CurveType,
|
||||||
Distance = curveData.Distance,
|
Distance = curveData.Distance,
|
||||||
RepeatSamples = curveData.RepeatSamples,
|
RepeatSamples = curveData.RepeatSamples,
|
||||||
RepeatCount = curveData.RepeatCount,
|
RepeatCount = curveData.RepeatCount,
|
||||||
X = positionData.X / CatchPlayfield.BASE_WIDTH,
|
X = positionData.X / CatchPlayfield.BASE_WIDTH,
|
||||||
NewCombo = comboData?.NewCombo ?? false
|
NewCombo = comboData?.NewCombo ?? false
|
||||||
};
|
};
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endTime != null)
|
if (endTime != null)
|
||||||
{
|
{
|
||||||
yield return new BananaShower
|
yield return new BananaShower
|
||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
Duration = endTime.Duration,
|
Duration = endTime.Duration,
|
||||||
NewCombo = comboData?.NewCombo ?? false
|
NewCombo = comboData?.NewCombo ?? false
|
||||||
};
|
};
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
|
||||||
yield return new Fruit
|
yield return new Fruit
|
||||||
{
|
{
|
||||||
StartTime = obj.StartTime,
|
StartTime = obj.StartTime,
|
||||||
Samples = obj.Samples,
|
Samples = obj.Samples,
|
||||||
NewCombo = comboData?.NewCombo ?? false,
|
NewCombo = comboData?.NewCombo ?? false,
|
||||||
X = positionData.X / CatchPlayfield.BASE_WIDTH
|
X = positionData.X / CatchPlayfield.BASE_WIDTH
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,88 +1,72 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Beatmaps
|
namespace osu.Game.Rulesets.Catch.Beatmaps
|
||||||
{
|
{
|
||||||
public class CatchBeatmapProcessor : BeatmapProcessor<CatchHitObject>
|
public class CatchBeatmapProcessor : BeatmapProcessor<CatchHitObject>
|
||||||
{
|
{
|
||||||
public override void PostProcess(Beatmap<CatchHitObject> beatmap)
|
public override void PostProcess(Beatmap<CatchHitObject> beatmap)
|
||||||
{
|
{
|
||||||
if (beatmap.ComboColors.Count == 0)
|
initialiseHyperDash(beatmap.HitObjects);
|
||||||
return;
|
|
||||||
|
base.PostProcess(beatmap);
|
||||||
int index = 0;
|
|
||||||
int colourIndex = 0;
|
int index = 0;
|
||||||
|
foreach (var obj in beatmap.HitObjects)
|
||||||
CatchHitObject lastObj = null;
|
obj.IndexInBeatmap = index++;
|
||||||
|
}
|
||||||
initialiseHyperDash(beatmap.HitObjects);
|
|
||||||
|
private void initialiseHyperDash(List<CatchHitObject> objects)
|
||||||
foreach (var obj in beatmap.HitObjects)
|
{
|
||||||
{
|
// todo: add difficulty adjust.
|
||||||
if (obj.NewCombo)
|
double halfCatcherWidth = CatcherArea.CATCHER_SIZE * (objects.FirstOrDefault()?.Scale ?? 1) / CatchPlayfield.BASE_WIDTH / 2;
|
||||||
{
|
|
||||||
if (lastObj != null) lastObj.LastInCombo = true;
|
int lastDirection = 0;
|
||||||
colourIndex = (colourIndex + 1) % beatmap.ComboColors.Count;
|
double lastExcess = halfCatcherWidth;
|
||||||
}
|
|
||||||
|
int objCount = objects.Count;
|
||||||
obj.IndexInBeatmap = index++;
|
|
||||||
obj.ComboColour = beatmap.ComboColors[colourIndex];
|
for (int i = 0; i < objCount - 1; i++)
|
||||||
|
{
|
||||||
lastObj = obj;
|
CatchHitObject currentObject = objects[i];
|
||||||
}
|
|
||||||
}
|
// not needed?
|
||||||
|
// if (currentObject is TinyDroplet) continue;
|
||||||
private void initialiseHyperDash(List<CatchHitObject> objects)
|
|
||||||
{
|
CatchHitObject nextObject = objects[i + 1];
|
||||||
// todo: add difficulty adjust.
|
|
||||||
double halfCatcherWidth = CatcherArea.CATCHER_SIZE * (objects.FirstOrDefault()?.Scale ?? 1) / CatchPlayfield.BASE_WIDTH / 2;
|
// while (nextObject is TinyDroplet)
|
||||||
|
// {
|
||||||
int lastDirection = 0;
|
// if (++i == objCount - 1) break;
|
||||||
double lastExcess = halfCatcherWidth;
|
// nextObject = objects[i + 1];
|
||||||
|
// }
|
||||||
int objCount = objects.Count;
|
|
||||||
|
int thisDirection = nextObject.X > currentObject.X ? 1 : -1;
|
||||||
for (int i = 0; i < objCount - 1; i++)
|
double timeToNext = nextObject.StartTime - ((currentObject as IHasEndTime)?.EndTime ?? currentObject.StartTime) - 4;
|
||||||
{
|
double distanceToNext = Math.Abs(nextObject.X - currentObject.X) - (lastDirection == thisDirection ? lastExcess : halfCatcherWidth);
|
||||||
CatchHitObject currentObject = objects[i];
|
|
||||||
|
if (timeToNext * CatcherArea.Catcher.BASE_SPEED < distanceToNext)
|
||||||
// not needed?
|
{
|
||||||
// if (currentObject is TinyDroplet) continue;
|
currentObject.HyperDashTarget = nextObject;
|
||||||
|
lastExcess = halfCatcherWidth;
|
||||||
CatchHitObject nextObject = objects[i + 1];
|
}
|
||||||
|
else
|
||||||
// while (nextObject is TinyDroplet)
|
{
|
||||||
// {
|
//currentObject.DistanceToHyperDash = timeToNext - distanceToNext;
|
||||||
// if (++i == objCount - 1) break;
|
lastExcess = MathHelper.Clamp(timeToNext - distanceToNext, 0, halfCatcherWidth);
|
||||||
// nextObject = objects[i + 1];
|
}
|
||||||
// }
|
|
||||||
|
lastDirection = thisDirection;
|
||||||
int thisDirection = nextObject.X > currentObject.X ? 1 : -1;
|
}
|
||||||
double timeToNext = nextObject.StartTime - ((currentObject as IHasEndTime)?.EndTime ?? currentObject.StartTime) - 4;
|
}
|
||||||
double distanceToNext = Math.Abs(nextObject.X - currentObject.X) - (lastDirection == thisDirection ? lastExcess : halfCatcherWidth);
|
}
|
||||||
|
}
|
||||||
if (timeToNext * CatcherArea.Catcher.BASE_SPEED < distanceToNext)
|
|
||||||
{
|
|
||||||
currentObject.HyperDashTarget = nextObject;
|
|
||||||
lastExcess = halfCatcherWidth;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//currentObject.DistanceToHyperDash = timeToNext - distanceToNext;
|
|
||||||
lastExcess = MathHelper.Clamp(timeToNext - distanceToNext, 0, halfCatcherWidth);
|
|
||||||
}
|
|
||||||
|
|
||||||
lastDirection = thisDirection;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Beatmaps;
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch
|
namespace osu.Game.Rulesets.Catch
|
||||||
{
|
{
|
||||||
public class CatchDifficultyCalculator : DifficultyCalculator<CatchHitObject>
|
public class CatchDifficultyCalculator : DifficultyCalculator<CatchHitObject>
|
||||||
{
|
{
|
||||||
public CatchDifficultyCalculator(Beatmap beatmap) : base(beatmap)
|
public CatchDifficultyCalculator(Beatmap beatmap) : base(beatmap)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override double Calculate(Dictionary<string, double> categoryDifficulty = null) => 0;
|
public override double Calculate(Dictionary<string, double> categoryDifficulty = null) => 0;
|
||||||
|
|
||||||
protected override BeatmapConverter<CatchHitObject> CreateBeatmapConverter(Beatmap beatmap) => new CatchBeatmapConverter();
|
protected override BeatmapConverter<CatchHitObject> CreateBeatmapConverter(Beatmap beatmap) => new CatchBeatmapConverter();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch
|
namespace osu.Game.Rulesets.Catch
|
||||||
{
|
{
|
||||||
public class CatchInputManager : RulesetInputManager<CatchAction>
|
public class CatchInputManager : RulesetInputManager<CatchAction>
|
||||||
{
|
{
|
||||||
public CatchInputManager(RulesetInfo ruleset)
|
public CatchInputManager(RulesetInfo ruleset)
|
||||||
: base(ruleset, 0, SimultaneousBindingMode.Unique)
|
: base(ruleset, 0, SimultaneousBindingMode.Unique)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum CatchAction
|
public enum CatchAction
|
||||||
{
|
{
|
||||||
[Description("Move left")]
|
[Description("Move left")]
|
||||||
MoveLeft,
|
MoveLeft,
|
||||||
[Description("Move right")]
|
[Description("Move right")]
|
||||||
MoveRight,
|
MoveRight,
|
||||||
[Description("Engage dash")]
|
[Description("Engage dash")]
|
||||||
Dash,
|
Dash,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,113 +1,152 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Game.Rulesets.Catch.Mods;
|
using osu.Game.Rulesets.Catch.Mods;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Game.Rulesets.Catch.Replays;
|
using osu.Game.Rulesets.Catch.Replays;
|
||||||
using osu.Game.Rulesets.Replays.Types;
|
using osu.Game.Rulesets.Replays.Types;
|
||||||
|
using osu.Game.Beatmaps.Legacy;
|
||||||
namespace osu.Game.Rulesets.Catch
|
|
||||||
{
|
namespace osu.Game.Rulesets.Catch
|
||||||
public class CatchRuleset : Ruleset
|
{
|
||||||
{
|
public class CatchRuleset : Ruleset
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new CatchRulesetContainer(this, beatmap, isForCurrentRuleset);
|
{
|
||||||
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new CatchRulesetContainer(this, beatmap, isForCurrentRuleset);
|
||||||
public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]
|
|
||||||
{
|
public override IEnumerable<KeyBinding> GetDefaultKeyBindings(int variant = 0) => new[]
|
||||||
new KeyBinding(InputKey.Z, CatchAction.MoveLeft),
|
{
|
||||||
new KeyBinding(InputKey.Left, CatchAction.MoveLeft),
|
new KeyBinding(InputKey.Z, CatchAction.MoveLeft),
|
||||||
new KeyBinding(InputKey.X, CatchAction.MoveRight),
|
new KeyBinding(InputKey.Left, CatchAction.MoveLeft),
|
||||||
new KeyBinding(InputKey.Right, CatchAction.MoveRight),
|
new KeyBinding(InputKey.X, CatchAction.MoveRight),
|
||||||
new KeyBinding(InputKey.Shift, CatchAction.Dash),
|
new KeyBinding(InputKey.Right, CatchAction.MoveRight),
|
||||||
new KeyBinding(InputKey.Shift, CatchAction.Dash),
|
new KeyBinding(InputKey.Shift, CatchAction.Dash),
|
||||||
};
|
new KeyBinding(InputKey.Shift, CatchAction.Dash),
|
||||||
|
};
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type)
|
|
||||||
{
|
public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
|
||||||
switch (type)
|
{
|
||||||
{
|
if (mods.HasFlag(LegacyMods.Nightcore))
|
||||||
case ModType.DifficultyReduction:
|
yield return new CatchModNightcore();
|
||||||
return new Mod[]
|
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
||||||
{
|
yield return new CatchModDoubleTime();
|
||||||
new CatchModEasy(),
|
|
||||||
new CatchModNoFail(),
|
if (mods.HasFlag(LegacyMods.Autoplay))
|
||||||
new MultiMod
|
yield return new CatchModAutoplay();
|
||||||
{
|
|
||||||
Mods = new Mod[]
|
if (mods.HasFlag(LegacyMods.Easy))
|
||||||
{
|
yield return new CatchModEasy();
|
||||||
new CatchModHalfTime(),
|
|
||||||
new CatchModDaycore(),
|
if (mods.HasFlag(LegacyMods.Flashlight))
|
||||||
},
|
yield return new CatchModFlashlight();
|
||||||
},
|
|
||||||
};
|
if (mods.HasFlag(LegacyMods.HalfTime))
|
||||||
|
yield return new CatchModHalfTime();
|
||||||
case ModType.DifficultyIncrease:
|
|
||||||
return new Mod[]
|
if (mods.HasFlag(LegacyMods.HardRock))
|
||||||
{
|
yield return new CatchModHardRock();
|
||||||
new CatchModHardRock(),
|
|
||||||
new MultiMod
|
if (mods.HasFlag(LegacyMods.Hidden))
|
||||||
{
|
yield return new CatchModHidden();
|
||||||
Mods = new Mod[]
|
|
||||||
{
|
if (mods.HasFlag(LegacyMods.NoFail))
|
||||||
new CatchModSuddenDeath(),
|
yield return new CatchModNoFail();
|
||||||
new CatchModPerfect(),
|
|
||||||
},
|
if (mods.HasFlag(LegacyMods.Perfect))
|
||||||
},
|
yield return new CatchModPerfect();
|
||||||
new MultiMod
|
|
||||||
{
|
if (mods.HasFlag(LegacyMods.Relax))
|
||||||
Mods = new Mod[]
|
yield return new CatchModRelax();
|
||||||
{
|
|
||||||
new CatchModDoubleTime(),
|
if (mods.HasFlag(LegacyMods.SuddenDeath))
|
||||||
new CatchModNightcore(),
|
yield return new CatchModSuddenDeath();
|
||||||
},
|
}
|
||||||
},
|
|
||||||
new CatchModHidden(),
|
public override IEnumerable<Mod> GetModsFor(ModType type)
|
||||||
new CatchModFlashlight(),
|
{
|
||||||
};
|
switch (type)
|
||||||
|
{
|
||||||
case ModType.Special:
|
case ModType.DifficultyReduction:
|
||||||
return new Mod[]
|
return new Mod[]
|
||||||
{
|
{
|
||||||
new CatchModRelax(),
|
new CatchModEasy(),
|
||||||
null,
|
new CatchModNoFail(),
|
||||||
null,
|
new MultiMod
|
||||||
new MultiMod
|
{
|
||||||
{
|
Mods = new Mod[]
|
||||||
Mods = new Mod[]
|
{
|
||||||
{
|
new CatchModHalfTime(),
|
||||||
new CatchModAutoplay(),
|
new CatchModDaycore(),
|
||||||
new ModCinema(),
|
},
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
};
|
|
||||||
|
case ModType.DifficultyIncrease:
|
||||||
default:
|
return new Mod[]
|
||||||
return new Mod[] { };
|
{
|
||||||
}
|
new CatchModHardRock(),
|
||||||
}
|
new MultiMod
|
||||||
|
{
|
||||||
public override string Description => "osu!catch";
|
Mods = new Mod[]
|
||||||
|
{
|
||||||
public override string ShortName => "fruits";
|
new CatchModSuddenDeath(),
|
||||||
|
new CatchModPerfect(),
|
||||||
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o };
|
},
|
||||||
|
},
|
||||||
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new CatchDifficultyCalculator(beatmap);
|
new MultiMod
|
||||||
|
{
|
||||||
public override int? LegacyID => 2;
|
Mods = new Mod[]
|
||||||
|
{
|
||||||
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame();
|
new CatchModDoubleTime(),
|
||||||
|
new CatchModNightcore(),
|
||||||
public CatchRuleset(RulesetInfo rulesetInfo = null)
|
},
|
||||||
: base(rulesetInfo)
|
},
|
||||||
{
|
new CatchModHidden(),
|
||||||
}
|
new CatchModFlashlight(),
|
||||||
}
|
};
|
||||||
}
|
|
||||||
|
case ModType.Special:
|
||||||
|
return new Mod[]
|
||||||
|
{
|
||||||
|
new CatchModRelax(),
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
new MultiMod
|
||||||
|
{
|
||||||
|
Mods = new Mod[]
|
||||||
|
{
|
||||||
|
new CatchModAutoplay(),
|
||||||
|
new ModCinema(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
default:
|
||||||
|
return new Mod[] { };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string Description => "osu!catch";
|
||||||
|
|
||||||
|
public override string ShortName => "fruits";
|
||||||
|
|
||||||
|
public override Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.fa_osu_fruits_o };
|
||||||
|
|
||||||
|
public override DifficultyCalculator CreateDifficultyCalculator(Beatmap beatmap, Mod[] mods = null) => new CatchDifficultyCalculator(beatmap);
|
||||||
|
|
||||||
|
public override int? LegacyID => 2;
|
||||||
|
|
||||||
|
public override IConvertibleReplayFrame CreateConvertibleReplayFrame() => new CatchReplayFrame();
|
||||||
|
|
||||||
|
public CatchRuleset(RulesetInfo rulesetInfo = null)
|
||||||
|
: base(rulesetInfo)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Judgements
|
namespace osu.Game.Rulesets.Catch.Judgements
|
||||||
{
|
{
|
||||||
public class CatchJudgement : Judgement
|
public class CatchJudgement : Judgement
|
||||||
{
|
{
|
||||||
// todo: wangs
|
// todo: wangs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,24 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Replays;
|
using osu.Game.Rulesets.Catch.Replays;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModAutoplay : ModAutoplay<CatchHitObject>
|
public class CatchModAutoplay : ModAutoplay<CatchHitObject>
|
||||||
{
|
{
|
||||||
protected override Score CreateReplayScore(Beatmap<CatchHitObject> beatmap)
|
protected override Score CreateReplayScore(Beatmap<CatchHitObject> beatmap)
|
||||||
{
|
{
|
||||||
return new Score
|
return new Score
|
||||||
{
|
{
|
||||||
User = new User { Username = "osu!salad!" },
|
User = new User { Username = "osu!salad!" },
|
||||||
Replay = new CatchAutoGenerator(beatmap).Generate(),
|
Replay = new CatchAutoGenerator(beatmap).Generate(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModDaycore : ModDaycore
|
public class CatchModDaycore : ModDaycore
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 0.5;
|
public override double ScoreMultiplier => 0.3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModDoubleTime : ModDoubleTime
|
public class CatchModDoubleTime : ModDoubleTime
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.06;
|
public override double ScoreMultiplier => 1.06;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModEasy : ModEasy
|
public class CatchModEasy : ModEasy
|
||||||
{
|
{
|
||||||
}
|
public override string Description => @"Larger fruits, more forgiving HP drain, less accuracy required, and three lives!";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModFlashlight : ModFlashlight
|
public class CatchModFlashlight : ModFlashlight
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.12;
|
public override double ScoreMultiplier => 1.12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModHalfTime : ModHalfTime
|
public class CatchModHalfTime : ModHalfTime
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 0.5;
|
public override double ScoreMultiplier => 0.3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,88 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Framework.MathUtils;
|
||||||
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
{
|
using osu.Game.Rulesets.Mods;
|
||||||
public class CatchModHardRock : ModHardRock
|
using System;
|
||||||
{
|
|
||||||
public override double ScoreMultiplier => 1.12;
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
public override bool Ranked => true;
|
{
|
||||||
}
|
public class CatchModHardRock : ModHardRock, IApplicableToHitObject<CatchHitObject>
|
||||||
}
|
{
|
||||||
|
public override double ScoreMultiplier => 1.12;
|
||||||
|
public override bool Ranked => true;
|
||||||
|
|
||||||
|
private float lastStartX;
|
||||||
|
private int lastStartTime;
|
||||||
|
|
||||||
|
public void ApplyToHitObject(CatchHitObject hitObject)
|
||||||
|
{
|
||||||
|
float position = hitObject.X;
|
||||||
|
int startTime = (int)hitObject.StartTime;
|
||||||
|
|
||||||
|
if (lastStartX == 0)
|
||||||
|
{
|
||||||
|
lastStartX = position;
|
||||||
|
lastStartTime = startTime;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
float diff = lastStartX - position;
|
||||||
|
int timeDiff = startTime - lastStartTime;
|
||||||
|
|
||||||
|
if (timeDiff > 1000)
|
||||||
|
{
|
||||||
|
lastStartX = position;
|
||||||
|
lastStartTime = startTime;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diff == 0)
|
||||||
|
{
|
||||||
|
bool right = RNG.NextBool();
|
||||||
|
|
||||||
|
float rand = Math.Min(20, (float)RNG.NextDouble(0, timeDiff / 4d)) / CatchPlayfield.BASE_WIDTH;
|
||||||
|
|
||||||
|
if (right)
|
||||||
|
{
|
||||||
|
if (position + rand <= 1)
|
||||||
|
position += rand;
|
||||||
|
else
|
||||||
|
position -= rand;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (position - rand >= 0)
|
||||||
|
position -= rand;
|
||||||
|
else
|
||||||
|
position += rand;
|
||||||
|
}
|
||||||
|
|
||||||
|
hitObject.X = position;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Math.Abs(diff) < timeDiff / 3d)
|
||||||
|
{
|
||||||
|
if (diff > 0)
|
||||||
|
{
|
||||||
|
if (position - diff > 0)
|
||||||
|
position -= diff;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (position - diff < 1)
|
||||||
|
position -= diff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
hitObject.X = position;
|
||||||
|
|
||||||
|
lastStartX = position;
|
||||||
|
lastStartTime = startTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModHidden : ModHidden
|
public class CatchModHidden : ModHidden
|
||||||
{
|
{
|
||||||
public override string Description => @"Play with fading notes for a slight score advantage.";
|
public override string Description => @"Play with fading fruits.";
|
||||||
public override double ScoreMultiplier => 1.06;
|
public override double ScoreMultiplier => 1.06;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModNightcore : ModNightcore
|
public class CatchModNightcore : ModNightcore
|
||||||
{
|
{
|
||||||
public override double ScoreMultiplier => 1.06;
|
public override double ScoreMultiplier => 1.06;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModNoFail : ModNoFail
|
public class CatchModNoFail : ModNoFail
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModPerfect : ModPerfect
|
public class CatchModPerfect : ModPerfect
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModRelax : ModRelax
|
public class CatchModRelax : ModRelax
|
||||||
{
|
{
|
||||||
public override string Description => @"Use the mouse to control the catcher.";
|
public override string Description => @"Use the mouse to control the catcher.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Mods
|
namespace osu.Game.Rulesets.Catch.Mods
|
||||||
{
|
{
|
||||||
public class CatchModSuddenDeath : ModSuddenDeath
|
public class CatchModSuddenDeath : ModSuddenDeath
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,63 +1,48 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Objects
|
||||||
namespace osu.Game.Rulesets.Catch.Objects
|
{
|
||||||
{
|
public class BananaShower : CatchHitObject, IHasEndTime
|
||||||
public class BananaShower : CatchHitObject, IHasEndTime
|
{
|
||||||
{
|
public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana;
|
||||||
public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana;
|
|
||||||
|
public override bool LastInCombo => true;
|
||||||
public override bool LastInCombo => true;
|
|
||||||
|
protected override void CreateNestedHitObjects()
|
||||||
protected override void CreateNestedHitObjects()
|
{
|
||||||
{
|
base.CreateNestedHitObjects();
|
||||||
base.CreateNestedHitObjects();
|
createBananas();
|
||||||
createBananas();
|
}
|
||||||
}
|
|
||||||
|
private void createBananas()
|
||||||
private void createBananas()
|
{
|
||||||
{
|
double spacing = Duration;
|
||||||
double spacing = Duration;
|
while (spacing > 100)
|
||||||
while (spacing > 100)
|
spacing /= 2;
|
||||||
spacing /= 2;
|
|
||||||
|
if (spacing <= 0)
|
||||||
if (spacing <= 0)
|
return;
|
||||||
return;
|
|
||||||
|
for (double i = StartTime; i <= EndTime; i += spacing)
|
||||||
for (double i = StartTime; i <= EndTime; i += spacing)
|
AddNested(new Banana
|
||||||
AddNested(new Banana
|
{
|
||||||
{
|
Samples = Samples,
|
||||||
Samples = Samples,
|
StartTime = i,
|
||||||
ComboColour = getNextComboColour(),
|
X = RNG.NextSingle()
|
||||||
StartTime = i,
|
});
|
||||||
X = RNG.NextSingle()
|
}
|
||||||
});
|
|
||||||
}
|
public double EndTime => StartTime + Duration;
|
||||||
|
|
||||||
private Color4 getNextComboColour()
|
public double Duration { get; set; }
|
||||||
{
|
|
||||||
switch (RNG.Next(0, 3))
|
public class Banana : Fruit
|
||||||
{
|
{
|
||||||
default:
|
public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana;
|
||||||
return new Color4(255, 240, 0, 255);
|
}
|
||||||
case 1:
|
}
|
||||||
return new Color4(255, 192, 0, 255);
|
}
|
||||||
case 2:
|
|
||||||
return new Color4(214, 221, 28, 255);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double EndTime => StartTime + Duration;
|
|
||||||
|
|
||||||
public double Duration { get; set; }
|
|
||||||
|
|
||||||
public class Banana : Fruit
|
|
||||||
{
|
|
||||||
public override FruitVisualRepresentation VisualRepresentation => FruitVisualRepresentation.Banana;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,59 +1,60 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using OpenTK.Graphics;
|
|
||||||
|
namespace osu.Game.Rulesets.Catch.Objects
|
||||||
namespace osu.Game.Rulesets.Catch.Objects
|
{
|
||||||
{
|
public abstract class CatchHitObject : HitObject, IHasXPosition, IHasComboInformation
|
||||||
public abstract class CatchHitObject : HitObject, IHasXPosition, IHasCombo
|
{
|
||||||
{
|
public const double OBJECT_RADIUS = 44;
|
||||||
public const double OBJECT_RADIUS = 44;
|
|
||||||
|
public float X { get; set; }
|
||||||
public float X { get; set; }
|
|
||||||
|
public int IndexInBeatmap { get; set; }
|
||||||
public Color4 ComboColour { get; set; }
|
|
||||||
|
public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(IndexInBeatmap % 4);
|
||||||
public int IndexInBeatmap { get; set; }
|
|
||||||
|
public virtual bool NewCombo { get; set; }
|
||||||
public virtual FruitVisualRepresentation VisualRepresentation => (FruitVisualRepresentation)(IndexInBeatmap % 4);
|
|
||||||
|
public int IndexInCurrentCombo { get; set; }
|
||||||
public virtual bool NewCombo { get; set; }
|
|
||||||
|
public int ComboIndex { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// The next fruit starts a new combo. Used for explodey.
|
/// <summary>
|
||||||
/// </summary>
|
/// The next fruit starts a new combo. Used for explodey.
|
||||||
public virtual bool LastInCombo { get; set; }
|
/// </summary>
|
||||||
|
public virtual bool LastInCombo { get; set; }
|
||||||
public float Scale { get; set; } = 1;
|
|
||||||
|
public float Scale { get; set; } = 1;
|
||||||
/// <summary>
|
|
||||||
/// Whether this fruit can initiate a hyperdash.
|
/// <summary>
|
||||||
/// </summary>
|
/// Whether this fruit can initiate a hyperdash.
|
||||||
public bool HyperDash => HyperDashTarget != null;
|
/// </summary>
|
||||||
|
public bool HyperDash => HyperDashTarget != null;
|
||||||
/// <summary>
|
|
||||||
/// The target fruit if we are to initiate a hyperdash.
|
/// <summary>
|
||||||
/// </summary>
|
/// The target fruit if we are to initiate a hyperdash.
|
||||||
public CatchHitObject HyperDashTarget;
|
/// </summary>
|
||||||
|
public CatchHitObject HyperDashTarget;
|
||||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
|
||||||
{
|
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
||||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
{
|
||||||
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
||||||
Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5;
|
|
||||||
}
|
Scale = 1.0f - 0.7f * (difficulty.CircleSize - 5) / 5;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public enum FruitVisualRepresentation
|
|
||||||
{
|
public enum FruitVisualRepresentation
|
||||||
Pear,
|
{
|
||||||
Grape,
|
Pear,
|
||||||
Raspberry,
|
Grape,
|
||||||
Pineapple,
|
Raspberry,
|
||||||
Banana // banananananannaanana
|
Pineapple,
|
||||||
}
|
Banana // banananananannaanana
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -1,44 +1,44 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
public class DrawableBananaShower : DrawableCatchHitObject<BananaShower>
|
public class DrawableBananaShower : DrawableCatchHitObject<BananaShower>
|
||||||
{
|
{
|
||||||
private readonly Container bananaContainer;
|
private readonly Container bananaContainer;
|
||||||
|
|
||||||
public DrawableBananaShower(BananaShower s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
public DrawableBananaShower(BananaShower s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
||||||
: base(s)
|
: base(s)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Origin = Anchor.BottomLeft;
|
Origin = Anchor.BottomLeft;
|
||||||
X = 0;
|
X = 0;
|
||||||
|
|
||||||
Child = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
|
InternalChild = bananaContainer = new Container { RelativeSizeAxes = Axes.Both };
|
||||||
|
|
||||||
foreach (var b in s.NestedHitObjects.Cast<BananaShower.Banana>())
|
foreach (var b in s.NestedHitObjects.Cast<BananaShower.Banana>())
|
||||||
AddNested(getVisualRepresentation?.Invoke(b));
|
AddNested(getVisualRepresentation?.Invoke(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
{
|
{
|
||||||
if (timeOffset >= 0)
|
if (timeOffset >= 0)
|
||||||
AddJudgement(new Judgement { Result = NestedHitObjects.Cast<DrawableCatchHitObject>().Any(n => n.Judgements.Any(j => j.IsHit)) ? HitResult.Perfect : HitResult.Miss });
|
AddJudgement(new Judgement { Result = NestedHitObjects.Cast<DrawableCatchHitObject>().Any(n => n.Judgements.Any(j => j.IsHit)) ? HitResult.Perfect : HitResult.Miss });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AddNested(DrawableHitObject h)
|
protected override void AddNested(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
|
((DrawableCatchHitObject)h).CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
|
||||||
bananaContainer.Add(h);
|
bananaContainer.Add(h);
|
||||||
base.AddNested(h);
|
base.AddNested(h);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,83 +1,93 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
|
using osu.Game.Skinning;
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
using OpenTK.Graphics;
|
||||||
{
|
|
||||||
public abstract class PalpableCatchHitObject<TObject> : DrawableCatchHitObject<TObject>
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
where TObject : CatchHitObject
|
{
|
||||||
{
|
public abstract class PalpableCatchHitObject<TObject> : DrawableCatchHitObject<TObject>
|
||||||
public override bool CanBePlated => true;
|
where TObject : CatchHitObject
|
||||||
|
{
|
||||||
protected PalpableCatchHitObject(TObject hitObject)
|
public override bool CanBePlated => true;
|
||||||
: base(hitObject)
|
|
||||||
{
|
protected PalpableCatchHitObject(TObject hitObject)
|
||||||
Scale = new Vector2(HitObject.Scale);
|
: base(hitObject)
|
||||||
}
|
{
|
||||||
}
|
Scale = new Vector2(HitObject.Scale);
|
||||||
|
}
|
||||||
public abstract class DrawableCatchHitObject<TObject> : DrawableCatchHitObject
|
}
|
||||||
where TObject : CatchHitObject
|
|
||||||
{
|
public abstract class DrawableCatchHitObject<TObject> : DrawableCatchHitObject
|
||||||
public new TObject HitObject;
|
where TObject : CatchHitObject
|
||||||
|
{
|
||||||
protected DrawableCatchHitObject(TObject hitObject)
|
public new TObject HitObject;
|
||||||
: base(hitObject)
|
|
||||||
{
|
protected DrawableCatchHitObject(TObject hitObject)
|
||||||
HitObject = hitObject;
|
: base(hitObject)
|
||||||
Anchor = Anchor.BottomLeft;
|
{
|
||||||
}
|
HitObject = hitObject;
|
||||||
}
|
Anchor = Anchor.BottomLeft;
|
||||||
|
}
|
||||||
public abstract class DrawableCatchHitObject : DrawableHitObject<CatchHitObject>
|
}
|
||||||
{
|
|
||||||
public virtual bool CanBePlated => false;
|
public abstract class DrawableCatchHitObject : DrawableHitObject<CatchHitObject>
|
||||||
|
{
|
||||||
protected DrawableCatchHitObject(CatchHitObject hitObject)
|
public virtual bool CanBePlated => false;
|
||||||
: base(hitObject)
|
|
||||||
{
|
protected DrawableCatchHitObject(CatchHitObject hitObject)
|
||||||
RelativePositionAxes = Axes.X;
|
: base(hitObject)
|
||||||
X = hitObject.X;
|
{
|
||||||
}
|
RelativePositionAxes = Axes.X;
|
||||||
|
X = hitObject.X;
|
||||||
public Func<CatchHitObject, bool> CheckPosition;
|
}
|
||||||
|
|
||||||
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
public Func<CatchHitObject, bool> CheckPosition;
|
||||||
{
|
|
||||||
if (CheckPosition == null) return;
|
protected override void CheckForJudgements(bool userTriggered, double timeOffset)
|
||||||
|
{
|
||||||
if (timeOffset >= 0)
|
if (CheckPosition == null) return;
|
||||||
AddJudgement(new Judgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss });
|
|
||||||
}
|
if (timeOffset >= 0)
|
||||||
|
AddJudgement(new Judgement { Result = CheckPosition.Invoke(HitObject) ? HitResult.Perfect : HitResult.Miss });
|
||||||
private const float preempt = 1000;
|
}
|
||||||
|
|
||||||
protected override void UpdateState(ArmedState state)
|
protected override void SkinChanged(ISkinSource skin, bool allowFallback)
|
||||||
{
|
{
|
||||||
using (BeginAbsoluteSequence(HitObject.StartTime - preempt))
|
base.SkinChanged(skin, allowFallback);
|
||||||
this.FadeIn(200);
|
|
||||||
|
if (HitObject is IHasComboInformation combo)
|
||||||
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
AccentColour = skin.GetValue<SkinConfiguration, Color4>(s => s.ComboColours.Count > 0 ? s.ComboColours[combo.ComboIndex % s.ComboColours.Count] : (Color4?)null) ?? Color4.White;
|
||||||
|
}
|
||||||
using (BeginAbsoluteSequence(endTime, true))
|
|
||||||
{
|
private const float preempt = 1000;
|
||||||
switch (state)
|
|
||||||
{
|
protected override void UpdateState(ArmedState state)
|
||||||
case ArmedState.Miss:
|
{
|
||||||
this.FadeOut(250).RotateTo(Rotation * 2, 250, Easing.Out).Expire();
|
using (BeginAbsoluteSequence(HitObject.StartTime - preempt))
|
||||||
break;
|
this.FadeIn(200);
|
||||||
case ArmedState.Hit:
|
|
||||||
this.FadeOut().Expire();
|
var endTime = (HitObject as IHasEndTime)?.EndTime ?? HitObject.StartTime;
|
||||||
break;
|
|
||||||
}
|
using (BeginAbsoluteSequence(endTime, true))
|
||||||
}
|
{
|
||||||
}
|
switch (state)
|
||||||
}
|
{
|
||||||
}
|
case ArmedState.Miss:
|
||||||
|
this.FadeOut(250).RotateTo(Rotation * 2, 250, Easing.Out).Expire();
|
||||||
|
break;
|
||||||
|
case ArmedState.Hit:
|
||||||
|
this.FadeOut().Expire();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,32 +1,43 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
using OpenTK.Graphics;
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
|
||||||
{
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
public class DrawableDroplet : PalpableCatchHitObject<Droplet>
|
{
|
||||||
{
|
public class DrawableDroplet : PalpableCatchHitObject<Droplet>
|
||||||
public DrawableDroplet(Droplet h)
|
{
|
||||||
: base(h)
|
private Pulp pulp;
|
||||||
{
|
|
||||||
Origin = Anchor.Centre;
|
public DrawableDroplet(Droplet h)
|
||||||
Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS) / 4;
|
: base(h)
|
||||||
AccentColour = h.ComboColour;
|
{
|
||||||
Masking = false;
|
Origin = Anchor.Centre;
|
||||||
}
|
Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS) / 4;
|
||||||
|
Masking = false;
|
||||||
[BackgroundDependencyLoader]
|
}
|
||||||
private void load()
|
|
||||||
{
|
[BackgroundDependencyLoader]
|
||||||
Child = new Pulp
|
private void load()
|
||||||
{
|
{
|
||||||
AccentColour = AccentColour,
|
InternalChild = pulp = new Pulp
|
||||||
Size = Size
|
{
|
||||||
};
|
Size = Size
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public override Color4 AccentColour
|
||||||
|
{
|
||||||
|
get { return base.AccentColour; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
base.AccentColour = value;
|
||||||
|
pulp.AccentColour = AccentColour;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,277 +1,305 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
using osu.Game.Rulesets.Catch.Objects.Drawable.Pieces;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
public class DrawableFruit : PalpableCatchHitObject<Fruit>
|
public class DrawableFruit : PalpableCatchHitObject<Fruit>
|
||||||
{
|
{
|
||||||
private Circle border;
|
private Circle border;
|
||||||
|
|
||||||
public DrawableFruit(Fruit h)
|
public DrawableFruit(Fruit h)
|
||||||
: base(h)
|
: base(h)
|
||||||
{
|
{
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS);
|
Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS);
|
||||||
AccentColour = HitObject.ComboColour;
|
Masking = false;
|
||||||
Masking = false;
|
|
||||||
|
Rotation = (float)(RNG.NextDouble() - 0.5f) * 40;
|
||||||
Rotation = (float)(RNG.NextDouble() - 0.5f) * 40;
|
}
|
||||||
}
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
[BackgroundDependencyLoader]
|
private void load()
|
||||||
private void load()
|
{
|
||||||
{
|
// todo: this should come from the skin.
|
||||||
Children = new[]
|
AccentColour = colourForRrepesentation(HitObject.VisualRepresentation);
|
||||||
{
|
|
||||||
createPulp(HitObject.VisualRepresentation),
|
InternalChildren = new[]
|
||||||
border = new Circle
|
{
|
||||||
{
|
createPulp(HitObject.VisualRepresentation),
|
||||||
EdgeEffect = new EdgeEffectParameters
|
border = new Circle
|
||||||
{
|
{
|
||||||
Hollow = !HitObject.HyperDash,
|
EdgeEffect = new EdgeEffectParameters
|
||||||
Type = EdgeEffectType.Glow,
|
{
|
||||||
Radius = 4,
|
Hollow = !HitObject.HyperDash,
|
||||||
Colour = HitObject.HyperDash ? Color4.Red : AccentColour.Darken(1).Opacity(0.6f)
|
Type = EdgeEffectType.Glow,
|
||||||
},
|
Radius = 4,
|
||||||
Size = new Vector2(Height * 1.5f),
|
Colour = HitObject.HyperDash ? Color4.Red : AccentColour.Darken(1).Opacity(0.6f)
|
||||||
Anchor = Anchor.Centre,
|
},
|
||||||
Origin = Anchor.Centre,
|
Size = new Vector2(Height * 1.5f),
|
||||||
BorderColour = Color4.White,
|
Anchor = Anchor.Centre,
|
||||||
BorderThickness = 4f,
|
Origin = Anchor.Centre,
|
||||||
Children = new Framework.Graphics.Drawable[]
|
BorderColour = Color4.White,
|
||||||
{
|
BorderThickness = 4f,
|
||||||
new Box
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
AlwaysPresent = true,
|
new Box
|
||||||
Colour = AccentColour,
|
{
|
||||||
Alpha = 0,
|
AlwaysPresent = true,
|
||||||
RelativeSizeAxes = Axes.Both
|
Colour = AccentColour,
|
||||||
}
|
Alpha = 0,
|
||||||
}
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
|
},
|
||||||
if (HitObject.HyperDash)
|
};
|
||||||
{
|
|
||||||
Add(new Pulp
|
if (HitObject.HyperDash)
|
||||||
{
|
{
|
||||||
RelativePositionAxes = Axes.Both,
|
AddInternal(new Pulp
|
||||||
Anchor = Anchor.Centre,
|
{
|
||||||
Origin = Anchor.Centre,
|
RelativePositionAxes = Axes.Both,
|
||||||
AccentColour = Color4.Red,
|
Anchor = Anchor.Centre,
|
||||||
Blending = BlendingMode.Additive,
|
Origin = Anchor.Centre,
|
||||||
Alpha = 0.5f,
|
AccentColour = Color4.Red,
|
||||||
Scale = new Vector2(1.333f)
|
Blending = BlendingMode.Additive,
|
||||||
});
|
Alpha = 0.5f,
|
||||||
}
|
Scale = new Vector2(1.333f)
|
||||||
}
|
});
|
||||||
|
}
|
||||||
private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation representation)
|
}
|
||||||
{
|
|
||||||
const float large_pulp_3 = 13f;
|
private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation representation)
|
||||||
const float distance_from_centre_3 = 0.23f;
|
{
|
||||||
|
const float large_pulp_3 = 13f;
|
||||||
const float large_pulp_4 = large_pulp_3 * 0.925f;
|
const float distance_from_centre_3 = 0.23f;
|
||||||
const float distance_from_centre_4 = distance_from_centre_3 / 0.925f;
|
|
||||||
|
const float large_pulp_4 = large_pulp_3 * 0.925f;
|
||||||
const float small_pulp = large_pulp_3 / 2;
|
const float distance_from_centre_4 = distance_from_centre_3 / 0.925f;
|
||||||
|
|
||||||
Vector2 positionAt(float angle, float distance) => new Vector2(
|
const float small_pulp = large_pulp_3 / 2;
|
||||||
distance * (float)Math.Sin(angle * Math.PI / 180),
|
|
||||||
distance * (float)Math.Cos(angle * Math.PI / 180));
|
Vector2 positionAt(float angle, float distance) => new Vector2(
|
||||||
|
distance * (float)Math.Sin(angle * Math.PI / 180),
|
||||||
switch (representation)
|
distance * (float)Math.Cos(angle * Math.PI / 180));
|
||||||
{
|
|
||||||
default:
|
switch (representation)
|
||||||
return new Container();
|
{
|
||||||
case FruitVisualRepresentation.Raspberry:
|
default:
|
||||||
return new Container
|
return new Container();
|
||||||
{
|
case FruitVisualRepresentation.Raspberry:
|
||||||
RelativeSizeAxes = Axes.Both,
|
return new Container
|
||||||
Children = new Framework.Graphics.Drawable[]
|
{
|
||||||
{
|
RelativeSizeAxes = Axes.Both,
|
||||||
new Pulp
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
new Pulp
|
||||||
Origin = Anchor.BottomCentre,
|
{
|
||||||
AccentColour = AccentColour,
|
Anchor = Anchor.TopCentre,
|
||||||
Size = new Vector2(small_pulp),
|
Origin = Anchor.BottomCentre,
|
||||||
Y = 0.05f,
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(small_pulp),
|
||||||
new Pulp
|
Y = 0.05f,
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_4),
|
{
|
||||||
Position = positionAt(0, distance_from_centre_4),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_4),
|
||||||
new Pulp
|
Position = positionAt(0, distance_from_centre_4),
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_4),
|
{
|
||||||
Position = positionAt(90, distance_from_centre_4),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_4),
|
||||||
new Pulp
|
Position = positionAt(90, distance_from_centre_4),
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_4),
|
{
|
||||||
Position = positionAt(180, distance_from_centre_4),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_4),
|
||||||
new Pulp
|
Position = positionAt(180, distance_from_centre_4),
|
||||||
{
|
},
|
||||||
Size = new Vector2(large_pulp_4),
|
new Pulp
|
||||||
AccentColour = AccentColour,
|
{
|
||||||
Position = positionAt(270, distance_from_centre_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
},
|
AccentColour = AccentColour,
|
||||||
}
|
Position = positionAt(270, distance_from_centre_4),
|
||||||
};
|
},
|
||||||
case FruitVisualRepresentation.Pineapple:
|
}
|
||||||
return new Container
|
};
|
||||||
{
|
case FruitVisualRepresentation.Pineapple:
|
||||||
RelativeSizeAxes = Axes.Both,
|
return new Container
|
||||||
Children = new Framework.Graphics.Drawable[]
|
{
|
||||||
{
|
RelativeSizeAxes = Axes.Both,
|
||||||
new Pulp
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
new Pulp
|
||||||
Origin = Anchor.BottomCentre,
|
{
|
||||||
AccentColour = AccentColour,
|
Anchor = Anchor.TopCentre,
|
||||||
Size = new Vector2(small_pulp),
|
Origin = Anchor.BottomCentre,
|
||||||
Y = 0.1f,
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(small_pulp),
|
||||||
new Pulp
|
Y = 0.1f,
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_4),
|
{
|
||||||
Position = positionAt(45, distance_from_centre_4),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_4),
|
||||||
new Pulp
|
Position = positionAt(45, distance_from_centre_4),
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_4),
|
{
|
||||||
Position = positionAt(135, distance_from_centre_4),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_4),
|
||||||
new Pulp
|
Position = positionAt(135, distance_from_centre_4),
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_4),
|
{
|
||||||
Position = positionAt(225, distance_from_centre_4),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_4),
|
||||||
new Pulp
|
Position = positionAt(225, distance_from_centre_4),
|
||||||
{
|
},
|
||||||
Size = new Vector2(large_pulp_4),
|
new Pulp
|
||||||
AccentColour = AccentColour,
|
{
|
||||||
Position = positionAt(315, distance_from_centre_4),
|
Size = new Vector2(large_pulp_4),
|
||||||
},
|
AccentColour = AccentColour,
|
||||||
}
|
Position = positionAt(315, distance_from_centre_4),
|
||||||
};
|
},
|
||||||
case FruitVisualRepresentation.Pear:
|
}
|
||||||
return new Container
|
};
|
||||||
{
|
case FruitVisualRepresentation.Pear:
|
||||||
RelativeSizeAxes = Axes.Both,
|
return new Container
|
||||||
Children = new Framework.Graphics.Drawable[]
|
{
|
||||||
{
|
RelativeSizeAxes = Axes.Both,
|
||||||
new Pulp
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
new Pulp
|
||||||
Origin = Anchor.TopCentre,
|
{
|
||||||
AccentColour = AccentColour,
|
Anchor = Anchor.TopCentre,
|
||||||
Size = new Vector2(small_pulp),
|
Origin = Anchor.TopCentre,
|
||||||
Y = -0.1f,
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(small_pulp),
|
||||||
new Pulp
|
Y = -0.1f,
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_3),
|
{
|
||||||
Position = positionAt(60, distance_from_centre_3),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_3),
|
||||||
new Pulp
|
Position = positionAt(60, distance_from_centre_3),
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_3),
|
{
|
||||||
Position = positionAt(180, distance_from_centre_3),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_3),
|
||||||
new Pulp
|
Position = positionAt(180, distance_from_centre_3),
|
||||||
{
|
},
|
||||||
Size = new Vector2(large_pulp_3),
|
new Pulp
|
||||||
AccentColour = AccentColour,
|
{
|
||||||
Position = positionAt(300, distance_from_centre_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
},
|
AccentColour = AccentColour,
|
||||||
}
|
Position = positionAt(300, distance_from_centre_3),
|
||||||
};
|
},
|
||||||
case FruitVisualRepresentation.Grape:
|
}
|
||||||
return new Container
|
};
|
||||||
{
|
case FruitVisualRepresentation.Grape:
|
||||||
RelativeSizeAxes = Axes.Both,
|
return new Container
|
||||||
Children = new Framework.Graphics.Drawable[]
|
{
|
||||||
{
|
RelativeSizeAxes = Axes.Both,
|
||||||
new Pulp
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
new Pulp
|
||||||
Origin = Anchor.TopCentre,
|
{
|
||||||
AccentColour = AccentColour,
|
Anchor = Anchor.TopCentre,
|
||||||
Size = new Vector2(small_pulp),
|
Origin = Anchor.TopCentre,
|
||||||
},
|
AccentColour = AccentColour,
|
||||||
new Pulp
|
Size = new Vector2(small_pulp),
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_3),
|
{
|
||||||
Position = positionAt(0, distance_from_centre_3),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_3),
|
||||||
new Pulp
|
Position = positionAt(0, distance_from_centre_3),
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_3),
|
{
|
||||||
Position = positionAt(120, distance_from_centre_3),
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(large_pulp_3),
|
||||||
new Pulp
|
Position = positionAt(120, distance_from_centre_3),
|
||||||
{
|
},
|
||||||
Size = new Vector2(large_pulp_3),
|
new Pulp
|
||||||
AccentColour = AccentColour,
|
{
|
||||||
Position = positionAt(240, distance_from_centre_3),
|
Size = new Vector2(large_pulp_3),
|
||||||
},
|
AccentColour = AccentColour,
|
||||||
}
|
Position = positionAt(240, distance_from_centre_3),
|
||||||
};
|
},
|
||||||
case FruitVisualRepresentation.Banana:
|
}
|
||||||
return new Container
|
};
|
||||||
{
|
case FruitVisualRepresentation.Banana:
|
||||||
RelativeSizeAxes = Axes.Both,
|
return new Container
|
||||||
Children = new Framework.Graphics.Drawable[]
|
{
|
||||||
{
|
RelativeSizeAxes = Axes.Both,
|
||||||
new Pulp
|
Children = new Framework.Graphics.Drawable[]
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
new Pulp
|
||||||
Origin = Anchor.TopCentre,
|
{
|
||||||
AccentColour = AccentColour,
|
Anchor = Anchor.TopCentre,
|
||||||
Size = new Vector2(small_pulp),
|
Origin = Anchor.TopCentre,
|
||||||
Y = -0.15f
|
AccentColour = AccentColour,
|
||||||
},
|
Size = new Vector2(small_pulp),
|
||||||
new Pulp
|
Y = -0.15f
|
||||||
{
|
},
|
||||||
AccentColour = AccentColour,
|
new Pulp
|
||||||
Size = new Vector2(large_pulp_4 * 1.2f, large_pulp_4 * 3),
|
{
|
||||||
},
|
AccentColour = AccentColour,
|
||||||
}
|
Size = new Vector2(large_pulp_4 * 1.2f, large_pulp_4 * 3),
|
||||||
};
|
},
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
}
|
||||||
protected override void Update()
|
}
|
||||||
{
|
|
||||||
base.Update();
|
protected override void Update()
|
||||||
|
{
|
||||||
border.Alpha = (float)MathHelper.Clamp((HitObject.StartTime - Time.Current) / 500, 0, 1);
|
base.Update();
|
||||||
}
|
|
||||||
}
|
border.Alpha = (float)MathHelper.Clamp((HitObject.StartTime - Time.Current) / 500, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color4 colourForRrepesentation(FruitVisualRepresentation representation)
|
||||||
|
{
|
||||||
|
switch (representation)
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
case FruitVisualRepresentation.Pear:
|
||||||
|
return new Color4(17, 136, 170, 255);
|
||||||
|
case FruitVisualRepresentation.Grape:
|
||||||
|
return new Color4(204, 102, 0, 255);
|
||||||
|
case FruitVisualRepresentation.Raspberry:
|
||||||
|
return new Color4(121, 9, 13, 255);
|
||||||
|
case FruitVisualRepresentation.Pineapple:
|
||||||
|
return new Color4(102, 136, 0, 255);
|
||||||
|
case FruitVisualRepresentation.Banana:
|
||||||
|
switch (RNG.Next(0, 3))
|
||||||
|
{
|
||||||
|
default:
|
||||||
|
return new Color4(255, 240, 0, 255);
|
||||||
|
case 1:
|
||||||
|
return new Color4(255, 192, 0, 255);
|
||||||
|
case 2:
|
||||||
|
return new Color4(214, 221, 28, 255);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,42 +1,41 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable
|
||||||
{
|
{
|
||||||
public class DrawableJuiceStream : DrawableCatchHitObject<JuiceStream>
|
public class DrawableJuiceStream : DrawableCatchHitObject<JuiceStream>
|
||||||
{
|
{
|
||||||
private readonly Container dropletContainer;
|
private readonly Container dropletContainer;
|
||||||
|
|
||||||
public DrawableJuiceStream(JuiceStream s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
public DrawableJuiceStream(JuiceStream s, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation = null)
|
||||||
: base(s)
|
: base(s)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both;
|
RelativeSizeAxes = Axes.Both;
|
||||||
Origin = Anchor.BottomLeft;
|
Origin = Anchor.BottomLeft;
|
||||||
X = 0;
|
X = 0;
|
||||||
|
|
||||||
Child = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
|
InternalChild = dropletContainer = new Container { RelativeSizeAxes = Axes.Both, };
|
||||||
|
|
||||||
foreach (var o in s.NestedHitObjects.Cast<CatchHitObject>())
|
foreach (var o in s.NestedHitObjects.Cast<CatchHitObject>())
|
||||||
AddNested(getVisualRepresentation?.Invoke(o));
|
AddNested(getVisualRepresentation?.Invoke(o));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool ProvidesJudgement => false;
|
protected override bool ProvidesJudgement => false;
|
||||||
|
|
||||||
protected override void AddNested(DrawableHitObject h)
|
protected override void AddNested(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
var catchObject = (DrawableCatchHitObject)h;
|
var catchObject = (DrawableCatchHitObject)h;
|
||||||
|
|
||||||
catchObject.CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
|
catchObject.CheckPosition = o => CheckPosition?.Invoke(o) ?? false;
|
||||||
catchObject.AccentColour = HitObject.ComboColour;
|
|
||||||
|
dropletContainer.Add(h);
|
||||||
dropletContainer.Add(h);
|
base.AddNested(h);
|
||||||
base.AddNested(h);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,42 +1,42 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Extensions.Color4Extensions;
|
using osu.Framework.Extensions.Color4Extensions;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces
|
namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces
|
||||||
{
|
{
|
||||||
public class Pulp : Circle, IHasAccentColour
|
public class Pulp : Circle, IHasAccentColour
|
||||||
{
|
{
|
||||||
public Pulp()
|
public Pulp()
|
||||||
{
|
{
|
||||||
RelativePositionAxes = Axes.Both;
|
RelativePositionAxes = Axes.Both;
|
||||||
Anchor = Anchor.Centre;
|
Anchor = Anchor.Centre;
|
||||||
Origin = Anchor.Centre;
|
Origin = Anchor.Centre;
|
||||||
|
|
||||||
Blending = BlendingMode.Additive;
|
Blending = BlendingMode.Additive;
|
||||||
Colour = Color4.White.Opacity(0.9f);
|
Colour = Color4.White.Opacity(0.9f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Color4 accentColour;
|
private Color4 accentColour;
|
||||||
public Color4 AccentColour
|
public Color4 AccentColour
|
||||||
{
|
{
|
||||||
get { return accentColour; }
|
get { return accentColour; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
accentColour = value;
|
accentColour = value;
|
||||||
|
|
||||||
EdgeEffect = new EdgeEffectParameters
|
EdgeEffect = new EdgeEffectParameters
|
||||||
{
|
{
|
||||||
Type = EdgeEffectType.Glow,
|
Type = EdgeEffectType.Glow,
|
||||||
Radius = 8,
|
Radius = 8,
|
||||||
Colour = accentColour.Darken(0.2f).Opacity(0.75f)
|
Colour = accentColour.Darken(0.2f).Opacity(0.75f)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects
|
namespace osu.Game.Rulesets.Catch.Objects
|
||||||
{
|
{
|
||||||
public class Droplet : CatchHitObject
|
public class Droplet : CatchHitObject
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects
|
namespace osu.Game.Rulesets.Catch.Objects
|
||||||
{
|
{
|
||||||
public class Fruit : CatchHitObject
|
public class Fruit : CatchHitObject
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,156 +1,157 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Audio;
|
using osu.Game.Audio;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects
|
namespace osu.Game.Rulesets.Catch.Objects
|
||||||
{
|
{
|
||||||
public class JuiceStream : CatchHitObject, IHasCurve
|
public class JuiceStream : CatchHitObject, IHasCurve
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Positional distance that results in a duration of one second, before any speed adjustments.
|
/// Positional distance that results in a duration of one second, before any speed adjustments.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const float base_scoring_distance = 100;
|
private const float base_scoring_distance = 100;
|
||||||
|
|
||||||
public int RepeatCount { get; set; }
|
public int RepeatCount { get; set; }
|
||||||
|
|
||||||
public double Velocity;
|
public double Velocity;
|
||||||
public double TickDistance;
|
public double TickDistance;
|
||||||
|
|
||||||
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
protected override void ApplyDefaultsToSelf(ControlPointInfo controlPointInfo, BeatmapDifficulty difficulty)
|
||||||
{
|
{
|
||||||
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
base.ApplyDefaultsToSelf(controlPointInfo, difficulty);
|
||||||
|
|
||||||
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
|
TimingControlPoint timingPoint = controlPointInfo.TimingPointAt(StartTime);
|
||||||
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);
|
DifficultyControlPoint difficultyPoint = controlPointInfo.DifficultyPointAt(StartTime);
|
||||||
|
|
||||||
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
|
double scoringDistance = base_scoring_distance * difficulty.SliderMultiplier * difficultyPoint.SpeedMultiplier;
|
||||||
|
|
||||||
Velocity = scoringDistance / timingPoint.BeatLength;
|
Velocity = scoringDistance / timingPoint.BeatLength;
|
||||||
TickDistance = scoringDistance / difficulty.SliderTickRate;
|
TickDistance = scoringDistance / difficulty.SliderTickRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void CreateNestedHitObjects()
|
protected override void CreateNestedHitObjects()
|
||||||
{
|
{
|
||||||
base.CreateNestedHitObjects();
|
base.CreateNestedHitObjects();
|
||||||
|
|
||||||
createTicks();
|
createTicks();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createTicks()
|
private void createTicks()
|
||||||
{
|
{
|
||||||
if (TickDistance == 0)
|
if (TickDistance == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var length = Curve.Distance;
|
var length = Curve.Distance;
|
||||||
var tickDistance = Math.Min(TickDistance, length);
|
var tickDistance = Math.Min(TickDistance, length);
|
||||||
var spanDuration = length / Velocity;
|
var spanDuration = length / Velocity;
|
||||||
|
|
||||||
var minDistanceFromEnd = Velocity * 0.01;
|
var minDistanceFromEnd = Velocity * 0.01;
|
||||||
|
|
||||||
AddNested(new Fruit
|
AddNested(new Fruit
|
||||||
{
|
{
|
||||||
Samples = Samples,
|
Samples = Samples,
|
||||||
ComboColour = ComboColour,
|
StartTime = StartTime,
|
||||||
StartTime = StartTime,
|
X = X
|
||||||
X = X
|
});
|
||||||
});
|
|
||||||
|
double lastDropletTime = StartTime;
|
||||||
for (var span = 0; span < this.SpanCount(); span++)
|
|
||||||
{
|
for (int span = 0; span < this.SpanCount(); span++)
|
||||||
var spanStartTime = StartTime + span * spanDuration;
|
{
|
||||||
var reversed = span % 2 == 1;
|
var spanStartTime = StartTime + span * spanDuration;
|
||||||
|
var reversed = span % 2 == 1;
|
||||||
for (var d = tickDistance; d <= length; d += tickDistance)
|
|
||||||
{
|
for (double d = 0; d <= length; d += tickDistance)
|
||||||
if (d > length - minDistanceFromEnd)
|
{
|
||||||
break;
|
var timeProgress = d / length;
|
||||||
|
var distanceProgress = reversed ? 1 - timeProgress : timeProgress;
|
||||||
var timeProgress = d / length;
|
|
||||||
var distanceProgress = reversed ? 1 - timeProgress : timeProgress;
|
double time = spanStartTime + timeProgress * spanDuration;
|
||||||
|
|
||||||
var lastTickTime = spanStartTime + timeProgress * spanDuration;
|
double tinyTickInterval = time - lastDropletTime;
|
||||||
AddNested(new Droplet
|
while (tinyTickInterval > 100)
|
||||||
{
|
tinyTickInterval /= 2;
|
||||||
StartTime = lastTickTime,
|
|
||||||
ComboColour = ComboColour,
|
for (double t = lastDropletTime + tinyTickInterval; t < time; t += tinyTickInterval)
|
||||||
X = X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH,
|
{
|
||||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
double progress = reversed ? 1 - (t - spanStartTime) / spanDuration : (t - spanStartTime) / spanDuration;
|
||||||
{
|
|
||||||
Bank = s.Bank,
|
AddNested(new TinyDroplet
|
||||||
Name = @"slidertick",
|
{
|
||||||
Volume = s.Volume
|
StartTime = t,
|
||||||
}))
|
X = X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH,
|
||||||
});
|
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||||
}
|
{
|
||||||
|
Bank = s.Bank,
|
||||||
double tinyTickInterval = tickDistance / length * spanDuration;
|
Name = @"slidertick",
|
||||||
while (tinyTickInterval > 100)
|
Volume = s.Volume
|
||||||
tinyTickInterval /= 2;
|
}))
|
||||||
|
});
|
||||||
for (double t = 0; t < spanDuration; t += tinyTickInterval)
|
}
|
||||||
{
|
|
||||||
double progress = reversed ? 1 - t / spanDuration : t / spanDuration;
|
if (d > minDistanceFromEnd && Math.Abs(d - length) > minDistanceFromEnd)
|
||||||
|
{
|
||||||
AddNested(new TinyDroplet
|
AddNested(new Droplet
|
||||||
{
|
{
|
||||||
StartTime = spanStartTime + t,
|
StartTime = time,
|
||||||
ComboColour = ComboColour,
|
X = X + Curve.PositionAt(distanceProgress).X / CatchPlayfield.BASE_WIDTH,
|
||||||
X = X + Curve.PositionAt(progress).X / CatchPlayfield.BASE_WIDTH,
|
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
||||||
Samples = new List<SampleInfo>(Samples.Select(s => new SampleInfo
|
{
|
||||||
{
|
Bank = s.Bank,
|
||||||
Bank = s.Bank,
|
Name = @"slidertick",
|
||||||
Name = @"slidertick",
|
Volume = s.Volume
|
||||||
Volume = s.Volume
|
}))
|
||||||
}))
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
|
lastDropletTime = time;
|
||||||
AddNested(new Fruit
|
}
|
||||||
{
|
|
||||||
Samples = Samples,
|
AddNested(new Fruit
|
||||||
ComboColour = ComboColour,
|
{
|
||||||
StartTime = spanStartTime + spanDuration,
|
Samples = Samples,
|
||||||
X = X + Curve.PositionAt(reversed ? 0 : 1).X / CatchPlayfield.BASE_WIDTH
|
StartTime = spanStartTime + spanDuration,
|
||||||
});
|
X = X + Curve.PositionAt(reversed ? 0 : 1).X / CatchPlayfield.BASE_WIDTH
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public double EndTime => StartTime + this.SpanCount() * Curve.Distance / Velocity;
|
|
||||||
|
public double EndTime => StartTime + this.SpanCount() * Curve.Distance / Velocity;
|
||||||
public float EndX => X + this.CurvePositionAt(1).X / CatchPlayfield.BASE_WIDTH;
|
|
||||||
|
public float EndX => X + this.CurvePositionAt(1).X / CatchPlayfield.BASE_WIDTH;
|
||||||
public double Duration => EndTime - StartTime;
|
|
||||||
|
public double Duration => EndTime - StartTime;
|
||||||
public double Distance
|
|
||||||
{
|
public double Distance
|
||||||
get { return Curve.Distance; }
|
{
|
||||||
set { Curve.Distance = value; }
|
get { return Curve.Distance; }
|
||||||
}
|
set { Curve.Distance = value; }
|
||||||
|
}
|
||||||
public SliderCurve Curve { get; } = new SliderCurve();
|
|
||||||
|
public SliderCurve Curve { get; } = new SliderCurve();
|
||||||
public List<Vector2> ControlPoints
|
|
||||||
{
|
public List<Vector2> ControlPoints
|
||||||
get { return Curve.ControlPoints; }
|
{
|
||||||
set { Curve.ControlPoints = value; }
|
get { return Curve.ControlPoints; }
|
||||||
}
|
set { Curve.ControlPoints = value; }
|
||||||
|
}
|
||||||
public List<List<SampleInfo>> RepeatSamples { get; set; } = new List<List<SampleInfo>>();
|
|
||||||
|
public List<List<SampleInfo>> RepeatSamples { get; set; } = new List<List<SampleInfo>>();
|
||||||
public CurveType CurveType
|
|
||||||
{
|
public CurveType CurveType
|
||||||
get { return Curve.CurveType; }
|
{
|
||||||
set { Curve.CurveType = value; }
|
get { return Curve.CurveType; }
|
||||||
}
|
set { Curve.CurveType = value; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Objects
|
namespace osu.Game.Rulesets.Catch.Objects
|
||||||
{
|
{
|
||||||
public class TinyDroplet : Droplet
|
public class TinyDroplet : Droplet
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
<configuration>
|
|
||||||
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
|
|
||||||
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
|
|
||||||
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
|
|
||||||
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
|
|
||||||
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
|
|
||||||
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
|
|
||||||
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
|
|
||||||
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
|
|
||||||
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
|
|
||||||
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
|
||||||
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
|
|
||||||
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
|
||||||
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
|
||||||
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
|
|
||||||
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
|
|
||||||
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
|
|
||||||
<!-- XQuartz compatibility (X11 on Mac) -->
|
|
||||||
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
|
|
||||||
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
|
|
||||||
</configuration>
|
|
@ -1,28 +1,11 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
// We publish our internal attributes to other sub-projects of the framework.
|
||||||
// General Information about an assembly is controlled through the following
|
// Note, that we omit visual tests as they are meant to test the framework
|
||||||
// set of attributes. Change these attribute values to modify the information
|
// behavior "in the wild".
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("osu.Game.Rulesets.Catch")]
|
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Catch.Tests")]
|
||||||
[assembly: AssemblyDescription("catch the fruit. to the beat.")]
|
[assembly: InternalsVisibleTo("osu.Game.Rulesets.Catch.Tests.Dynamic")]
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("ppy Pty Ltd")]
|
|
||||||
[assembly: AssemblyProduct("osu.Game.Rulesets.Catch")]
|
|
||||||
[assembly: AssemblyCopyright("ppy Pty Ltd 2007-2018")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("58f6c80c-1253-4a0e-a465-b8c85ebeadf3")]
|
|
||||||
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
||||||
|
@ -1,120 +1,121 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Replays
|
namespace osu.Game.Rulesets.Catch.Replays
|
||||||
{
|
{
|
||||||
internal class CatchAutoGenerator : AutoGenerator<CatchHitObject>
|
internal class CatchAutoGenerator : AutoGenerator<CatchHitObject>
|
||||||
{
|
{
|
||||||
public const double RELEASE_DELAY = 20;
|
public const double RELEASE_DELAY = 20;
|
||||||
|
|
||||||
public CatchAutoGenerator(Beatmap<CatchHitObject> beatmap)
|
public CatchAutoGenerator(Beatmap<CatchHitObject> beatmap)
|
||||||
: base(beatmap)
|
: base(beatmap)
|
||||||
{
|
{
|
||||||
Replay = new Replay { User = new User { Username = @"Autoplay" } };
|
Replay = new Replay { User = new User { Username = @"Autoplay" } };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Replay Replay;
|
protected Replay Replay;
|
||||||
|
|
||||||
public override Replay Generate()
|
public override Replay Generate()
|
||||||
{
|
{
|
||||||
// todo: add support for HT DT
|
// todo: add support for HT DT
|
||||||
const double dash_speed = CatcherArea.Catcher.BASE_SPEED;
|
const double dash_speed = CatcherArea.Catcher.BASE_SPEED;
|
||||||
const double movement_speed = dash_speed / 2;
|
const double movement_speed = dash_speed / 2;
|
||||||
float lastPosition = 0.5f;
|
float lastPosition = 0.5f;
|
||||||
double lastTime = 0;
|
double lastTime = 0;
|
||||||
|
|
||||||
// Todo: Realistically this shouldn't be needed, but the first frame is skipped with the way replays are currently handled
|
// Todo: Realistically this shouldn't be needed, but the first frame is skipped with the way replays are currently handled
|
||||||
Replay.Frames.Add(new CatchReplayFrame(-100000, lastPosition));
|
Replay.Frames.Add(new CatchReplayFrame(-100000, lastPosition));
|
||||||
|
|
||||||
void moveToNext(CatchHitObject h)
|
void moveToNext(CatchHitObject h)
|
||||||
{
|
{
|
||||||
float positionChange = Math.Abs(lastPosition - h.X);
|
float positionChange = Math.Abs(lastPosition - h.X);
|
||||||
double timeAvailable = h.StartTime - lastTime;
|
double timeAvailable = h.StartTime - lastTime;
|
||||||
|
|
||||||
//So we can either make it there without a dash or not.
|
//So we can either make it there without a dash or not.
|
||||||
double speedRequired = positionChange / timeAvailable;
|
double speedRequired = positionChange / timeAvailable;
|
||||||
|
|
||||||
bool dashRequired = speedRequired > movement_speed && h.StartTime != 0;
|
bool dashRequired = speedRequired > movement_speed && h.StartTime != 0;
|
||||||
|
|
||||||
// todo: get correct catcher size, based on difficulty CS.
|
// todo: get correct catcher size, based on difficulty CS.
|
||||||
const float catcher_width_half = CatcherArea.CATCHER_SIZE / CatchPlayfield.BASE_WIDTH * 0.3f * 0.5f;
|
const float catcher_width_half = CatcherArea.CATCHER_SIZE / CatchPlayfield.BASE_WIDTH * 0.3f * 0.5f;
|
||||||
|
|
||||||
if (lastPosition - catcher_width_half < h.X && lastPosition + catcher_width_half > h.X)
|
if (lastPosition - catcher_width_half < h.X && lastPosition + catcher_width_half > h.X)
|
||||||
{
|
{
|
||||||
//we are already in the correct range.
|
//we are already in the correct range.
|
||||||
lastTime = h.StartTime;
|
lastTime = h.StartTime;
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, lastPosition));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, lastPosition));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (h is BananaShower.Banana)
|
if (h is BananaShower.Banana)
|
||||||
{
|
{
|
||||||
// auto bananas unrealistically warp to catch 100% combo.
|
// auto bananas unrealistically warp to catch 100% combo.
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
||||||
}
|
}
|
||||||
else if (h.HyperDash)
|
else if (h.HyperDash)
|
||||||
{
|
{
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable, lastPosition));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable, lastPosition));
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
||||||
}
|
}
|
||||||
else if (dashRequired)
|
else if (dashRequired)
|
||||||
{
|
{
|
||||||
//we do a movement in two parts - the dash part then the normal part...
|
//we do a movement in two parts - the dash part then the normal part...
|
||||||
double timeAtNormalSpeed = positionChange / movement_speed;
|
double timeAtNormalSpeed = positionChange / movement_speed;
|
||||||
double timeWeNeedToSave = timeAtNormalSpeed - timeAvailable;
|
double timeWeNeedToSave = timeAtNormalSpeed - timeAvailable;
|
||||||
double timeAtDashSpeed = timeWeNeedToSave / 2;
|
double timeAtDashSpeed = timeWeNeedToSave / 2;
|
||||||
|
|
||||||
float midPosition = (float)Interpolation.Lerp(lastPosition, h.X, (float)timeAtDashSpeed / timeAvailable);
|
float midPosition = (float)Interpolation.Lerp(lastPosition, h.X, (float)timeAtDashSpeed / timeAvailable);
|
||||||
|
|
||||||
//dash movement
|
//dash movement
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable + 1, lastPosition, true));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable + 1, lastPosition, true));
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable + timeAtDashSpeed, midPosition));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeAvailable + timeAtDashSpeed, midPosition));
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double timeBefore = positionChange / movement_speed;
|
double timeBefore = positionChange / movement_speed;
|
||||||
|
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeBefore, lastPosition));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime - timeBefore, lastPosition));
|
||||||
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
Replay.Frames.Add(new CatchReplayFrame(h.StartTime, h.X));
|
||||||
}
|
}
|
||||||
|
|
||||||
lastTime = h.StartTime;
|
lastTime = h.StartTime;
|
||||||
lastPosition = h.X;
|
lastPosition = h.X;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var obj in Beatmap.HitObjects)
|
foreach (var obj in Beatmap.HitObjects)
|
||||||
{
|
{
|
||||||
switch (obj)
|
switch (obj)
|
||||||
{
|
{
|
||||||
case Fruit _:
|
case Fruit _:
|
||||||
moveToNext(obj);
|
moveToNext(obj);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var nestedObj in obj.NestedHitObjects.Cast<CatchHitObject>())
|
foreach (var nestedObj in obj.NestedHitObjects.Cast<CatchHitObject>())
|
||||||
{
|
{
|
||||||
switch (nestedObj)
|
switch (nestedObj)
|
||||||
{
|
{
|
||||||
case BananaShower.Banana _:
|
case BananaShower.Banana _:
|
||||||
case TinyDroplet _:
|
case TinyDroplet _:
|
||||||
case Droplet _:
|
case Droplet _:
|
||||||
moveToNext(nestedObj);
|
case Fruit _:
|
||||||
break;
|
moveToNext(nestedObj);
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return Replay;
|
|
||||||
}
|
return Replay;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -1,60 +1,60 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Replays
|
namespace osu.Game.Rulesets.Catch.Replays
|
||||||
{
|
{
|
||||||
public class CatchFramedReplayInputHandler : FramedReplayInputHandler<CatchReplayFrame>
|
public class CatchFramedReplayInputHandler : FramedReplayInputHandler<CatchReplayFrame>
|
||||||
{
|
{
|
||||||
public CatchFramedReplayInputHandler(Replay replay)
|
public CatchFramedReplayInputHandler(Replay replay)
|
||||||
: base(replay)
|
: base(replay)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool IsImportant(CatchReplayFrame frame) => frame.Position > 0;
|
protected override bool IsImportant(CatchReplayFrame frame) => frame.Position > 0;
|
||||||
|
|
||||||
protected float? Position
|
protected float? Position
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!HasFrames)
|
if (!HasFrames)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return Interpolation.ValueAt(CurrentTime, CurrentFrame.Position, NextFrame.Position, CurrentFrame.Time, NextFrame.Time);
|
return Interpolation.ValueAt(CurrentTime, CurrentFrame.Position, NextFrame.Position, CurrentFrame.Time, NextFrame.Time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override List<InputState> GetPendingStates()
|
public override List<InputState> GetPendingStates()
|
||||||
{
|
{
|
||||||
if (!Position.HasValue) return new List<InputState>();
|
if (!Position.HasValue) return new List<InputState>();
|
||||||
|
|
||||||
var actions = new List<CatchAction>();
|
var actions = new List<CatchAction>();
|
||||||
|
|
||||||
if (CurrentFrame.Dashing)
|
if (CurrentFrame.Dashing)
|
||||||
actions.Add(CatchAction.Dash);
|
actions.Add(CatchAction.Dash);
|
||||||
|
|
||||||
if (Position.Value > CurrentFrame.Position)
|
if (Position.Value > CurrentFrame.Position)
|
||||||
actions.Add(CatchAction.MoveRight);
|
actions.Add(CatchAction.MoveRight);
|
||||||
else if (Position.Value < CurrentFrame.Position)
|
else if (Position.Value < CurrentFrame.Position)
|
||||||
actions.Add(CatchAction.MoveLeft);
|
actions.Add(CatchAction.MoveLeft);
|
||||||
|
|
||||||
return new List<InputState>
|
return new List<InputState>
|
||||||
{
|
{
|
||||||
new CatchReplayState
|
new CatchReplayState
|
||||||
{
|
{
|
||||||
PressedActions = actions,
|
PressedActions = actions,
|
||||||
CatcherX = Position.Value
|
CatcherX = Position.Value
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CatchReplayState : ReplayState<CatchAction>
|
public class CatchReplayState : ReplayState<CatchAction>
|
||||||
{
|
{
|
||||||
public float? CatcherX { get; set; }
|
public float? CatcherX { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,34 +1,34 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.UI;
|
using osu.Game.Rulesets.Catch.UI;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
using osu.Game.Rulesets.Replays.Legacy;
|
using osu.Game.Rulesets.Replays.Legacy;
|
||||||
using osu.Game.Rulesets.Replays.Types;
|
using osu.Game.Rulesets.Replays.Types;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Replays
|
namespace osu.Game.Rulesets.Catch.Replays
|
||||||
{
|
{
|
||||||
public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame
|
public class CatchReplayFrame : ReplayFrame, IConvertibleReplayFrame
|
||||||
{
|
{
|
||||||
public float Position;
|
public float Position;
|
||||||
public bool Dashing;
|
public bool Dashing;
|
||||||
|
|
||||||
public CatchReplayFrame()
|
public CatchReplayFrame()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public CatchReplayFrame(double time, float? position = null, bool dashing = false)
|
public CatchReplayFrame(double time, float? position = null, bool dashing = false)
|
||||||
: base(time)
|
: base(time)
|
||||||
{
|
{
|
||||||
Position = position ?? -1;
|
Position = position ?? -1;
|
||||||
Dashing = dashing;
|
Dashing = dashing;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
|
public void ConvertFrom(LegacyReplayFrame legacyFrame, Beatmap beatmap)
|
||||||
{
|
{
|
||||||
Position = legacyFrame.Position.X / CatchPlayfield.BASE_WIDTH;
|
Position = legacyFrame.Position.X / CatchPlayfield.BASE_WIDTH;
|
||||||
Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1;
|
Dashing = legacyFrame.ButtonState == ReplayButtonState.Left1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,44 +1,44 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Judgements;
|
using osu.Game.Rulesets.Catch.Judgements;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.Scoring
|
namespace osu.Game.Rulesets.Catch.Scoring
|
||||||
{
|
{
|
||||||
public class CatchScoreProcessor : ScoreProcessor<CatchHitObject>
|
public class CatchScoreProcessor : ScoreProcessor<CatchHitObject>
|
||||||
{
|
{
|
||||||
public CatchScoreProcessor(RulesetContainer<CatchHitObject> rulesetContainer)
|
public CatchScoreProcessor(RulesetContainer<CatchHitObject> rulesetContainer)
|
||||||
: base(rulesetContainer)
|
: base(rulesetContainer)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SimulateAutoplay(Beatmap<CatchHitObject> beatmap)
|
protected override void SimulateAutoplay(Beatmap<CatchHitObject> beatmap)
|
||||||
{
|
{
|
||||||
foreach (var obj in beatmap.HitObjects)
|
foreach (var obj in beatmap.HitObjects)
|
||||||
{
|
{
|
||||||
switch (obj)
|
switch (obj)
|
||||||
{
|
{
|
||||||
case JuiceStream stream:
|
case JuiceStream stream:
|
||||||
foreach (var _ in stream.NestedHitObjects.Cast<CatchHitObject>())
|
foreach (var _ in stream.NestedHitObjects.Cast<CatchHitObject>())
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
||||||
break;
|
break;
|
||||||
case BananaShower shower:
|
case BananaShower shower:
|
||||||
foreach (var _ in shower.NestedHitObjects.Cast<CatchHitObject>())
|
foreach (var _ in shower.NestedHitObjects.Cast<CatchHitObject>())
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
||||||
break;
|
break;
|
||||||
case Fruit _:
|
case Fruit _:
|
||||||
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
AddJudgement(new CatchJudgement { Result = HitResult.Perfect });
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
base.SimulateAutoplay(beatmap);
|
base.SimulateAutoplay(beatmap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,71 +1,70 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
public class CatchPlayfield : ScrollingPlayfield
|
public class CatchPlayfield : ScrollingPlayfield
|
||||||
{
|
{
|
||||||
public const float BASE_WIDTH = 512;
|
public const float BASE_WIDTH = 512;
|
||||||
|
|
||||||
protected override Container<Drawable> Content => content;
|
protected override Container<Drawable> Content => content;
|
||||||
private readonly Container<Drawable> content;
|
private readonly Container<Drawable> content;
|
||||||
|
|
||||||
private readonly CatcherArea catcherArea;
|
private readonly CatcherArea catcherArea;
|
||||||
|
|
||||||
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation)
|
public CatchPlayfield(BeatmapDifficulty difficulty, Func<CatchHitObject, DrawableHitObject<CatchHitObject>> getVisualRepresentation)
|
||||||
: base(ScrollingDirection.Down, BASE_WIDTH)
|
: base(ScrollingDirection.Down, BASE_WIDTH)
|
||||||
{
|
{
|
||||||
Container explodingFruitContainer;
|
Container explodingFruitContainer;
|
||||||
|
|
||||||
Anchor = Anchor.TopCentre;
|
Anchor = Anchor.TopCentre;
|
||||||
Origin = Anchor.TopCentre;
|
Origin = Anchor.TopCentre;
|
||||||
|
|
||||||
ScaledContent.Anchor = Anchor.BottomLeft;
|
base.Content.Anchor = Anchor.BottomLeft;
|
||||||
ScaledContent.Origin = Anchor.BottomLeft;
|
base.Content.Origin = Anchor.BottomLeft;
|
||||||
|
|
||||||
ScaledContent.AddRange(new Drawable[]
|
base.Content.AddRange(new Drawable[]
|
||||||
{
|
{
|
||||||
explodingFruitContainer = new Container
|
explodingFruitContainer = new Container
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
catcherArea = new CatcherArea(difficulty)
|
catcherArea = new CatcherArea(difficulty)
|
||||||
{
|
{
|
||||||
GetVisualRepresentation = getVisualRepresentation,
|
GetVisualRepresentation = getVisualRepresentation,
|
||||||
ExplodingFruitTarget = explodingFruitContainer,
|
ExplodingFruitTarget = explodingFruitContainer,
|
||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.TopLeft,
|
Origin = Anchor.TopLeft,
|
||||||
},
|
},
|
||||||
content = new Container<Drawable>
|
content = new Container<Drawable>
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.AttemptCatch(obj);
|
public bool CheckIfWeCanCatch(CatchHitObject obj) => catcherArea.AttemptCatch(obj);
|
||||||
|
|
||||||
public override void Add(DrawableHitObject h)
|
public override void Add(DrawableHitObject h)
|
||||||
{
|
{
|
||||||
h.Depth = (float)h.HitObject.StartTime;
|
h.OnJudgement += onJudgement;
|
||||||
h.OnJudgement += onJudgement;
|
|
||||||
|
base.Add(h);
|
||||||
base.Add(h);
|
|
||||||
|
var fruit = (DrawableCatchHitObject)h;
|
||||||
var fruit = (DrawableCatchHitObject)h;
|
fruit.CheckPosition = CheckIfWeCanCatch;
|
||||||
fruit.CheckPosition = CheckIfWeCanCatch;
|
}
|
||||||
}
|
|
||||||
|
private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement);
|
||||||
private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) => catcherArea.OnJudgement((DrawableCatchHitObject)judgedObject, judgement);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,59 +1,59 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using osu.Framework.Input;
|
using osu.Framework.Input;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Input.Handlers;
|
using osu.Game.Input.Handlers;
|
||||||
using osu.Game.Rulesets.Catch.Beatmaps;
|
using osu.Game.Rulesets.Catch.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||||
using osu.Game.Rulesets.Catch.Replays;
|
using osu.Game.Rulesets.Catch.Replays;
|
||||||
using osu.Game.Rulesets.Catch.Scoring;
|
using osu.Game.Rulesets.Catch.Scoring;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Rulesets.UI.Scrolling;
|
using osu.Game.Rulesets.UI.Scrolling;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
public class CatchRulesetContainer : ScrollingRulesetContainer<CatchPlayfield, CatchHitObject>
|
public class CatchRulesetContainer : ScrollingRulesetContainer<CatchPlayfield, CatchHitObject>
|
||||||
{
|
{
|
||||||
public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
public CatchRulesetContainer(Ruleset ruleset, WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||||
: base(ruleset, beatmap, isForCurrentRuleset)
|
: base(ruleset, beatmap, isForCurrentRuleset)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this);
|
public override ScoreProcessor CreateScoreProcessor() => new CatchScoreProcessor(this);
|
||||||
|
|
||||||
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new CatchFramedReplayInputHandler(replay);
|
protected override ReplayInputHandler CreateReplayInputHandler(Replay replay) => new CatchFramedReplayInputHandler(replay);
|
||||||
|
|
||||||
protected override BeatmapProcessor<CatchHitObject> CreateBeatmapProcessor() => new CatchBeatmapProcessor();
|
protected override BeatmapProcessor<CatchHitObject> CreateBeatmapProcessor() => new CatchBeatmapProcessor();
|
||||||
|
|
||||||
protected override BeatmapConverter<CatchHitObject> CreateBeatmapConverter() => new CatchBeatmapConverter();
|
protected override BeatmapConverter<CatchHitObject> CreateBeatmapConverter() => new CatchBeatmapConverter();
|
||||||
|
|
||||||
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, GetVisualRepresentation);
|
protected override Playfield CreatePlayfield() => new CatchPlayfield(Beatmap.BeatmapInfo.BaseDifficulty, GetVisualRepresentation);
|
||||||
|
|
||||||
public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo);
|
||||||
|
|
||||||
protected override DrawableHitObject<CatchHitObject> GetVisualRepresentation(CatchHitObject h)
|
protected override DrawableHitObject<CatchHitObject> GetVisualRepresentation(CatchHitObject h)
|
||||||
{
|
{
|
||||||
switch (h)
|
switch (h)
|
||||||
{
|
{
|
||||||
case Fruit fruit:
|
case Fruit fruit:
|
||||||
return new DrawableFruit(fruit);
|
return new DrawableFruit(fruit);
|
||||||
case JuiceStream stream:
|
case JuiceStream stream:
|
||||||
return new DrawableJuiceStream(stream, GetVisualRepresentation);
|
return new DrawableJuiceStream(stream, GetVisualRepresentation);
|
||||||
case BananaShower banana:
|
case BananaShower banana:
|
||||||
return new DrawableBananaShower(banana, GetVisualRepresentation);
|
return new DrawableBananaShower(banana, GetVisualRepresentation);
|
||||||
case TinyDroplet tiny:
|
case TinyDroplet tiny:
|
||||||
return new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) };
|
return new DrawableDroplet(tiny) { Scale = new Vector2(0.5f) };
|
||||||
case Droplet droplet:
|
case Droplet droplet:
|
||||||
return new DrawableDroplet(droplet);
|
return new DrawableDroplet(droplet);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,417 +1,416 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Catch.Objects;
|
using osu.Game.Rulesets.Catch.Objects;
|
||||||
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
using osu.Game.Rulesets.Catch.Objects.Drawable;
|
||||||
using osu.Game.Rulesets.Catch.Replays;
|
using osu.Game.Rulesets.Catch.Replays;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Catch.UI
|
namespace osu.Game.Rulesets.Catch.UI
|
||||||
{
|
{
|
||||||
public class CatcherArea : Container
|
public class CatcherArea : Container
|
||||||
{
|
{
|
||||||
public const float CATCHER_SIZE = 172;
|
public const float CATCHER_SIZE = 172;
|
||||||
|
|
||||||
protected readonly Catcher MovableCatcher;
|
protected readonly Catcher MovableCatcher;
|
||||||
|
|
||||||
public Func<CatchHitObject, DrawableHitObject<CatchHitObject>> GetVisualRepresentation;
|
public Func<CatchHitObject, DrawableHitObject<CatchHitObject>> GetVisualRepresentation;
|
||||||
|
|
||||||
public Container ExplodingFruitTarget
|
public Container ExplodingFruitTarget
|
||||||
{
|
{
|
||||||
set { MovableCatcher.ExplodingFruitTarget = value; }
|
set { MovableCatcher.ExplodingFruitTarget = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public CatcherArea(BeatmapDifficulty difficulty = null)
|
public CatcherArea(BeatmapDifficulty difficulty = null)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
Height = CATCHER_SIZE;
|
Height = CATCHER_SIZE;
|
||||||
Child = MovableCatcher = new Catcher(difficulty)
|
Child = MovableCatcher = new Catcher(difficulty)
|
||||||
{
|
{
|
||||||
AdditiveTarget = this,
|
AdditiveTarget = this,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private DrawableCatchHitObject lastPlateableFruit;
|
private DrawableCatchHitObject lastPlateableFruit;
|
||||||
|
|
||||||
public void OnJudgement(DrawableCatchHitObject fruit, Judgement judgement)
|
public void OnJudgement(DrawableCatchHitObject fruit, Judgement judgement)
|
||||||
{
|
{
|
||||||
if (judgement.IsHit && fruit.CanBePlated)
|
if (judgement.IsHit && fruit.CanBePlated)
|
||||||
{
|
{
|
||||||
var caughtFruit = (DrawableCatchHitObject)GetVisualRepresentation?.Invoke(fruit.HitObject);
|
var caughtFruit = (DrawableCatchHitObject)GetVisualRepresentation?.Invoke(fruit.HitObject);
|
||||||
|
|
||||||
if (caughtFruit == null) return;
|
if (caughtFruit == null) return;
|
||||||
|
|
||||||
caughtFruit.AccentColour = fruit.AccentColour;
|
caughtFruit.RelativePositionAxes = Axes.None;
|
||||||
caughtFruit.RelativePositionAxes = Axes.None;
|
caughtFruit.Position = new Vector2(MovableCatcher.ToLocalSpace(fruit.ScreenSpaceDrawQuad.Centre).X - MovableCatcher.DrawSize.X / 2, 0);
|
||||||
caughtFruit.Position = new Vector2(MovableCatcher.ToLocalSpace(fruit.ScreenSpaceDrawQuad.Centre).X - MovableCatcher.DrawSize.X / 2, 0);
|
|
||||||
|
caughtFruit.Anchor = Anchor.TopCentre;
|
||||||
caughtFruit.Anchor = Anchor.TopCentre;
|
caughtFruit.Origin = Anchor.Centre;
|
||||||
caughtFruit.Origin = Anchor.Centre;
|
caughtFruit.Scale *= 0.7f;
|
||||||
caughtFruit.Scale *= 0.7f;
|
caughtFruit.LifetimeEnd = double.MaxValue;
|
||||||
caughtFruit.LifetimeEnd = double.MaxValue;
|
|
||||||
|
MovableCatcher.Add(caughtFruit);
|
||||||
MovableCatcher.Add(caughtFruit);
|
|
||||||
|
lastPlateableFruit = caughtFruit;
|
||||||
lastPlateableFruit = caughtFruit;
|
}
|
||||||
}
|
|
||||||
|
if (fruit.HitObject.LastInCombo)
|
||||||
if (fruit.HitObject.LastInCombo)
|
{
|
||||||
{
|
if (judgement.IsHit)
|
||||||
if (judgement.IsHit)
|
{
|
||||||
{
|
// this is required to make this run after the last caught fruit runs UpdateState at least once.
|
||||||
// this is required to make this run after the last caught fruit runs UpdateState at least once.
|
// TODO: find a better alternative
|
||||||
// TODO: find a better alternative
|
if (lastPlateableFruit.IsLoaded)
|
||||||
if (lastPlateableFruit.IsLoaded)
|
MovableCatcher.Explode();
|
||||||
MovableCatcher.Explode();
|
else
|
||||||
else
|
lastPlateableFruit.OnLoadComplete = _ => { MovableCatcher.Explode(); };
|
||||||
lastPlateableFruit.OnLoadComplete = _ => { MovableCatcher.Explode(); };
|
}
|
||||||
}
|
else
|
||||||
else
|
MovableCatcher.Drop();
|
||||||
MovableCatcher.Drop();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
protected override void UpdateAfterChildren()
|
||||||
protected override void UpdateAfterChildren()
|
{
|
||||||
{
|
base.UpdateAfterChildren();
|
||||||
base.UpdateAfterChildren();
|
|
||||||
|
var state = GetContainingInputManager().CurrentState as CatchFramedReplayInputHandler.CatchReplayState;
|
||||||
var state = GetContainingInputManager().CurrentState as CatchFramedReplayInputHandler.CatchReplayState;
|
|
||||||
|
if (state?.CatcherX != null)
|
||||||
if (state?.CatcherX != null)
|
MovableCatcher.X = state.CatcherX.Value;
|
||||||
MovableCatcher.X = state.CatcherX.Value;
|
}
|
||||||
}
|
|
||||||
|
public bool OnReleased(CatchAction action) => false;
|
||||||
public bool OnReleased(CatchAction action) => false;
|
|
||||||
|
public bool AttemptCatch(CatchHitObject obj) => MovableCatcher.AttemptCatch(obj);
|
||||||
public bool AttemptCatch(CatchHitObject obj) => MovableCatcher.AttemptCatch(obj);
|
|
||||||
|
public class Catcher : Container, IKeyBindingHandler<CatchAction>
|
||||||
public class Catcher : Container, IKeyBindingHandler<CatchAction>
|
{
|
||||||
{
|
private Texture texture;
|
||||||
private Texture texture;
|
|
||||||
|
private Container<DrawableHitObject> caughtFruit;
|
||||||
private Container<DrawableHitObject> caughtFruit;
|
|
||||||
|
public Container ExplodingFruitTarget;
|
||||||
public Container ExplodingFruitTarget;
|
|
||||||
|
public Container AdditiveTarget;
|
||||||
public Container AdditiveTarget;
|
|
||||||
|
public Catcher(BeatmapDifficulty difficulty = null)
|
||||||
public Catcher(BeatmapDifficulty difficulty = null)
|
{
|
||||||
{
|
RelativePositionAxes = Axes.X;
|
||||||
RelativePositionAxes = Axes.X;
|
X = 0.5f;
|
||||||
X = 0.5f;
|
|
||||||
|
Origin = Anchor.TopCentre;
|
||||||
Origin = Anchor.TopCentre;
|
Anchor = Anchor.TopLeft;
|
||||||
Anchor = Anchor.TopLeft;
|
|
||||||
|
Size = new Vector2(CATCHER_SIZE);
|
||||||
Size = new Vector2(CATCHER_SIZE);
|
if (difficulty != null)
|
||||||
if (difficulty != null)
|
Scale = new Vector2(1.0f - 0.7f * (difficulty.CircleSize - 5) / 5);
|
||||||
Scale = new Vector2(1.0f - 0.7f * (difficulty.CircleSize - 5) / 5);
|
}
|
||||||
}
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
[BackgroundDependencyLoader]
|
private void load(TextureStore textures)
|
||||||
private void load(TextureStore textures)
|
{
|
||||||
{
|
texture = textures.Get(@"Play/Catch/fruit-catcher-idle");
|
||||||
texture = textures.Get(@"Play/Catch/fruit-catcher-idle");
|
|
||||||
|
Children = new Drawable[]
|
||||||
Children = new Drawable[]
|
{
|
||||||
{
|
caughtFruit = new Container<DrawableHitObject>
|
||||||
caughtFruit = new Container<DrawableHitObject>
|
{
|
||||||
{
|
Anchor = Anchor.TopCentre,
|
||||||
Anchor = Anchor.TopCentre,
|
Origin = Anchor.BottomCentre,
|
||||||
Origin = Anchor.BottomCentre,
|
},
|
||||||
},
|
createCatcherSprite(),
|
||||||
createCatcherSprite(),
|
};
|
||||||
};
|
}
|
||||||
}
|
|
||||||
|
private int currentDirection;
|
||||||
private int currentDirection;
|
|
||||||
|
private bool dashing;
|
||||||
private bool dashing;
|
|
||||||
|
protected bool Dashing
|
||||||
protected bool Dashing
|
{
|
||||||
{
|
get { return dashing; }
|
||||||
get { return dashing; }
|
set
|
||||||
set
|
{
|
||||||
{
|
if (value == dashing) return;
|
||||||
if (value == dashing) return;
|
|
||||||
|
dashing = value;
|
||||||
dashing = value;
|
|
||||||
|
Trail |= dashing;
|
||||||
Trail |= dashing;
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private bool trail;
|
||||||
private bool trail;
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// Activate or deactive the trail. Will be automatically deactivated when conditions to keep the trail displayed are no longer met.
|
||||||
/// Activate or deactive the trail. Will be automatically deactivated when conditions to keep the trail displayed are no longer met.
|
/// </summary>
|
||||||
/// </summary>
|
protected bool Trail
|
||||||
protected bool Trail
|
{
|
||||||
{
|
get { return trail; }
|
||||||
get { return trail; }
|
set
|
||||||
set
|
{
|
||||||
{
|
if (value == trail) return;
|
||||||
if (value == trail) return;
|
|
||||||
|
trail = value;
|
||||||
trail = value;
|
|
||||||
|
if (Trail)
|
||||||
if (Trail)
|
beginTrail();
|
||||||
beginTrail();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private void beginTrail()
|
||||||
private void beginTrail()
|
{
|
||||||
{
|
Trail &= dashing || HyperDashing;
|
||||||
Trail &= dashing || HyperDashing;
|
Trail &= AdditiveTarget != null;
|
||||||
Trail &= AdditiveTarget != null;
|
|
||||||
|
if (!Trail) return;
|
||||||
if (!Trail) return;
|
|
||||||
|
var additive = createCatcherSprite();
|
||||||
var additive = createCatcherSprite();
|
|
||||||
|
additive.Anchor = Anchor;
|
||||||
additive.Anchor = Anchor;
|
additive.OriginPosition = additive.OriginPosition + new Vector2(DrawWidth / 2, 0); // also temporary to align sprite correctly.
|
||||||
additive.OriginPosition = additive.OriginPosition + new Vector2(DrawWidth / 2, 0); // also temporary to align sprite correctly.
|
additive.Position = Position;
|
||||||
additive.Position = Position;
|
additive.Scale = Scale;
|
||||||
additive.Scale = Scale;
|
additive.Colour = HyperDashing ? Color4.Red : Color4.White;
|
||||||
additive.Colour = HyperDashing ? Color4.Red : Color4.White;
|
additive.RelativePositionAxes = RelativePositionAxes;
|
||||||
additive.RelativePositionAxes = RelativePositionAxes;
|
additive.Blending = BlendingMode.Additive;
|
||||||
additive.Blending = BlendingMode.Additive;
|
|
||||||
|
AdditiveTarget.Add(additive);
|
||||||
AdditiveTarget.Add(additive);
|
|
||||||
|
additive.FadeTo(0.4f).FadeOut(800, Easing.OutQuint).Expire();
|
||||||
additive.FadeTo(0.4f).FadeOut(800, Easing.OutQuint).Expire();
|
|
||||||
|
Scheduler.AddDelayed(beginTrail, HyperDashing ? 25 : 50);
|
||||||
Scheduler.AddDelayed(beginTrail, HyperDashing ? 25 : 50);
|
}
|
||||||
}
|
|
||||||
|
private Sprite createCatcherSprite() => new Sprite
|
||||||
private Sprite createCatcherSprite() => new Sprite
|
{
|
||||||
{
|
Size = new Vector2(CATCHER_SIZE),
|
||||||
Size = new Vector2(CATCHER_SIZE),
|
FillMode = FillMode.Fill,
|
||||||
FillMode = FillMode.Fill,
|
Texture = texture,
|
||||||
Texture = texture,
|
OriginPosition = new Vector2(-3, 10) // temporary until the sprite is aligned correctly.
|
||||||
OriginPosition = new Vector2(-3, 10) // temporary until the sprite is aligned correctly.
|
};
|
||||||
};
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// Add a caught fruit to the catcher's stack.
|
||||||
/// Add a caught fruit to the catcher's stack.
|
/// </summary>
|
||||||
/// </summary>
|
/// <param name="fruit">The fruit that was caught.</param>
|
||||||
/// <param name="fruit">The fruit that was caught.</param>
|
public void Add(DrawableHitObject fruit)
|
||||||
public void Add(DrawableHitObject fruit)
|
{
|
||||||
{
|
float ourRadius = fruit.DrawSize.X / 2 * fruit.Scale.X;
|
||||||
float ourRadius = fruit.DrawSize.X / 2 * fruit.Scale.X;
|
float theirRadius = 0;
|
||||||
float theirRadius = 0;
|
|
||||||
|
const float allowance = 6;
|
||||||
const float allowance = 6;
|
|
||||||
|
while (caughtFruit.Any(f =>
|
||||||
while (caughtFruit.Any(f =>
|
f.LifetimeEnd == double.MaxValue &&
|
||||||
f.LifetimeEnd == double.MaxValue &&
|
Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = f.DrawSize.X / 2 * f.Scale.X)) / (allowance / 2)))
|
||||||
Vector2Extensions.Distance(f.Position, fruit.Position) < (ourRadius + (theirRadius = f.DrawSize.X / 2 * f.Scale.X)) / (allowance / 2)))
|
{
|
||||||
{
|
float diff = (ourRadius + theirRadius) / allowance;
|
||||||
float diff = (ourRadius + theirRadius) / allowance;
|
fruit.X += (RNG.NextSingle() - 0.5f) * 2 * diff;
|
||||||
fruit.X += (RNG.NextSingle() - 0.5f) * 2 * diff;
|
fruit.Y -= RNG.NextSingle() * diff;
|
||||||
fruit.Y -= RNG.NextSingle() * diff;
|
}
|
||||||
}
|
|
||||||
|
fruit.X = MathHelper.Clamp(fruit.X, -CATCHER_SIZE / 2, CATCHER_SIZE / 2);
|
||||||
fruit.X = MathHelper.Clamp(fruit.X, -CATCHER_SIZE / 2, CATCHER_SIZE / 2);
|
|
||||||
|
caughtFruit.Add(fruit);
|
||||||
caughtFruit.Add(fruit);
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// Let the catcher attempt to catch a fruit.
|
||||||
/// Let the catcher attempt to catch a fruit.
|
/// </summary>
|
||||||
/// </summary>
|
/// <param name="fruit">The fruit to catch.</param>
|
||||||
/// <param name="fruit">The fruit to catch.</param>
|
/// <returns>Whether the catch is possible.</returns>
|
||||||
/// <returns>Whether the catch is possible.</returns>
|
public bool AttemptCatch(CatchHitObject fruit)
|
||||||
public bool AttemptCatch(CatchHitObject fruit)
|
{
|
||||||
{
|
double halfCatcherWidth = CATCHER_SIZE * Math.Abs(Scale.X) * 0.5f;
|
||||||
double halfCatcherWidth = CATCHER_SIZE * Math.Abs(Scale.X) * 0.5f;
|
|
||||||
|
// this stuff wil disappear once we move fruit to non-relative coordinate space in the future.
|
||||||
// this stuff wil disappear once we move fruit to non-relative coordinate space in the future.
|
var catchObjectPosition = fruit.X * CatchPlayfield.BASE_WIDTH;
|
||||||
var catchObjectPosition = fruit.X * CatchPlayfield.BASE_WIDTH;
|
var catcherPosition = Position.X * CatchPlayfield.BASE_WIDTH;
|
||||||
var catcherPosition = Position.X * CatchPlayfield.BASE_WIDTH;
|
|
||||||
|
var validCatch =
|
||||||
var validCatch =
|
catchObjectPosition >= catcherPosition - halfCatcherWidth &&
|
||||||
catchObjectPosition >= catcherPosition - halfCatcherWidth &&
|
catchObjectPosition <= catcherPosition + halfCatcherWidth;
|
||||||
catchObjectPosition <= catcherPosition + halfCatcherWidth;
|
|
||||||
|
if (validCatch && fruit.HyperDash)
|
||||||
if (validCatch && fruit.HyperDash)
|
{
|
||||||
{
|
HyperDashModifier = Math.Abs(fruit.HyperDashTarget.X - fruit.X) / Math.Abs(fruit.HyperDashTarget.StartTime - fruit.StartTime) / BASE_SPEED;
|
||||||
HyperDashModifier = Math.Abs(fruit.HyperDashTarget.X - fruit.X) / Math.Abs(fruit.HyperDashTarget.StartTime - fruit.StartTime) / BASE_SPEED;
|
HyperDashDirection = fruit.HyperDashTarget.X - fruit.X;
|
||||||
HyperDashDirection = fruit.HyperDashTarget.X - fruit.X;
|
}
|
||||||
}
|
else
|
||||||
else
|
HyperDashModifier = 1;
|
||||||
HyperDashModifier = 1;
|
|
||||||
|
return validCatch;
|
||||||
return validCatch;
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// Whether we are hypderdashing or not.
|
||||||
/// Whether we are hypderdashing or not.
|
/// </summary>
|
||||||
/// </summary>
|
public bool HyperDashing => hyperDashModifier != 1;
|
||||||
public bool HyperDashing => hyperDashModifier != 1;
|
|
||||||
|
private double hyperDashModifier = 1;
|
||||||
private double hyperDashModifier = 1;
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// The direction in which hyperdash is allowed. 0 allows both directions.
|
||||||
/// The direction in which hyperdash is allowed. 0 allows both directions.
|
/// </summary>
|
||||||
/// </summary>
|
public double HyperDashDirection;
|
||||||
public double HyperDashDirection;
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// The speed modifier resultant from hyperdash. Will trigger hyperdash when not equal to 1.
|
||||||
/// The speed modifier resultant from hyperdash. Will trigger hyperdash when not equal to 1.
|
/// </summary>
|
||||||
/// </summary>
|
public double HyperDashModifier
|
||||||
public double HyperDashModifier
|
{
|
||||||
{
|
get { return hyperDashModifier; }
|
||||||
get { return hyperDashModifier; }
|
set
|
||||||
set
|
{
|
||||||
{
|
if (value == hyperDashModifier) return;
|
||||||
if (value == hyperDashModifier) return;
|
hyperDashModifier = value;
|
||||||
hyperDashModifier = value;
|
|
||||||
|
const float transition_length = 180;
|
||||||
const float transition_length = 180;
|
|
||||||
|
if (HyperDashing)
|
||||||
if (HyperDashing)
|
{
|
||||||
{
|
this.FadeColour(Color4.OrangeRed, transition_length, Easing.OutQuint);
|
||||||
this.FadeColour(Color4.OrangeRed, transition_length, Easing.OutQuint);
|
this.FadeTo(0.2f, transition_length, Easing.OutQuint);
|
||||||
this.FadeTo(0.2f, transition_length, Easing.OutQuint);
|
Trail = true;
|
||||||
Trail = true;
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
HyperDashDirection = 0;
|
||||||
HyperDashDirection = 0;
|
this.FadeColour(Color4.White, transition_length, Easing.OutQuint);
|
||||||
this.FadeColour(Color4.White, transition_length, Easing.OutQuint);
|
this.FadeTo(1, transition_length, Easing.OutQuint);
|
||||||
this.FadeTo(1, transition_length, Easing.OutQuint);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public bool OnPressed(CatchAction action)
|
||||||
public bool OnPressed(CatchAction action)
|
{
|
||||||
{
|
switch (action)
|
||||||
switch (action)
|
{
|
||||||
{
|
case CatchAction.MoveLeft:
|
||||||
case CatchAction.MoveLeft:
|
currentDirection--;
|
||||||
currentDirection--;
|
return true;
|
||||||
return true;
|
case CatchAction.MoveRight:
|
||||||
case CatchAction.MoveRight:
|
currentDirection++;
|
||||||
currentDirection++;
|
return true;
|
||||||
return true;
|
case CatchAction.Dash:
|
||||||
case CatchAction.Dash:
|
Dashing = true;
|
||||||
Dashing = true;
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
|
public bool OnReleased(CatchAction action)
|
||||||
public bool OnReleased(CatchAction action)
|
{
|
||||||
{
|
switch (action)
|
||||||
switch (action)
|
{
|
||||||
{
|
case CatchAction.MoveLeft:
|
||||||
case CatchAction.MoveLeft:
|
currentDirection++;
|
||||||
currentDirection++;
|
return true;
|
||||||
return true;
|
case CatchAction.MoveRight:
|
||||||
case CatchAction.MoveRight:
|
currentDirection--;
|
||||||
currentDirection--;
|
return true;
|
||||||
return true;
|
case CatchAction.Dash:
|
||||||
case CatchAction.Dash:
|
Dashing = false;
|
||||||
Dashing = false;
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// The relative space to cover in 1 millisecond. based on 1 game pixel per millisecond as in osu-stable.
|
||||||
/// The relative space to cover in 1 millisecond. based on 1 game pixel per millisecond as in osu-stable.
|
/// </summary>
|
||||||
/// </summary>
|
public const double BASE_SPEED = 1.0 / 512;
|
||||||
public const double BASE_SPEED = 1.0 / 512;
|
|
||||||
|
protected override void Update()
|
||||||
protected override void Update()
|
{
|
||||||
{
|
base.Update();
|
||||||
base.Update();
|
|
||||||
|
if (currentDirection == 0) return;
|
||||||
if (currentDirection == 0) return;
|
|
||||||
|
var direction = Math.Sign(currentDirection);
|
||||||
var direction = Math.Sign(currentDirection);
|
|
||||||
|
double dashModifier = Dashing ? 1 : 0.5;
|
||||||
double dashModifier = Dashing ? 1 : 0.5;
|
|
||||||
|
if (hyperDashModifier != 1 && (HyperDashDirection == 0 || direction == Math.Sign(HyperDashDirection)))
|
||||||
if (hyperDashModifier != 1 && (HyperDashDirection == 0 || direction == Math.Sign(HyperDashDirection)))
|
dashModifier = hyperDashModifier;
|
||||||
dashModifier = hyperDashModifier;
|
|
||||||
|
Scale = new Vector2(Math.Abs(Scale.X) * direction, Scale.Y);
|
||||||
Scale = new Vector2(Math.Abs(Scale.X) * direction, Scale.Y);
|
X = (float)MathHelper.Clamp(X + direction * Clock.ElapsedFrameTime * BASE_SPEED * dashModifier, 0, 1);
|
||||||
X = (float)MathHelper.Clamp(X + direction * Clock.ElapsedFrameTime * BASE_SPEED * dashModifier, 0, 1);
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// Drop any fruit off the plate.
|
||||||
/// Drop any fruit off the plate.
|
/// </summary>
|
||||||
/// </summary>
|
public void Drop()
|
||||||
public void Drop()
|
{
|
||||||
{
|
var fruit = caughtFruit.ToArray();
|
||||||
var fruit = caughtFruit.ToArray();
|
|
||||||
|
foreach (var f in fruit)
|
||||||
foreach (var f in fruit)
|
{
|
||||||
{
|
if (ExplodingFruitTarget != null)
|
||||||
if (ExplodingFruitTarget != null)
|
{
|
||||||
{
|
f.Anchor = Anchor.TopLeft;
|
||||||
f.Anchor = Anchor.TopLeft;
|
f.Position = caughtFruit.ToSpaceOfOtherDrawable(f.DrawPosition, ExplodingFruitTarget);
|
||||||
f.Position = caughtFruit.ToSpaceOfOtherDrawable(f.DrawPosition, ExplodingFruitTarget);
|
|
||||||
|
caughtFruit.Remove(f);
|
||||||
caughtFruit.Remove(f);
|
|
||||||
|
ExplodingFruitTarget.Add(f);
|
||||||
ExplodingFruitTarget.Add(f);
|
}
|
||||||
}
|
|
||||||
|
f.MoveToY(f.Y + 75, 750, Easing.InSine);
|
||||||
f.MoveToY(f.Y + 75, 750, Easing.InSine);
|
f.FadeOut(750);
|
||||||
f.FadeOut(750);
|
f.Expire();
|
||||||
f.Expire();
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
/// <summary>
|
||||||
/// <summary>
|
/// Explode any fruit off the plate.
|
||||||
/// Explode any fruit off the plate.
|
/// </summary>
|
||||||
/// </summary>
|
public void Explode()
|
||||||
public void Explode()
|
{
|
||||||
{
|
var fruit = caughtFruit.ToArray();
|
||||||
var fruit = caughtFruit.ToArray();
|
|
||||||
|
foreach (var f in fruit)
|
||||||
foreach (var f in fruit)
|
{
|
||||||
{
|
var originalX = f.X * Scale.X;
|
||||||
var originalX = f.X * Scale.X;
|
|
||||||
|
if (ExplodingFruitTarget != null)
|
||||||
if (ExplodingFruitTarget != null)
|
{
|
||||||
{
|
f.Anchor = Anchor.TopLeft;
|
||||||
f.Anchor = Anchor.TopLeft;
|
f.Position = caughtFruit.ToSpaceOfOtherDrawable(f.DrawPosition, ExplodingFruitTarget);
|
||||||
f.Position = caughtFruit.ToSpaceOfOtherDrawable(f.DrawPosition, ExplodingFruitTarget);
|
|
||||||
|
caughtFruit.Remove(f);
|
||||||
caughtFruit.Remove(f);
|
|
||||||
|
ExplodingFruitTarget.Add(f);
|
||||||
ExplodingFruitTarget.Add(f);
|
}
|
||||||
}
|
|
||||||
|
f.MoveToY(f.Y - 50, 250, Easing.OutSine)
|
||||||
f.MoveToY(f.Y - 50, 250, Easing.OutSine)
|
.Then()
|
||||||
.Then()
|
.MoveToY(f.Y + 50, 500, Easing.InSine);
|
||||||
.MoveToY(f.Y + 50, 500, Easing.InSine);
|
|
||||||
|
f.MoveToX(f.X + originalX * 6, 1000);
|
||||||
f.MoveToX(f.X + originalX * 6, 1000);
|
f.FadeOut(750);
|
||||||
f.FadeOut(750);
|
|
||||||
|
f.Expire();
|
||||||
f.Expire();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<configuration>
|
|
||||||
<runtime>
|
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="SharpCompress" publicKeyToken="afb0a02973931d96" culture="neutral" />
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-0.18.1.0" newVersion="0.18.1.0" />
|
|
||||||
</dependentAssembly>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral"/>
|
|
||||||
<bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0"/>
|
|
||||||
</dependentAssembly>
|
|
||||||
</assemblyBinding>
|
|
||||||
</runtime>
|
|
||||||
</configuration>
|
|
@ -1,148 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Import Project="..\osu.Game.props" />
|
||||||
<Import Project="..\osu.Game.props" />
|
<PropertyGroup Label="Project">
|
||||||
<PropertyGroup>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<OutputType>Library</OutputType>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
<ProjectGuid>{58F6C80C-1253-4A0E-A465-B8C85EBEADF3}</ProjectGuid>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<OutputType>Library</OutputType>
|
<Description>catch the fruit. to the beat.</Description>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
</PropertyGroup>
|
||||||
<RootNamespace>osu.Game.Rulesets.Catch</RootNamespace>
|
<ItemGroup Label="Project References">
|
||||||
<AssemblyName>osu.Game.Rulesets.Catch</AssemblyName>
|
<ProjectReference Include="..\osu.Game\osu.Game.csproj" />
|
||||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
</ItemGroup>
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
|
||||||
</PropertyGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="JetBrains.Annotations, Version=11.1.0.0, Culture=neutral, PublicKeyToken=1010a0d8d6380325, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\JetBrains.Annotations.11.1.0\lib\net20\JetBrains.Annotations.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="nunit.framework, Version=3.8.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\NUnit.3.8.1\lib\net45\nunit.framework.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="OpenTK, Version=3.0.0.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4">
|
|
||||||
<HintPath>$(SolutionDir)\packages\ppy.OpenTK.3.0.13\lib\net45\OpenTK.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.batteries_green, Version=1.0.0.0, Culture=neutral, PublicKeyToken=a84b7dcfb1391f7f, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_green.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.batteries_v2, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8226ea5df37bcae9, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.bundle_green.1.1.8\lib\net45\SQLitePCLRaw.batteries_v2.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1488e028ca7ab535, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.core.1.1.8\lib\net45\SQLitePCLRaw.core.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="SQLitePCLRaw.provider.e_sqlite3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9c301db686d0bd12, processorArchitecture=MSIL">
|
|
||||||
<HintPath>$(SolutionDir)\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.8\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Collections" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="Beatmaps\CatchBeatmapConverter.cs" />
|
|
||||||
<Compile Include="Beatmaps\CatchBeatmapProcessor.cs" />
|
|
||||||
<Compile Include="CatchDifficultyCalculator.cs" />
|
|
||||||
<Compile Include="CatchInputManager.cs" />
|
|
||||||
<Compile Include="Mods\CatchModDaycore.cs" />
|
|
||||||
<Compile Include="Mods\CatchModDoubleTime.cs" />
|
|
||||||
<Compile Include="Mods\CatchModEasy.cs" />
|
|
||||||
<Compile Include="Mods\CatchModFlashlight.cs" />
|
|
||||||
<Compile Include="Mods\CatchModHalfTime.cs" />
|
|
||||||
<Compile Include="Mods\CatchModHardRock.cs" />
|
|
||||||
<Compile Include="Mods\CatchModHidden.cs" />
|
|
||||||
<Compile Include="Mods\CatchModNightcore.cs" />
|
|
||||||
<Compile Include="Mods\CatchModPerfect.cs" />
|
|
||||||
<Compile Include="Mods\CatchModRelax.cs" />
|
|
||||||
<Compile Include="Mods\CatchModSuddenDeath.cs" />
|
|
||||||
<Compile Include="Mods\CatchModAutoplay.cs" />
|
|
||||||
<Compile Include="Objects\BananaShower.cs" />
|
|
||||||
<Compile Include="Objects\Drawable\DrawableBananaShower.cs" />
|
|
||||||
<Compile Include="Objects\Drawable\DrawableCatchHitObject.cs" />
|
|
||||||
<Compile Include="Objects\Drawable\DrawableDroplet.cs" />
|
|
||||||
<Compile Include="Objects\Drawable\DrawableJuiceStream.cs" />
|
|
||||||
<Compile Include="Objects\Drawable\Pieces\Pulp.cs" />
|
|
||||||
<Compile Include="Objects\JuiceStream.cs" />
|
|
||||||
<Compile Include="Replays\CatchAutoGenerator.cs" />
|
|
||||||
<Compile Include="Replays\CatchFramedReplayInputHandler.cs" />
|
|
||||||
<Compile Include="Replays\CatchReplayFrame.cs" />
|
|
||||||
<Compile Include="Scoring\CatchScoreProcessor.cs" />
|
|
||||||
<Compile Include="Judgements\CatchJudgement.cs" />
|
|
||||||
<Compile Include="Objects\CatchHitObject.cs" />
|
|
||||||
<Compile Include="Objects\Drawable\DrawableFruit.cs" />
|
|
||||||
<Compile Include="Objects\Droplet.cs" />
|
|
||||||
<Compile Include="Objects\Fruit.cs" />
|
|
||||||
<Compile Include="Objects\TinyDroplet.cs" />
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
|
||||||
<Compile Include="Tests\CatchBeatmapConversionTest.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseBananaShower.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseCatcherArea.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseCatchStacker.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseFruitObjects.cs" />
|
|
||||||
<Compile Include="Tests\TestCasePerformancePoints.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseCatchPlayer.cs" />
|
|
||||||
<Compile Include="Tests\TestCaseHyperdash.cs" />
|
|
||||||
<Compile Include="UI\CatcherArea.cs" />
|
|
||||||
<Compile Include="UI\CatchRulesetContainer.cs" />
|
|
||||||
<Compile Include="UI\CatchPlayfield.cs" />
|
|
||||||
<Compile Include="CatchRuleset.cs" />
|
|
||||||
<Compile Include="Mods\CatchModNoFail.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="app.config" />
|
|
||||||
<None Include="OpenTK.dll.config" />
|
|
||||||
<None Include="packages.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\osu-framework\osu.Framework\osu.Framework.csproj">
|
|
||||||
<Project>{C76BF5B3-985E-4D39-95FE-97C9C879B83A}</Project>
|
|
||||||
<Name>osu.Framework</Name>
|
|
||||||
<Private>True</Private>
|
|
||||||
</ProjectReference>
|
|
||||||
<ProjectReference Include="..\osu.Game\osu.Game.csproj">
|
|
||||||
<Project>{2a66dd92-adb1-4994-89e2-c94e04acda0d}</Project>
|
|
||||||
<Name>osu.Game</Name>
|
|
||||||
<Private>True</Private>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="Resources\Testing\Beatmaps\basic-expected-conversion.json" />
|
|
||||||
<EmbeddedResource Include="Resources\Testing\Beatmaps\basic.osu" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.linux.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.linux.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets'))" />
|
|
||||||
<Error Condition="!Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.osx.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.osx.targets')" />
|
|
||||||
<Import Project="$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets" Condition="Exists('$(SolutionDir)\packages\SQLitePCLRaw.lib.e_sqlite3.v110_xp.1.1.8\build\net35\SQLitePCLRaw.lib.e_sqlite3.v110_xp.targets')" />
|
|
||||||
</Project>
|
</Project>
|
@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="JetBrains.Annotations" version="11.1.0" targetFramework="net461" />
|
|
||||||
<package id="NUnit" version="3.8.1" targetFramework="net461" />
|
|
||||||
<package id="ppy.OpenTK" version="3.0.13" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.bundle_green" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.core" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.lib.e_sqlite3.linux" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.lib.e_sqlite3.osx" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.lib.e_sqlite3.v110_xp" version="1.1.8" targetFramework="net461" />
|
|
||||||
<package id="SQLitePCLRaw.provider.e_sqlite3.net45" version="1.1.8" targetFramework="net461" />
|
|
||||||
</packages>
|
|
59
osu.Game.Rulesets.Mania.Tests/.vscode/launch.json
vendored
Normal file
59
osu.Game.Rulesets.Mania.Tests/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Debug, net471)",
|
||||||
|
"windows": {
|
||||||
|
"type": "clr"
|
||||||
|
},
|
||||||
|
"type": "mono",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Mania.Tests.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Release, net471)",
|
||||||
|
"windows": {
|
||||||
|
"type": "clr"
|
||||||
|
},
|
||||||
|
"type": "mono",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/bin/Debug/net471/osu.Game.Rulesets.Mania.Tests.exe",
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release, msbuild)",
|
||||||
|
"runtimeExecutable": null,
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Debug, netcoreapp2.0)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Mania.Tests.dll"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Debug, dotnet)",
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VisualTests (Release, netcoreapp2.0)",
|
||||||
|
"type": "coreclr",
|
||||||
|
"request": "launch",
|
||||||
|
"program": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"${workspaceRoot}/bin/Debug/netcoreapp2.0/osu.Game.Rulesets.Mania.Tests.dll"
|
||||||
|
],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"preLaunchTask": "Build (Release, dotnet)",
|
||||||
|
"env": {},
|
||||||
|
"console": "internalConsole"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
87
osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json
vendored
Normal file
87
osu.Game.Rulesets.Mania.Tests/.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build (Debug, msbuild)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "msbuild",
|
||||||
|
"args": [
|
||||||
|
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||||
|
"/p:TargetFramework=net471",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Release, msbuild)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "msbuild",
|
||||||
|
"args": [
|
||||||
|
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||||
|
"/p:Configuration=Release",
|
||||||
|
"/p:TargetFramework=net471",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Debug, dotnet)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||||
|
"/p:TargetFramework=netcoreapp2.0",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Build (Release, dotnet)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"build",
|
||||||
|
"--no-restore",
|
||||||
|
"osu.Game.Rulesets.Mania.Tests.csproj",
|
||||||
|
"/p:TargetFramework=netcoreapp2.0",
|
||||||
|
"/p:Configuration=Release",
|
||||||
|
"/p:GenerateFullPaths=true",
|
||||||
|
"/m",
|
||||||
|
"/verbosity:m"
|
||||||
|
],
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": "$msCompile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Restore (net471)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "nuget",
|
||||||
|
"args": [
|
||||||
|
"restore"
|
||||||
|
],
|
||||||
|
"problemMatcher": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Restore (netcoreapp2.0)",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "dotnet",
|
||||||
|
"args": [
|
||||||
|
"restore"
|
||||||
|
],
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -1,60 +1,60 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.MathUtils;
|
using osu.Framework.MathUtils;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osu.Game.Tests.Beatmaps;
|
using osu.Game.Tests.Beatmaps;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Tests
|
namespace osu.Game.Rulesets.Mania.Tests
|
||||||
{
|
{
|
||||||
public class ManiaBeatmapConversionTest : BeatmapConversionTest<ConvertValue>
|
public class ManiaBeatmapConversionTest : BeatmapConversionTest<ConvertValue>
|
||||||
{
|
{
|
||||||
protected override string ResourceAssembly => "osu.Game.Rulesets.Mania";
|
protected override string ResourceAssembly => "osu.Game.Rulesets.Mania";
|
||||||
|
|
||||||
private bool isForCurrentRuleset;
|
private bool isForCurrentRuleset;
|
||||||
|
|
||||||
[NonParallelizable]
|
[NonParallelizable]
|
||||||
[TestCase("basic", false), Ignore("See: https://github.com/ppy/osu/issues/2150")]
|
[TestCase("basic", false)]
|
||||||
public void Test(string name, bool isForCurrentRuleset)
|
public void Test(string name, bool isForCurrentRuleset)
|
||||||
{
|
{
|
||||||
this.isForCurrentRuleset = isForCurrentRuleset;
|
this.isForCurrentRuleset = isForCurrentRuleset;
|
||||||
base.Test(name);
|
base.Test(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
|
||||||
{
|
{
|
||||||
yield return new ConvertValue
|
yield return new ConvertValue
|
||||||
{
|
{
|
||||||
StartTime = hitObject.StartTime,
|
StartTime = hitObject.StartTime,
|
||||||
EndTime = (hitObject as IHasEndTime)?.EndTime ?? hitObject.StartTime,
|
EndTime = (hitObject as IHasEndTime)?.EndTime ?? hitObject.StartTime,
|
||||||
Column = ((ManiaHitObject)hitObject).Column
|
Column = ((ManiaHitObject)hitObject).Column
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override IBeatmapConverter CreateConverter(Beatmap beatmap) => new ManiaBeatmapConverter(isForCurrentRuleset, beatmap);
|
protected override IBeatmapConverter CreateConverter(Beatmap beatmap) => new ManiaBeatmapConverter(isForCurrentRuleset, beatmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct ConvertValue : IEquatable<ConvertValue>
|
public struct ConvertValue : IEquatable<ConvertValue>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A sane value to account for osu!stable using ints everwhere.
|
/// A sane value to account for osu!stable using ints everwhere.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private const float conversion_lenience = 2;
|
private const float conversion_lenience = 2;
|
||||||
|
|
||||||
public double StartTime;
|
public double StartTime;
|
||||||
public double EndTime;
|
public double EndTime;
|
||||||
public int Column;
|
public int Column;
|
||||||
|
|
||||||
public bool Equals(ConvertValue other)
|
public bool Equals(ConvertValue other)
|
||||||
=> Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience)
|
=> Precision.AlmostEquals(StartTime, other.StartTime, conversion_lenience)
|
||||||
&& Precision.AlmostEquals(EndTime, other.EndTime, conversion_lenience)
|
&& Precision.AlmostEquals(EndTime, other.EndTime, conversion_lenience)
|
||||||
&& Column == other.Column;
|
&& Column == other.Column;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,179 +1,179 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Game.Rulesets.Mania.Beatmaps;
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Mania.Replays;
|
using osu.Game.Rulesets.Mania.Replays;
|
||||||
using osu.Game.Rulesets.Replays;
|
using osu.Game.Rulesets.Replays;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Tests
|
namespace osu.Game.Rulesets.Mania.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseAutoGeneration : OsuTestCase
|
public class TestCaseAutoGeneration : OsuTestCase
|
||||||
{
|
{
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSingleNote()
|
public void TestSingleNote()
|
||||||
{
|
{
|
||||||
// | |
|
// | |
|
||||||
// | - |
|
// | - |
|
||||||
// | |
|
// | |
|
||||||
|
|
||||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 1 });
|
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 1 });
|
||||||
beatmap.HitObjects.Add(new Note { StartTime = 1000 });
|
beatmap.HitObjects.Add(new Note { StartTime = 1000 });
|
||||||
|
|
||||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||||
|
|
||||||
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
||||||
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
||||||
Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Special1), "Special1 has not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Special1), "Special1 has not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Special1), "Special1 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Special1), "Special1 has not been released");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSingleHoldNote()
|
public void TestSingleHoldNote()
|
||||||
{
|
{
|
||||||
// | |
|
// | |
|
||||||
// | * |
|
// | * |
|
||||||
// | * |
|
// | * |
|
||||||
// | * |
|
// | * |
|
||||||
// | |
|
// | |
|
||||||
|
|
||||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 1 });
|
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 1 });
|
||||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 });
|
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 });
|
||||||
|
|
||||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||||
|
|
||||||
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
||||||
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
||||||
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Special1), "Special1 has not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Special1), "Special1 has not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Special1), "Special1 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Special1), "Special1 has not been released");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSingleNoteChord()
|
public void TestSingleNoteChord()
|
||||||
{
|
{
|
||||||
// | | |
|
// | | |
|
||||||
// | - | - |
|
// | - | - |
|
||||||
// | | |
|
// | | |
|
||||||
|
|
||||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
||||||
beatmap.HitObjects.Add(new Note { StartTime = 1000 });
|
beatmap.HitObjects.Add(new Note { StartTime = 1000 });
|
||||||
beatmap.HitObjects.Add(new Note { StartTime = 1000, Column = 1 });
|
beatmap.HitObjects.Add(new Note { StartTime = 1000, Column = 1 });
|
||||||
|
|
||||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||||
|
|
||||||
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
||||||
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
||||||
Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
|
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestHoldNoteChord()
|
public void TestHoldNoteChord()
|
||||||
{
|
{
|
||||||
// | | |
|
// | | |
|
||||||
// | * | * |
|
// | * | * |
|
||||||
// | * | * |
|
// | * | * |
|
||||||
// | * | * |
|
// | * | * |
|
||||||
// | | |
|
// | | |
|
||||||
|
|
||||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
||||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 });
|
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 });
|
||||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000, Column = 1 });
|
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000, Column = 1 });
|
||||||
|
|
||||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||||
|
|
||||||
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
Assert.IsTrue(generated.Frames.Count == 3, "Replay must have 3 frames");
|
||||||
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect hit time");
|
||||||
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect release time");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
|
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been released");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestSingleNoteStair()
|
public void TestSingleNoteStair()
|
||||||
{
|
{
|
||||||
// | | |
|
// | | |
|
||||||
// | | - |
|
// | | - |
|
||||||
// | - | |
|
// | - | |
|
||||||
// | | |
|
// | | |
|
||||||
|
|
||||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
||||||
beatmap.HitObjects.Add(new Note { StartTime = 1000 });
|
beatmap.HitObjects.Add(new Note { StartTime = 1000 });
|
||||||
beatmap.HitObjects.Add(new Note { StartTime = 2000, Column = 1 });
|
beatmap.HitObjects.Add(new Note { StartTime = 2000, Column = 1 });
|
||||||
|
|
||||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||||
|
|
||||||
Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames");
|
Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames");
|
||||||
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
|
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
|
||||||
Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect first note release time");
|
Assert.AreEqual(1000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[2].Time, "Incorrect first note release time");
|
||||||
Assert.AreEqual(2000, generated.Frames[3].Time, "Incorrect second note hit time");
|
Assert.AreEqual(2000, generated.Frames[3].Time, "Incorrect second note hit time");
|
||||||
Assert.AreEqual(2000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time");
|
Assert.AreEqual(2000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1), "Key1 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1), "Key1 has not been released");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[4], ManiaAction.Key2), "Key2 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[4], ManiaAction.Key2), "Key2 has not been released");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestHoldNoteStair()
|
public void TestHoldNoteStair()
|
||||||
{
|
{
|
||||||
// | | |
|
// | | |
|
||||||
// | | * |
|
// | | * |
|
||||||
// | * | * |
|
// | * | * |
|
||||||
// | * | * |
|
// | * | * |
|
||||||
// | * | |
|
// | * | |
|
||||||
// | | |
|
// | | |
|
||||||
|
|
||||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
||||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 });
|
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 });
|
||||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 2000, Duration = 2000, Column = 1 });
|
beatmap.HitObjects.Add(new HoldNote { StartTime = 2000, Duration = 2000, Column = 1 });
|
||||||
|
|
||||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||||
|
|
||||||
Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames");
|
Assert.IsTrue(generated.Frames.Count == 5, "Replay must have 5 frames");
|
||||||
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
|
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
|
||||||
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect first note release time");
|
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect first note release time");
|
||||||
Assert.AreEqual(2000, generated.Frames[2].Time, "Incorrect second note hit time");
|
Assert.AreEqual(2000, generated.Frames[2].Time, "Incorrect second note hit time");
|
||||||
Assert.AreEqual(4000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time");
|
Assert.AreEqual(4000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[4].Time, "Incorrect second note release time");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[2], ManiaAction.Key1, ManiaAction.Key2), "Key1 & Key2 have not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[3], ManiaAction.Key1), "Key1 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[3], ManiaAction.Key1), "Key1 has not been released");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has been released");
|
Assert.IsTrue(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has been released");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[4], ManiaAction.Key2), "Key2 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[4], ManiaAction.Key2), "Key2 has not been released");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestHoldNoteWithReleasePress()
|
public void TestHoldNoteWithReleasePress()
|
||||||
{
|
{
|
||||||
// | | |
|
// | | |
|
||||||
// | * | - |
|
// | * | - |
|
||||||
// | * | |
|
// | * | |
|
||||||
// | * | |
|
// | * | |
|
||||||
// | | |
|
// | | |
|
||||||
|
|
||||||
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
var beatmap = new ManiaBeatmap(new StageDefinition { Columns = 2 });
|
||||||
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 - ManiaAutoGenerator.RELEASE_DELAY });
|
beatmap.HitObjects.Add(new HoldNote { StartTime = 1000, Duration = 2000 - ManiaAutoGenerator.RELEASE_DELAY });
|
||||||
beatmap.HitObjects.Add(new Note { StartTime = 3000, Column = 1 });
|
beatmap.HitObjects.Add(new Note { StartTime = 3000, Column = 1 });
|
||||||
|
|
||||||
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
var generated = new ManiaAutoGenerator(beatmap).Generate();
|
||||||
|
|
||||||
Assert.IsTrue(generated.Frames.Count == 4, "Replay must have 4 frames");
|
Assert.IsTrue(generated.Frames.Count == 4, "Replay must have 4 frames");
|
||||||
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
|
Assert.AreEqual(1000, generated.Frames[1].Time, "Incorrect first note hit time");
|
||||||
Assert.AreEqual(3000, generated.Frames[2].Time, "Incorrect second note press time + first note release time");
|
Assert.AreEqual(3000, generated.Frames[2].Time, "Incorrect second note press time + first note release time");
|
||||||
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect second note release time");
|
Assert.AreEqual(3000 + ManiaAutoGenerator.RELEASE_DELAY, generated.Frames[3].Time, "Incorrect second note release time");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[1], ManiaAction.Key1), "Key1 has not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1), "Key1 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[2], ManiaAction.Key1), "Key1 has not been released");
|
||||||
Assert.IsTrue(checkContains(generated.Frames[2], ManiaAction.Key2), "Key2 has not been pressed");
|
Assert.IsTrue(checkContains(generated.Frames[2], ManiaAction.Key2), "Key2 has not been pressed");
|
||||||
Assert.IsFalse(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has not been released");
|
Assert.IsFalse(checkContains(generated.Frames[3], ManiaAction.Key2), "Key2 has not been released");
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool checkContains(ReplayFrame frame, params ManiaAction[] actions) => actions.All(action => ((ManiaReplayFrame)frame).Actions.Contains(action));
|
private bool checkContains(ReplayFrame frame, params ManiaAction[] actions) => actions.All(action => ((ManiaReplayFrame)frame).Actions.Contains(action));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,96 +1,96 @@
|
|||||||
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
||||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||||
|
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Game.Rulesets.Mania.Objects;
|
using osu.Game.Rulesets.Mania.Objects;
|
||||||
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
using osu.Game.Rulesets.Mania.Objects.Drawables;
|
||||||
using osu.Game.Tests.Visual;
|
using osu.Game.Tests.Visual;
|
||||||
using OpenTK;
|
using OpenTK;
|
||||||
using OpenTK.Graphics;
|
using OpenTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mania.Tests
|
namespace osu.Game.Rulesets.Mania.Tests
|
||||||
{
|
{
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class TestCaseManiaHitObjects : OsuTestCase
|
public class TestCaseManiaHitObjects : OsuTestCase
|
||||||
{
|
{
|
||||||
public TestCaseManiaHitObjects()
|
public TestCaseManiaHitObjects()
|
||||||
{
|
{
|
||||||
Add(new FillFlowContainer
|
Add(new FillFlowContainer
|
||||||
{
|
{
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Direction = FillDirection.Horizontal,
|
Direction = FillDirection.Horizontal,
|
||||||
Spacing = new Vector2(10, 0),
|
Spacing = new Vector2(10, 0),
|
||||||
// Imagine that the containers containing the drawable notes are the "columns"
|
// Imagine that the containers containing the drawable notes are the "columns"
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Normal note column",
|
Name = "Normal note column",
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = 50,
|
Width = 50,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Timing section",
|
Name = "Timing section",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
RelativeChildSize = new Vector2(1, 10000),
|
RelativeChildSize = new Vector2(1, 10000),
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new DrawableNote(new Note(), ManiaAction.Key1)
|
new DrawableNote(new Note(), ManiaAction.Key1)
|
||||||
{
|
{
|
||||||
Y = 5000,
|
Y = 5000,
|
||||||
LifetimeStart = double.MinValue,
|
LifetimeStart = double.MinValue,
|
||||||
LifetimeEnd = double.MaxValue,
|
LifetimeEnd = double.MaxValue,
|
||||||
AccentColour = Color4.Red
|
AccentColour = Color4.Red
|
||||||
},
|
},
|
||||||
new DrawableNote(new Note(), ManiaAction.Key1)
|
new DrawableNote(new Note(), ManiaAction.Key1)
|
||||||
{
|
{
|
||||||
Y = 6000,
|
Y = 6000,
|
||||||
LifetimeStart = double.MinValue,
|
LifetimeStart = double.MinValue,
|
||||||
LifetimeEnd = double.MaxValue,
|
LifetimeEnd = double.MaxValue,
|
||||||
AccentColour = Color4.Red
|
AccentColour = Color4.Red
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Hold note column",
|
Name = "Hold note column",
|
||||||
Anchor = Anchor.Centre,
|
Anchor = Anchor.Centre,
|
||||||
Origin = Anchor.Centre,
|
Origin = Anchor.Centre,
|
||||||
RelativeSizeAxes = Axes.Y,
|
RelativeSizeAxes = Axes.Y,
|
||||||
Width = 50,
|
Width = 50,
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new Container
|
new Container
|
||||||
{
|
{
|
||||||
Name = "Timing section",
|
Name = "Timing section",
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
RelativeChildSize = new Vector2(1, 10000),
|
RelativeChildSize = new Vector2(1, 10000),
|
||||||
Children = new[]
|
Children = new[]
|
||||||
{
|
{
|
||||||
new DrawableHoldNote(new HoldNote { Duration = 1000 } , ManiaAction.Key1)
|
new DrawableHoldNote(new HoldNote { Duration = 1000 } , ManiaAction.Key1)
|
||||||
{
|
{
|
||||||
Y = 5000,
|
Y = 5000,
|
||||||
Height = 1000,
|
Height = 1000,
|
||||||
LifetimeStart = double.MinValue,
|
LifetimeStart = double.MinValue,
|
||||||
LifetimeEnd = double.MaxValue,
|
LifetimeEnd = double.MaxValue,
|
||||||
AccentColour = Color4.Red
|
AccentColour = Color4.Red
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user