├── .editorconfig
├── .github
└── workflows
│ ├── pr.yml
│ ├── pr_by_comment.yml
│ └── publish.yml
├── .gitignore
├── .nuke
├── build.schema.json
└── parameters.json
├── GitVersion.yml
├── LICENSE
├── NuGet.Config
├── README.md
├── SongChartVisualizer.sln
├── build.cmd
├── build.ps1
├── build.sh
├── build
├── .editorconfig
├── Build.CI.GitHubActions.cs
├── Build.cs
├── Configuration.cs
├── Directory.Build.props
├── Directory.Build.targets
├── _build.csproj
└── _build.csproj.DotSettings
└── source
└── SongChartVisualizer
├── Core
└── WindowGraph.cs
├── Directory.Build.props
├── Installers
├── ScvAppInstaller.cs
├── SvcGameInstaller.cs
└── SvcMenuInstaller.cs
├── Models
└── NpsInfo.cs
├── Plugin.cs
├── PluginConfig.cs
├── Services
└── ScvAssetLoader.cs
├── SongChartVisualizer.csproj
├── UI
├── SettingsControllerManager.cs
├── ViewControllers
│ ├── ChartViewController.cs
│ └── SettingsController.cs
├── Views
│ ├── ChartView.bsml
│ └── settings.bsml
└── linegraph
└── manifest.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = tab
6 | indent_size = tab
7 | tab_width = 4
8 | end_of_line = lf
9 | trim_trailing_whitespace = true
10 | charset = utf-8
11 | max_line_length = 200
12 | insert_final_newline = false
13 |
14 | # ReSharper properties
15 | resharper_csharp_indent_style = tab
16 | resharper_csharp_max_line_length = 200
17 | resharper_html_indent_style = tab
18 | resharper_html_max_line_length = 200
19 | resharper_resx_indent_style = tab
20 | resharper_resx_max_line_length = 200
21 | resharper_use_indent_from_vs = false
22 | resharper_vb_indent_style = tab
23 | resharper_vb_max_line_length = 200
24 | resharper_xmldoc_indent_style = tab
25 | resharper_xmldoc_max_line_length = 200
26 | resharper_xml_indent_style = tab
27 | resharper_xml_max_line_length = 200
28 |
29 | # ReSharper inspection severities
30 | resharper_web_config_module_not_resolved_highlighting = warning
31 | resharper_web_config_type_not_resolved_highlighting = warning
32 | resharper_web_config_wrong_module_highlighting = warning
33 |
34 | # Organize usings
35 | dotnet_sort_system_directives_first = true
36 | dotnet_separate_import_directive_groups = false
37 |
38 | # this. preferences
39 | dotnet_style_qualification_for_field = false:warning
40 | dotnet_style_qualification_for_property = false:warning
41 | dotnet_style_qualification_for_method = false:warning
42 | dotnet_style_qualification_for_event = false:warning
43 |
44 | # Language keywords vs BCL types preferences
45 | dotnet_style_predefined_type_for_locals_parameters_members = true:warning
46 | dotnet_style_predefined_type_for_member_access = true:warning
47 |
48 | # Parentheses preferences
49 | dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:silent
50 | dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:silent
51 | dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:silent
52 | dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
53 |
54 | # Modifier preferences
55 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning
56 | dotnet_style_readonly_field = true:suggestion
57 |
58 | # Expression-level preferences
59 | dotnet_style_object_initializer = true:suggestion
60 | dotnet_style_collection_initializer = true:suggestion
61 | dotnet_style_explicit_tuple_names = true:suggestion
62 | dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
63 | dotnet_style_prefer_inferred_tuple_names = true:suggestion
64 | dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
65 | dotnet_style_prefer_auto_properties = true:suggestion
66 | dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
67 | dotnet_style_prefer_conditional_expression_over_return = true:suggestion
68 | dotnet_style_prefer_compound_assignment = true:suggestion
69 |
70 | # Null-checking preferences
71 | dotnet_style_coalesce_expression = true:suggestion
72 | dotnet_style_null_propagation = true:suggestion
73 |
74 | # Parameter preferences
75 | dotnet_code_quality_unused_parameters = non_public:suggestion
76 |
77 | ###############################
78 | # Naming Conventions #
79 | ###############################
80 |
81 | # Style Definitions
82 | dotnet_naming_style.pascal_case_style.capitalization = pascal_case
83 | dotnet_naming_style.uppercase_style.capitalization = all_upper
84 |
85 | # Use upper case for constant fields
86 | dotnet_naming_rule.constant_fields_should_be_upper_case.severity = warning
87 | dotnet_naming_rule.constant_fields_should_be_upper_case.symbols = constant_fields
88 | dotnet_naming_rule.constant_fields_should_be_upper_case.style = uppercase_style
89 | dotnet_naming_symbols.constant_fields.applicable_kinds = field
90 | dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
91 | dotnet_naming_symbols.constant_fields.required_modifiers = const
92 |
93 | # Use upper case for constant fields
94 | dotnet_naming_rule.static_readonly_fields_should_be_upper_case.severity = warning
95 | dotnet_naming_rule.static_readonly_fields_should_be_upper_case.symbols = static_readonly_fields
96 | dotnet_naming_rule.static_readonly_fields_should_be_upper_case.style = uppercase_style
97 | dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
98 | dotnet_naming_symbols.static_readonly_fields.applicable_accessibilities = public
99 | dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly
100 |
101 | ###############################
102 | # C# Code Style Rules #
103 | ###############################
104 |
105 | # var preferences
106 | csharp_style_var_for_built_in_types = true:warning
107 | csharp_style_var_when_type_is_apparent = true:warning
108 | csharp_style_var_elsewhere = true:suggestion
109 |
110 | # Expression-bodied members
111 | csharp_style_expression_bodied_methods = false:suggestion
112 | csharp_style_expression_bodied_constructors = false:suggestion
113 | csharp_style_expression_bodied_operators = false:suggestion
114 | csharp_style_expression_bodied_properties = true:suggestion
115 | csharp_style_expression_bodied_indexers = true:suggestion
116 | csharp_style_expression_bodied_accessors = true:suggestion
117 | csharp_style_expression_bodied_lambdas = true:suggestion
118 | csharp_style_expression_bodied_local_functions = false:warning
119 |
120 | # Pattern-matching preferences
121 | csharp_style_pattern_matching_over_is_with_cast_check = true:warning
122 | csharp_style_pattern_matching_over_as_with_null_check = true:warning
123 |
124 | # Null-checking preferences
125 | csharp_style_throw_expression = true:suggestion
126 | csharp_style_conditional_delegate_call = true:suggestion
127 |
128 | # Modifier preferences
129 | csharp_preferred_modifier_order = public, private, protected, internal, static, extern, new, virtual, abstract, sealed, override, readonly, unsafe, volatile, async:suggestion
130 |
131 | # Expression-level preferences
132 | csharp_prefer_braces = true:warning
133 | csharp_style_deconstructed_variable_declaration = true:suggestion
134 | csharp_prefer_simple_default_expression = true:warning
135 | csharp_style_pattern_local_over_anonymous_function = true:suggestion
136 | csharp_style_inlined_variable_declaration = true:warning
137 |
138 | ###############################
139 | # C# Formatting Rules #
140 | ###############################
141 |
142 | # New line preferences
143 | csharp_new_line_before_open_brace = all
144 | csharp_new_line_before_else = true
145 | csharp_new_line_before_catch = true
146 | csharp_new_line_before_finally = true
147 | csharp_new_line_before_members_in_object_initializers = true
148 | csharp_new_line_before_members_in_anonymous_types = true
149 | csharp_new_line_between_query_expression_clauses = true
150 |
151 | # Indentation preferences
152 | csharp_indent_case_contents = true
153 | csharp_indent_switch_labels = true
154 | csharp_indent_labels = flush_left
155 |
156 | # Space preferences
157 | csharp_space_after_cast = true
158 | csharp_space_after_keywords_in_control_flow_statements = true
159 | csharp_space_between_method_call_parameter_list_parentheses = false
160 | csharp_space_between_method_declaration_parameter_list_parentheses = false
161 | csharp_space_between_parentheses = false
162 | csharp_space_before_colon_in_inheritance_clause = true
163 | csharp_space_after_colon_in_inheritance_clause = true
164 | csharp_space_around_binary_operators = before_and_after
165 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
166 | csharp_space_between_method_call_name_and_opening_parenthesis = false
167 | csharp_space_between_method_call_empty_parameter_list_parentheses = false
168 | csharp_space_after_comma = true
169 | csharp_space_after_dot = false
170 |
171 | # Wrapping preferences
172 | csharp_preserve_single_line_statements = false
173 | csharp_preserve_single_line_blocks = true
174 | resharper_wrap_array_initializer_style = chop_if_long
--------------------------------------------------------------------------------
/.github/workflows/pr.yml:
--------------------------------------------------------------------------------
1 | # ------------------------------------------------------------------------------
2 | #
3 | #
4 | # This code was generated.
5 | #
6 | # - To turn off auto-generation set:
7 | #
8 | # [GitHubActions (AutoGenerate = false)]
9 | #
10 | # - To trigger manual generation invoke:
11 | #
12 | # nuke --generate-configuration GitHubActions_pr --host GitHubActions
13 | #
14 | #
15 | # ------------------------------------------------------------------------------
16 |
17 | name: pr build
18 |
19 | on:
20 | push:
21 | branches:
22 | - main
23 | pull_request:
24 | branches:
25 | - main
26 |
27 | jobs:
28 | workflow:
29 | name: PR Pipeline
30 | if: github.event_name == 'push' ||
31 | (github.event_name == 'pull_request' && github.event.pull_request.base.repo.name == github.repository)
32 | runs-on: ubuntu-latest
33 | steps:
34 | - uses: actions/checkout@v3
35 | with:
36 | fetch-depth: 0
37 | - name: Run './build.cmd Compile'
38 | id: NukeBuild
39 | run: ./build.cmd Compile
40 | env:
41 | GH_PACKAGES_USER: ${{ github.repository_owner }}
42 | GH_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 | SIRA_SERVER_CODE: ${{ secrets.SIRA_SERVER_CODE }}
44 | - uses: actions/upload-artifact@v3
45 | with:
46 | name: ${{ steps.NukeBuild.outputs.filename }}
47 | path: ${{ steps.NukeBuild.outputs.artifactpath }}
--------------------------------------------------------------------------------
/.github/workflows/pr_by_comment.yml:
--------------------------------------------------------------------------------
1 | name: pr build by comment
2 |
3 | on:
4 | issue_comment:
5 | types: [created, edited]
6 |
7 | jobs:
8 | workflow:
9 | name: PR Comment Pipeline
10 | if: github.event.issue.pull_request
11 | && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)
12 | && contains(github.event.comment.body, '/build')
13 | runs-on: ubuntu-latest
14 | steps:
15 | - id: comment-branch
16 | name: Get PR comment branch
17 | uses: xt0rted/pull-request-comment-branch@v2
18 | - uses: actions/checkout@v3
19 | with:
20 | fetch-depth: 0
21 | ref: refs/pull/${{ github.event.issue.number }}/merge
22 | - name: Set commit status as pending
23 | uses: myrotvorets/set-commit-status-action@1e0d009edcc8c999a7ef68b5f1d9c45cb40abd96
24 | with:
25 | token: ${{ secrets.GITHUB_TOKEN }}
26 | sha: ${{ steps.comment-branch.outputs.head_sha }}
27 | status: pending
28 | - name: Run './build.cmd Compile'
29 | id: NukeBuild
30 | run: ./build.cmd Compile
31 | env:
32 | GH_PACKAGES_USER: ${{ github.repository_owner }}
33 | GH_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34 | SIRA_SERVER_CODE: ${{ secrets.SIRA_SERVER_CODE }}
35 | - uses: actions/upload-artifact@v3
36 | with:
37 | name: ${{ steps.NukeBuild.outputs.filename }}
38 | path: ${{ steps.NukeBuild.outputs.artifactpath }}
39 | - name: Set final commit status
40 | uses: myrotvorets/set-commit-status-action@1e0d009edcc8c999a7ef68b5f1d9c45cb40abd96
41 | if: always()
42 | with:
43 | token: ${{ secrets.GITHUB_TOKEN }}
44 | sha: ${{ steps.comment-branch.outputs.head_sha }}
45 | status: ${{ job.status }}
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | # ------------------------------------------------------------------------------
2 | #
3 | #
4 | # This code was generated.
5 | #
6 | # - To turn off auto-generation set:
7 | #
8 | # [GitHubActions (AutoGenerate = false)]
9 | #
10 | # - To trigger manual generation invoke:
11 | #
12 | # nuke --generate-configuration GitHubActions_publish --host GitHubActions
13 | #
14 | #
15 | # ------------------------------------------------------------------------------
16 |
17 | name: publish
18 |
19 | on:
20 | push:
21 | tags:
22 | - '*.*.*'
23 |
24 | jobs:
25 | ubuntu-latest:
26 | name: ubuntu-latest
27 | runs-on: ubuntu-latest
28 | steps:
29 | - uses: actions/checkout@v3
30 | with:
31 | fetch-depth: 0
32 | - name: Run './build.cmd CreateGitHubRelease'
33 | id: NukeBuild
34 | run: ./build.cmd CreateGitHubRelease
35 | env:
36 | GH_PACKAGES_USER: ${{ github.repository_owner }}
37 | GH_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 | SIRA_SERVER_CODE: ${{ secrets.SIRA_SERVER_CODE }}
40 | - uses: actions/upload-artifact@v3
41 | with:
42 | name: ${{ steps.NukeBuild.outputs.filename }}
43 | path: ${{ steps.NukeBuild.outputs.artifactpath }}
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.rsuser
8 | *.suo
9 | *.user
10 | *.userosscache
11 | *.sln.docstates
12 |
13 | # User-specific files (MonoDevelop/Xamarin Studio)
14 | *.userprefs
15 |
16 | # Mono auto generated files
17 | mono_crash.*
18 |
19 | # Build results
20 | [Dd]ebug/
21 | [Dd]ebugPublic/
22 | [Rr]elease/
23 | [Rr]eleases/
24 | x64/
25 | x86/
26 | [Aa][Rr][Mm]/
27 | [Aa][Rr][Mm]64/
28 | bld/
29 | [Bb]in/
30 | [Oo]bj/
31 | [Ll]og/
32 | [Ll]ogs/
33 |
34 | # Visual Studio 2015/2017 cache/options directory
35 | .vs/
36 | # Uncomment if you have tasks that create the project's static files in wwwroot
37 | #wwwroot/
38 |
39 | # Visual Studio 2017 auto generated files
40 | Generated\ Files/
41 |
42 | # MSTest test Results
43 | [Tt]est[Rr]esult*/
44 | [Bb]uild[Ll]og.*
45 |
46 | # NUnit
47 | *.VisualState.xml
48 | TestResult.xml
49 | nunit-*.xml
50 |
51 | # Build Results of an ATL Project
52 | [Dd]ebugPS/
53 | [Rr]eleasePS/
54 | dlldata.c
55 |
56 | # Benchmark Results
57 | BenchmarkDotNet.Artifacts/
58 |
59 | # .NET Core
60 | project.lock.json
61 | project.fragment.lock.json
62 | artifacts/
63 |
64 | # StyleCop
65 | StyleCopReport.xml
66 |
67 | # Files built by Visual Studio
68 | *_i.c
69 | *_p.c
70 | *_h.h
71 | *.ilk
72 | *.meta
73 | *.obj
74 | *.iobj
75 | *.pch
76 | *.pdb
77 | *.ipdb
78 | *.pgc
79 | *.pgd
80 | *.rsp
81 | *.sbr
82 | *.tlb
83 | *.tli
84 | *.tlh
85 | *.tmp
86 | *.tmp_proj
87 | *_wpftmp.csproj
88 | *.log
89 | *.vspscc
90 | *.vssscc
91 | .builds
92 | *.pidb
93 | *.svclog
94 | *.scc
95 |
96 | # Chutzpah Test files
97 | _Chutzpah*
98 |
99 | # Visual C++ cache files
100 | ipch/
101 | *.aps
102 | *.ncb
103 | *.opendb
104 | *.opensdf
105 | *.sdf
106 | *.cachefile
107 | *.VC.db
108 | *.VC.VC.opendb
109 |
110 | # Visual Studio profiler
111 | *.psess
112 | *.vsp
113 | *.vspx
114 | *.sap
115 |
116 | # Visual Studio Trace Files
117 | *.e2e
118 |
119 | # TFS 2012 Local Workspace
120 | $tf/
121 |
122 | # Guidance Automation Toolkit
123 | *.gpState
124 |
125 | # ReSharper is a .NET coding add-in
126 | _ReSharper*/
127 | *.[Rr]e[Ss]harper
128 | *.DotSettings.user
129 |
130 | # TeamCity is a build add-in
131 | _TeamCity*
132 |
133 | # DotCover is a Code Coverage Tool
134 | *.dotCover
135 |
136 | # AxoCover is a Code Coverage Tool
137 | .axoCover/*
138 | !.axoCover/settings.json
139 |
140 | # Coverlet is a free, cross platform Code Coverage Tool
141 | coverage*[.json, .xml, .info]
142 |
143 | # Visual Studio code coverage results
144 | *.coverage
145 | *.coveragexml
146 |
147 | # NCrunch
148 | _NCrunch_*
149 | .*crunch*.local.xml
150 | nCrunchTemp_*
151 |
152 | # MightyMoose
153 | *.mm.*
154 | AutoTest.Net/
155 |
156 | # Web workbench (sass)
157 | .sass-cache/
158 |
159 | # Installshield output folder
160 | [Ee]xpress/
161 |
162 | # DocProject is a documentation generator add-in
163 | DocProject/buildhelp/
164 | DocProject/Help/*.HxT
165 | DocProject/Help/*.HxC
166 | DocProject/Help/*.hhc
167 | DocProject/Help/*.hhk
168 | DocProject/Help/*.hhp
169 | DocProject/Help/Html2
170 | DocProject/Help/html
171 |
172 | # Click-Once directory
173 | publish/
174 |
175 | # Publish Web Output
176 | *.[Pp]ublish.xml
177 | *.azurePubxml
178 | # Note: Comment the next line if you want to checkin your web deploy settings,
179 | # but database connection strings (with potential passwords) will be unencrypted
180 | *.pubxml
181 | *.publishproj
182 |
183 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
184 | # checkin your Azure Web App publish settings, but sensitive information contained
185 | # in these scripts will be unencrypted
186 | PublishScripts/
187 |
188 | # NuGet Packages
189 | *.nupkg
190 | # NuGet Symbol Packages
191 | *.snupkg
192 | # The packages folder can be ignored because of Package Restore
193 | **/[Pp]ackages/*
194 | # except build/, which is used as an MSBuild target.
195 | !**/[Pp]ackages/build/
196 | # Uncomment if necessary however generally it will be regenerated when needed
197 | #!**/[Pp]ackages/repositories.config
198 | # NuGet v3's project.json files produces more ignorable files
199 | *.nuget.props
200 | *.nuget.targets
201 |
202 | # Microsoft Azure Build Output
203 | csx/
204 | *.build.csdef
205 |
206 | # Microsoft Azure Emulator
207 | ecf/
208 | rcf/
209 |
210 | # Windows Store app package directories and files
211 | AppPackages/
212 | BundleArtifacts/
213 | Package.StoreAssociation.xml
214 | _pkginfo.txt
215 | *.appx
216 | *.appxbundle
217 | *.appxupload
218 |
219 | # Visual Studio cache files
220 | # files ending in .cache can be ignored
221 | *.[Cc]ache
222 | # but keep track of directories ending in .cache
223 | !?*.[Cc]ache/
224 |
225 | # Others
226 | ClientBin/
227 | ~$*
228 | *~
229 | *.dbmdl
230 | *.dbproj.schemaview
231 | *.jfm
232 | *.pfx
233 | *.publishsettings
234 | orleans.codegen.cs
235 |
236 | # Including strong name files can present a security risk
237 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
238 | #*.snk
239 |
240 | # Since there are multiple workflows, uncomment next line to ignore bower_components
241 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
242 | #bower_components/
243 |
244 | # RIA/Silverlight projects
245 | Generated_Code/
246 |
247 | # Backup & report files from converting an old project file
248 | # to a newer Visual Studio version. Backup files are not needed,
249 | # because we have git ;-)
250 | _UpgradeReport_Files/
251 | Backup*/
252 | UpgradeLog*.XML
253 | UpgradeLog*.htm
254 | ServiceFabricBackup/
255 | *.rptproj.bak
256 |
257 | # SQL Server files
258 | *.mdf
259 | *.ldf
260 | *.ndf
261 |
262 | # Business Intelligence projects
263 | *.rdl.data
264 | *.bim.layout
265 | *.bim_*.settings
266 | *.rptproj.rsuser
267 | *- [Bb]ackup.rdl
268 | *- [Bb]ackup ([0-9]).rdl
269 | *- [Bb]ackup ([0-9][0-9]).rdl
270 |
271 | # Microsoft Fakes
272 | FakesAssemblies/
273 |
274 | # GhostDoc plugin setting file
275 | *.GhostDoc.xml
276 |
277 | # Node.js Tools for Visual Studio
278 | .ntvs_analysis.dat
279 | node_modules/
280 |
281 | # Visual Studio 6 build log
282 | *.plg
283 |
284 | # Visual Studio 6 workspace options file
285 | *.opt
286 |
287 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
288 | *.vbw
289 |
290 | # Visual Studio LightSwitch build output
291 | **/*.HTMLClient/GeneratedArtifacts
292 | **/*.DesktopClient/GeneratedArtifacts
293 | **/*.DesktopClient/ModelManifest.xml
294 | **/*.Server/GeneratedArtifacts
295 | **/*.Server/ModelManifest.xml
296 | _Pvt_Extensions
297 |
298 | # Paket dependency manager
299 | .paket/paket.exe
300 | paket-files/
301 |
302 | # FAKE - F# Make
303 | .fake/
304 |
305 | # CodeRush personal settings
306 | .cr/personal
307 |
308 | # Python Tools for Visual Studio (PTVS)
309 | __pycache__/
310 | *.pyc
311 |
312 | # Cake - Uncomment if you are using it
313 | # tools/**
314 | # !tools/packages.config
315 |
316 | # Tabs Studio
317 | *.tss
318 |
319 | # Telerik's JustMock configuration file
320 | *.jmconfig
321 |
322 | # BizTalk build output
323 | *.btp.cs
324 | *.btm.cs
325 | *.odx.cs
326 | *.xsd.cs
327 |
328 | # OpenCover UI analysis results
329 | OpenCover/
330 |
331 | # Azure Stream Analytics local run output
332 | ASALocalRun/
333 |
334 | # MSBuild Binary and Structured Log
335 | *.binlog
336 |
337 | # NVidia Nsight GPU debugger configuration file
338 | *.nvuser
339 |
340 | # MFractors (Xamarin productivity tool) working folder
341 | .mfractor/
342 |
343 | # Local History for Visual Studio
344 | .localhistory/
345 |
346 | # BeatPulse healthcheck temp database
347 | healthchecksdb
348 |
349 | # Backup folder for Package Reference Convert tool in Visual Studio 2017
350 | MigrationBackup/
351 |
352 | # Ionide (cross platform F# VS Code tools) working folder
353 | .ionide/
354 |
355 | # JetBrains Rider
356 | .idea/
357 | *.sln.iml
--------------------------------------------------------------------------------
/.nuke/build.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-04/schema#",
3 | "title": "Build Schema",
4 | "$ref": "#/definitions/build",
5 | "definitions": {
6 | "build": {
7 | "type": "object",
8 | "properties": {
9 | "Configuration": {
10 | "type": "string",
11 | "description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
12 | "enum": [
13 | "Debug",
14 | "Release"
15 | ]
16 | },
17 | "Continue": {
18 | "type": "boolean",
19 | "description": "Indicates to continue a previously failed build attempt"
20 | },
21 | "Help": {
22 | "type": "boolean",
23 | "description": "Shows the help text for this build assembly"
24 | },
25 | "Host": {
26 | "type": "string",
27 | "description": "Host for execution. Default is 'automatic'",
28 | "enum": [
29 | "AppVeyor",
30 | "AzurePipelines",
31 | "Bamboo",
32 | "Bitbucket",
33 | "Bitrise",
34 | "GitHubActions",
35 | "GitLab",
36 | "Jenkins",
37 | "Rider",
38 | "SpaceAutomation",
39 | "TeamCity",
40 | "Terminal",
41 | "TravisCI",
42 | "VisualStudio",
43 | "VSCode"
44 | ]
45 | },
46 | "ManifestPath": {
47 | "type": "string",
48 | "description": "Path to manifest.json"
49 | },
50 | "NoLogo": {
51 | "type": "boolean",
52 | "description": "Disables displaying the NUKE logo"
53 | },
54 | "Partition": {
55 | "type": "string",
56 | "description": "Partition to use on CI"
57 | },
58 | "Plan": {
59 | "type": "boolean",
60 | "description": "Shows the execution plan (HTML)"
61 | },
62 | "Profile": {
63 | "type": "array",
64 | "description": "Defines the profiles to load",
65 | "items": {
66 | "type": "string"
67 | }
68 | },
69 | "RefsDirectory": {
70 | "type": "string",
71 | "description": "Path to the Refs directory, defaults to a folder named 'Refs' in the source directory"
72 | },
73 | "Root": {
74 | "type": "string",
75 | "description": "Root directory during build execution"
76 | },
77 | "SIRA_SERVER_CODE": {
78 | "type": "string",
79 | "description": "SIRA CDN Code",
80 | "default": "Secrets must be entered via 'nuke :secrets [profile]'"
81 | },
82 | "Skip": {
83 | "type": "array",
84 | "description": "List of targets to be skipped. Empty list skips all dependencies",
85 | "items": {
86 | "type": "string",
87 | "enum": [
88 | "Clean",
89 | "CleanRefs",
90 | "Compile",
91 | "CreateGitHubRelease",
92 | "DeserializeManifest",
93 | "DownloadDependencies",
94 | "DownloadGameRefs",
95 | "GrabRefs",
96 | "RestorePackages"
97 | ]
98 | }
99 | },
100 | "Solution": {
101 | "type": "string",
102 | "description": "Path to a solution file that is automatically loaded"
103 | },
104 | "SourceDirectory": {
105 | "type": "string",
106 | "description": "Path to the source directory"
107 | },
108 | "Target": {
109 | "type": "array",
110 | "description": "List of targets to be invoked. Default is '{default_target}'",
111 | "items": {
112 | "type": "string",
113 | "enum": [
114 | "Clean",
115 | "CleanRefs",
116 | "Compile",
117 | "CreateGitHubRelease",
118 | "DeserializeManifest",
119 | "DownloadDependencies",
120 | "DownloadGameRefs",
121 | "GrabRefs",
122 | "RestorePackages"
123 | ]
124 | }
125 | },
126 | "Verbosity": {
127 | "type": "string",
128 | "description": "Logging verbosity during build execution. Default is 'Normal'",
129 | "enum": [
130 | "Minimal",
131 | "Normal",
132 | "Quiet",
133 | "Verbose"
134 | ]
135 | }
136 | }
137 | }
138 | }
139 | }
--------------------------------------------------------------------------------
/.nuke/parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./build.schema.json",
3 | "Solution": "SongChartVisualizer.sln",
4 | "SourceDirectory": "./source",
5 | "ManifestPath": "./source/SongChartVisualizer/manifest.json"
6 | }
--------------------------------------------------------------------------------
/GitVersion.yml:
--------------------------------------------------------------------------------
1 | mode: ContinuousDelivery
2 | branches: {}
3 | ignore:
4 | sha: []
5 | merge-message-formats: {}
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SongChartVisualizer
2 | SongChartVisualizer is a small mods that shows a configurable in-game graph that displays the NPS over time.
3 | It also has the ability to warn you when you're about to reach peak NPS. The mod can be configured in the Mod Settings.
4 |
5 | ## Installation
6 | This mod requires a few other mods in order to work.
7 |
8 | - BSIPA v4.2.2 or higher
9 | - BeatSaberMarkupLanguage v1.6.4 or higher
10 | - SiraUtil v3.0.6 or higher
11 |
12 | Installation is fairly simple.
13 |
14 | 1. Grab the latest plugin release from BeatMods/ModAssistant (once it's available) or from the [releases page](https://github.com/ErisApps/SongChartVisualizer/releases) (once there is actually a
15 | release)
16 | 2. Drop the .dll file in the Plugins folder of your Beat Saber installation.
17 | 3. Boot it up (or reboot)
18 |
19 | ## Developers
20 | To build this project you will need to create a `ChartPlugin/SongChartVisualizer.csproj.user` file specifying where the game is located:
21 |
22 | ```xml
23 |
24 |
25 |
26 |
27 | D:\Program Files (x86)\Steam\steamapps\common\Beat Saber
28 |
29 |
30 | ```
31 |
32 | ### Credits
33 | Credit where credit is due:
34 | - [@Shoko84](https://github.com/Shoko84) for writing the original mod
35 | - [@MildPanda (Opzon)](https://github.com/MildPanda) for mod ideas in the original mod
--------------------------------------------------------------------------------
/SongChartVisualizer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.27703.2047
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "_build", "build\_build.csproj", "{A5403153-DF77-4EB5-B7CE-B208719DD38E}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SongChartVisualizer", "source\SongChartVisualizer\SongChartVisualizer.csproj", "{64A2A30B-9DC5-44CE-90E4-A790CA13A124}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {A5403153-DF77-4EB5-B7CE-B208719DD38E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {A5403153-DF77-4EB5-B7CE-B208719DD38E}.Release|Any CPU.ActiveCfg = Release|Any CPU
18 | {64A2A30B-9DC5-44CE-90E4-A790CA13A124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19 | {64A2A30B-9DC5-44CE-90E4-A790CA13A124}.Debug|Any CPU.Build.0 = Debug|Any CPU
20 | {64A2A30B-9DC5-44CE-90E4-A790CA13A124}.Release|Any CPU.ActiveCfg = Release|Any CPU
21 | {64A2A30B-9DC5-44CE-90E4-A790CA13A124}.Release|Any CPU.Build.0 = Release|Any CPU
22 | EndGlobalSection
23 | GlobalSection(SolutionProperties) = preSolution
24 | HideSolutionNode = FALSE
25 | EndGlobalSection
26 | GlobalSection(ExtensibilityGlobals) = postSolution
27 | SolutionGuid = {5E772049-C240-463B-851B-2BA5EAD4D68B}
28 | EndGlobalSection
29 | EndGlobal
30 |
--------------------------------------------------------------------------------
/build.cmd:
--------------------------------------------------------------------------------
1 | :; set -eo pipefail
2 | :; SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
3 | :; ${SCRIPT_DIR}/build.sh "$@"
4 | :; exit $?
5 |
6 | @ECHO OFF
7 | powershell -ExecutionPolicy ByPass -NoProfile -File "%~dp0build.ps1" %*
8 |
--------------------------------------------------------------------------------
/build.ps1:
--------------------------------------------------------------------------------
1 | [CmdletBinding()]
2 | Param(
3 | [Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
4 | [string[]]$BuildArguments
5 | )
6 |
7 | Write-Output "PowerShell $($PSVersionTable.PSEdition) version $($PSVersionTable.PSVersion)"
8 |
9 | Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { Write-Error $_ -ErrorAction Continue; exit 1 }
10 | $PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
11 |
12 | ###########################################################################
13 | # CONFIGURATION
14 | ###########################################################################
15 |
16 | $BuildProjectFile = "$PSScriptRoot\build\_build.csproj"
17 | $TempDirectory = "$PSScriptRoot\\.nuke\temp"
18 |
19 | $DotNetGlobalFile = "$PSScriptRoot\\global.json"
20 | $DotNetInstallUrl = "https://dot.net/v1/dotnet-install.ps1"
21 | $DotNetChannel = "Current"
22 |
23 | $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
24 | $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
25 | $env:DOTNET_MULTILEVEL_LOOKUP = 0
26 |
27 | ###########################################################################
28 | # EXECUTION
29 | ###########################################################################
30 |
31 | function ExecSafe([scriptblock] $cmd) {
32 | & $cmd
33 | if ($LASTEXITCODE) { exit $LASTEXITCODE }
34 | }
35 |
36 | # If dotnet CLI is installed globally and it matches requested version, use for execution
37 | if ($null -ne (Get-Command "dotnet" -ErrorAction SilentlyContinue) -and `
38 | $(dotnet --version) -and $LASTEXITCODE -eq 0) {
39 | $env:DOTNET_EXE = (Get-Command "dotnet").Path
40 | }
41 | else {
42 | # Download install script
43 | $DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
44 | New-Item -ItemType Directory -Path $TempDirectory -Force | Out-Null
45 | [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
46 | (New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)
47 |
48 | # If global.json exists, load expected version
49 | if (Test-Path $DotNetGlobalFile) {
50 | $DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json)
51 | if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) {
52 | $DotNetVersion = $DotNetGlobal.sdk.version
53 | }
54 | }
55 |
56 | # Install by channel or version
57 | $DotNetDirectory = "$TempDirectory\dotnet-win"
58 | if (!(Test-Path variable:DotNetVersion)) {
59 | ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
60 | } else {
61 | ExecSafe { & powershell $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
62 | }
63 | $env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
64 | }
65 |
66 | Write-Output "Microsoft (R) .NET SDK version $(& $env:DOTNET_EXE --version)"
67 |
68 | if ((Test-Path env:GH_PACKAGES_USER) -AND (Test-Path $env:GH_PACKAGES_TOKEN)) {
69 | ExecSafe { & $env:DOTNET_EXE nuget update source "Atlas-Rhythm GH Packages" --username $env:GH_PACKAGES_USER --password $env:GH_PACKAGES_TOKEN --store-password-in-clear-text }
70 | }
71 |
72 | if ((Test-Path env:GH_PACKAGES_USER) -AND (Test-Path $env:GH_PACKAGES_TOKEN)) {
73 | ExecSafe { & $env:DOTNET_EXE nuget update source "ErisApps GH Packages" --username $env:GH_PACKAGES_USER --password $env:GH_PACKAGES_TOKEN --store-password-in-clear-text }
74 | }
75 |
76 | ExecSafe { & $env:DOTNET_EXE build $BuildProjectFile /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet }
77 | ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile --no-build -- $BuildArguments }
78 |
--------------------------------------------------------------------------------
/build.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | bash --version 2>&1 | head -n 1
4 |
5 | set -eo pipefail
6 | SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
7 |
8 | ###########################################################################
9 | # CONFIGURATION
10 | ###########################################################################
11 |
12 | BUILD_PROJECT_FILE="$SCRIPT_DIR/build/_build.csproj"
13 | TEMP_DIRECTORY="$SCRIPT_DIR//.nuke/temp"
14 |
15 | DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
16 | DOTNET_INSTALL_URL="https://dot.net/v1/dotnet-install.sh"
17 | DOTNET_CHANNEL="Current"
18 |
19 | export DOTNET_CLI_TELEMETRY_OPTOUT=1
20 | export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
21 | export DOTNET_MULTILEVEL_LOOKUP=0
22 |
23 | ###########################################################################
24 | # EXECUTION
25 | ###########################################################################
26 |
27 | function FirstJsonValue {
28 | perl -nle 'print $1 if m{"'"$1"'": "([^"]+)",?}' <<< "${@:2}"
29 | }
30 |
31 | # If dotnet CLI is installed globally and it matches requested version, use for execution
32 | if [ -x "$(command -v dotnet)" ] && dotnet --version &>/dev/null; then
33 | export DOTNET_EXE="$(command -v dotnet)"
34 | else
35 | # Download install script
36 | DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh"
37 | mkdir -p "$TEMP_DIRECTORY"
38 | curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL"
39 | chmod +x "$DOTNET_INSTALL_FILE"
40 |
41 | # If global.json exists, load expected version
42 | if [[ -f "$DOTNET_GLOBAL_FILE" ]]; then
43 | DOTNET_VERSION=$(FirstJsonValue "version" "$(cat "$DOTNET_GLOBAL_FILE")")
44 | if [[ "$DOTNET_VERSION" == "" ]]; then
45 | unset DOTNET_VERSION
46 | fi
47 | fi
48 |
49 | # Install by channel or version
50 | DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix"
51 | if [[ -z ${DOTNET_VERSION+x} ]]; then
52 | "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path
53 | else
54 | "$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
55 | fi
56 | export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
57 | fi
58 |
59 | echo "Microsoft (R) .NET SDK version $("$DOTNET_EXE" --version)"
60 |
61 | if [[ ! -z ${GH_PACKAGES_USER+x} && "$GH_PACKAGES_USER" != "" && ! -z ${GH_PACKAGES_TOKEN+x} && "$GH_PACKAGES_TOKEN" != "" ]]; then
62 | "$DOTNET_EXE" nuget update source "Atlas-Rhythm GH Packages" --username "$GH_PACKAGES_USER" --password "$GH_PACKAGES_TOKEN" --store-password-in-clear-text
63 | fi
64 |
65 | if [[ ! -z ${GH_PACKAGES_USER+x} && "$GH_PACKAGES_USER" != "" && ! -z ${GH_PACKAGES_TOKEN+x} && "$GH_PACKAGES_TOKEN" != "" ]]; then
66 | "$DOTNET_EXE" nuget update source "ErisApps GH Packages" --username "$GH_PACKAGES_USER" --password "$GH_PACKAGES_TOKEN" --store-password-in-clear-text
67 | fi
68 |
69 | "$DOTNET_EXE" build "$BUILD_PROJECT_FILE" /nodeReuse:false /p:UseSharedCompilation=false -nologo -clp:NoSummary --verbosity quiet
70 | "$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" --no-build -- "$@"
71 |
--------------------------------------------------------------------------------
/build/.editorconfig:
--------------------------------------------------------------------------------
1 | [*.cs]
2 | dotnet_style_qualification_for_field = false:warning
3 | dotnet_style_qualification_for_property = false:warning
4 | dotnet_style_qualification_for_method = false:warning
5 | dotnet_style_qualification_for_event = false:warning
6 | dotnet_style_require_accessibility_modifiers = never:warning
7 |
8 | csharp_style_expression_bodied_methods = true:silent
9 | csharp_style_expression_bodied_properties = true:warning
10 | csharp_style_expression_bodied_indexers = true:warning
11 | csharp_style_expression_bodied_accessors = true:warning
12 |
--------------------------------------------------------------------------------
/build/Build.CI.GitHubActions.cs:
--------------------------------------------------------------------------------
1 | using Nuke.Common.CI;
2 | using Nuke.Common.CI.GitHubActions;
3 |
4 | [GitHubActions(
5 | "pr",
6 | GitHubActionsImage.UbuntuLatest,
7 | AutoGenerate = false,
8 | CacheKeyFiles = new string[0],
9 | EnableGitHubToken = false,
10 | FetchDepth = 0, // Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Make sure to fetch whole git history, in order to get GitVersion to work.
11 | ImportSecrets = new[] { "SIRA_SERVER_CODE" },
12 | InvokedTargets = new[] { nameof(Compile) },
13 | OnPushBranches = new[] { "main" },
14 | OnPullRequestBranches = new[] { "main" },
15 | PublishArtifacts = true)]
16 | [GitHubActions(
17 | "publish",
18 | GitHubActionsImage.UbuntuLatest,
19 | AutoGenerate = false,
20 | CacheKeyFiles = new string[0],
21 | EnableGitHubToken = true,
22 | FetchDepth = 0, // Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. Make sure to fetch whole git history, in order to get GitVersion to work.
23 | ImportSecrets = new[] { "SIRA_SERVER_CODE" },
24 | InvokedTargets = new[] { nameof(CreateGitHubRelease) },
25 | OnPushTags = new[] { "*.*.*" },
26 | PublishArtifacts = true)]
27 | partial class Build
28 | {
29 | [CI] readonly GitHubActions GitHubActions;
30 | }
--------------------------------------------------------------------------------
/build/Build.cs:
--------------------------------------------------------------------------------
1 | using System.IO;
2 | using System.Linq;
3 | using System.Threading.Tasks;
4 | using BeatSaberModdingTools.Nuke.Components;
5 | using GlobExpressions;
6 | using Nuke.Common;
7 | using Nuke.Common.CI;
8 | using Nuke.Common.Git;
9 | using Nuke.Common.ProjectModel;
10 | using Nuke.Common.Tools.DotNet;
11 | using Nuke.Common.Tools.GitHub;
12 | using Nuke.Common.Tools.GitVersion;
13 | using Octokit;
14 | using Octokit.Internal;
15 | using Serilog;
16 | using static Nuke.Common.Tools.DotNet.DotNetTasks;
17 |
18 | [ShutdownDotNetAfterServerBuild]
19 | partial class Build : NukeBuild, ICleanRefs, IDeserializeManifest, IDownloadGameRefs, IDownloadBeatModsDependencies
20 | {
21 | /// Support plugins are available for:
22 | /// - JetBrains ReSharper https://nuke.build/resharper
23 | /// - JetBrains Rider https://nuke.build/rider
24 | /// - Microsoft VisualStudio https://nuke.build/visualstudio
25 | /// - Microsoft VSCode https://nuke.build/vscode
26 | public static int Main() => Execute(x => x.Compile);
27 |
28 | [Nuke.Common.Parameter("Configuration to build - Default is 'Debug' (local) or 'Release' (server)")] readonly Configuration Configuration = IsLocalBuild ? Configuration.Debug : Configuration.Release;
29 |
30 | [Solution(GenerateProjects = true)] readonly Solution Solution;
31 |
32 | [GitVersion] readonly GitVersion GitVersion;
33 |
34 | Target Clean => _ => _
35 | .Executes(() =>
36 | {
37 | DotNetClean(s => s.SetProject(Solution.SongChartVisualizer));
38 | });
39 |
40 | Target GrabRefs => _ => _
41 | .After(RestorePackages)
42 | .OnlyWhenStatic(() => IsServerBuild)
43 | .WhenSkipped(DependencyBehavior.Skip)
44 | .DependsOn()
45 | .DependsOn()
46 | .DependsOn();
47 |
48 | Target RestorePackages => _ => _
49 | .DependsOn(Clean)
50 | .Executes(() => DotNetRestore(settings => settings.SetProjectFile(Solution.SongChartVisualizer)));
51 |
52 | Target Compile => _ => _
53 | .DependsOn(RestorePackages)
54 | .DependsOn(GrabRefs)
55 | .Executes(() =>
56 | {
57 | DotNetBuild(settings => settings
58 | .EnableNoRestore()
59 | .SetProjectFile(Solution.SongChartVisualizer)
60 | .SetConfiguration(Configuration)
61 | .SetVersion(GitVersion.FullSemVer)
62 | .SetAssemblyVersion(GitVersion.AssemblySemVer)
63 | .SetFileVersion(GitVersion.AssemblySemFileVer)
64 | .SetInformationalVersion(GitVersion.InformationalVersion));
65 | });
66 |
67 | [GitRepository]
68 | readonly GitRepository GitRepository;
69 |
70 | Target CreateGitHubRelease => _ => _
71 | .DependsOn(Compile)
72 | .Requires(() => Configuration == Configuration.Release)
73 | .Executes(async () =>
74 | {
75 | // Set credentials for authorized actions
76 | var credentials = new Credentials(GitHubActions.Token);
77 | GitHubTasks.GitHubClient = new GitHubClient(
78 | new ProductHeaderValue(nameof(NukeBuild)),
79 | new InMemoryCredentialStore(credentials));
80 |
81 | var (repositoryOwner, repositoryName) = (GitRepository.GetGitHubOwner(), GitRepository.GetGitHubName());
82 |
83 | // Create release
84 | var releaseTag = GitVersion.NuGetVersion;
85 | var newRelease = new NewRelease(releaseTag)
86 | {
87 | TargetCommitish = GitVersion.Sha,
88 | Draft = true,
89 | Name = $"{repositoryName} {releaseTag}",
90 | GenerateReleaseNotes = true
91 | };
92 |
93 | var createdRelease = await GitHubTasks.GitHubClient
94 | .Repository
95 | .Release
96 | .Create(repositoryOwner, repositoryName, newRelease);
97 |
98 | // Glob artifacts
99 | var globbingPath = Solution.SongChartVisualizer.Directory / "bin" / Configuration;
100 | var artifactPaths = Glob
101 | .Files(globbingPath, "**/*.zip")
102 | .Select(relativePath => globbingPath / relativePath)
103 | .ToArray();
104 |
105 | // Add artifact to release
106 | Assert.NotEmpty(artifactPaths);
107 | var assetUploadTasks = artifactPaths
108 | .Select(filePath => AddArtifactToRelease(createdRelease, filePath));
109 | await Task.WhenAll(assetUploadTasks);
110 | });
111 |
112 | static async Task AddArtifactToRelease(Release createdRelease, string filePath)
113 | {
114 | Assert.FileExists(filePath);
115 | Log.Information("Uploading file at location {FilePath}", filePath);
116 |
117 | var artifactName = Path.GetFileName(filePath);
118 | await using var fileStream = File.OpenRead(filePath);
119 | var releaseAssetUpload = new ReleaseAssetUpload
120 | {
121 | FileName = artifactName,
122 | RawData = fileStream,
123 | ContentType = "application/octet-stream"
124 | };
125 |
126 | await GitHubTasks.GitHubClient
127 | .Repository
128 | .Release
129 | .UploadAsset(createdRelease, releaseAssetUpload);
130 | }
131 | }
--------------------------------------------------------------------------------
/build/Configuration.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.ComponentModel;
3 | using System.Linq;
4 | using Nuke.Common.Tooling;
5 |
6 | [TypeConverter(typeof(TypeConverter))]
7 | public class Configuration : Enumeration
8 | {
9 | public static Configuration Debug = new Configuration { Value = nameof(Debug) };
10 | public static Configuration Release = new Configuration { Value = nameof(Release) };
11 |
12 | public static implicit operator string(Configuration configuration)
13 | {
14 | return configuration.Value;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/build/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/build/Directory.Build.targets:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/build/_build.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net6.0
6 |
7 | CS0649;CS0169
8 | ..
9 | ..
10 | 1
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/build/_build.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | DO_NOT_SHOW
3 | DO_NOT_SHOW
4 | DO_NOT_SHOW
5 | DO_NOT_SHOW
6 | Implicit
7 | Implicit
8 | ExpressionBody
9 | 0
10 | NEXT_LINE
11 | True
12 | False
13 | 120
14 | IF_OWNER_IS_SINGLE_LINE
15 | WRAP_IF_LONG
16 | False
17 | <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
18 | <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" />
19 | True
20 | True
21 | True
22 | True
23 | True
24 | True
25 | True
26 | True
27 | True
28 |
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Core/WindowGraph.cs:
--------------------------------------------------------------------------------
1 | /*
2 | ------------------- Code Monkey -------------------
3 |
4 | Thank you for downloading this package
5 | I hope you find it useful in your projects
6 | If you have any questions let me know
7 | Cheers!
8 |
9 | unitycodemonkey.com
10 | --------------------------------------------------
11 | */
12 |
13 | using System;
14 | using System.Collections.Generic;
15 | using System.Globalization;
16 | using HMUI;
17 | using UnityEngine;
18 | using UnityEngine.UI;
19 |
20 | namespace SongChartVisualizer.Core
21 | {
22 | internal class WindowGraph : MonoBehaviour
23 | {
24 | private static readonly Color DefaultLinkColor = new Color(1, 1, 1, .5f);
25 |
26 | private RectTransform _labelTemplateX = null!;
27 | private RectTransform _labelTemplateY = null!;
28 | private RectTransform _dashTemplateX = null!;
29 | private RectTransform _dashTemplateY = null!;
30 |
31 | public Sprite? circleSprite;
32 |
33 | public RectTransform GraphContainer { get; private set; } = null!;
34 | public List DotObjects { get; }
35 | public List LinkObjects { get; }
36 | public List LabelXObjects { get; }
37 | public List LabelYObjects { get; }
38 | public List DashXObjects { get; }
39 | public List DashYObjects { get; }
40 |
41 | private WindowGraph()
42 | {
43 | DotObjects = new List();
44 | LinkObjects = new List();
45 | LabelXObjects = new List();
46 | LabelYObjects = new List();
47 | DashXObjects = new List();
48 | DashYObjects = new List();
49 | }
50 |
51 | private void Awake()
52 | {
53 | GraphContainer = transform.Find("GraphContainer").GetComponent();
54 |
55 | _labelTemplateX = GraphContainer.Find("LabelTemplateX").GetComponent();
56 | _labelTemplateY = GraphContainer.Find("LabelTemplateY").GetComponent();
57 | _dashTemplateX = GraphContainer.Find("DashTemplateX").GetComponent();
58 | _dashTemplateY = GraphContainer.Find("DashTemplateY").GetComponent();
59 | }
60 |
61 | // ReSharper disable once CognitiveComplexity
62 | public void ShowGraph(List valueList, bool makeDotsVisible = true, bool makeLinksVisible = true, bool makeOriginZero = false, int maxVisibleValueAmount = -1,
63 | Func? getAxisLabelX = null, Func? getAxisLabelY = null, Color? linkColor = null)
64 | {
65 | getAxisLabelX ??= i => i.ToString(CultureInfo.InvariantCulture);
66 |
67 | getAxisLabelY ??= f => Mathf.RoundToInt(f).ToString();
68 |
69 | if (maxVisibleValueAmount <= 0)
70 | {
71 | maxVisibleValueAmount = valueList.Count;
72 | }
73 |
74 | ClearOldData();
75 |
76 | var graphSizeDelta = GraphContainer.sizeDelta;
77 | var graphWidth = graphSizeDelta.x;
78 | var graphHeight = graphSizeDelta.y;
79 |
80 | var yMaximum = valueList[0];
81 | var yMinimum = valueList[0];
82 |
83 | for (var i = Mathf.Max(valueList.Count - maxVisibleValueAmount, 0); i < valueList.Count; i++)
84 | {
85 | var value = valueList[i];
86 | if (value > yMaximum)
87 | {
88 | yMaximum = value;
89 | }
90 |
91 | if (value < yMinimum)
92 | {
93 | yMinimum = value;
94 | }
95 | }
96 |
97 | var yDifference = yMaximum - yMinimum;
98 | if (yDifference <= 0)
99 | {
100 | yDifference = 5f;
101 | }
102 |
103 | yMaximum += (yDifference * 0.2f);
104 | yMinimum -= (yDifference * 0.2f);
105 |
106 | if (makeOriginZero)
107 | {
108 | yMinimum = 0f; // Start the graph at zero
109 | }
110 |
111 | var xSize = graphWidth / (maxVisibleValueAmount + 1);
112 | var xIndex = 0;
113 |
114 | linkColor = linkColor == null ? DefaultLinkColor : new Color(linkColor.Value.r, linkColor.Value.g, linkColor.Value.b, .5f);
115 |
116 | GameObject? lastCircleGameObject = null;
117 | for (var i = Mathf.Max(valueList.Count - maxVisibleValueAmount, 0); i < valueList.Count; i++)
118 | {
119 | var xPosition = xSize + xIndex * xSize;
120 | var yPosition = (valueList[i] - yMinimum) / (yMaximum - yMinimum) * graphHeight;
121 | var circleGameObject = CreateCircle(new Vector2(xPosition, yPosition), makeDotsVisible);
122 | DotObjects.Add(circleGameObject);
123 | if (lastCircleGameObject != null)
124 | {
125 | var dotConnectionGameObject = CreateDotConnection(lastCircleGameObject.GetComponent().anchoredPosition,
126 | circleGameObject.GetComponent().anchoredPosition,
127 | makeLinksVisible,
128 | linkColor.Value);
129 | LinkObjects.Add(dotConnectionGameObject);
130 | }
131 |
132 | lastCircleGameObject = circleGameObject;
133 |
134 | var labelX = Instantiate(_labelTemplateX, GraphContainer, false);
135 | var labelXGo = labelX.gameObject;
136 | labelXGo.SetActive(true);
137 | labelX.anchoredPosition = new Vector2(xPosition, -7f);
138 | labelX.GetComponent().text = getAxisLabelX(i);
139 | LabelXObjects.Add(labelXGo);
140 |
141 | var dashX = Instantiate(_dashTemplateX, GraphContainer, false);
142 | var dashXGo = dashX.gameObject;
143 | dashXGo.SetActive(true);
144 | dashX.anchoredPosition = new Vector2(yPosition, -3);
145 | DashXObjects.Add(dashXGo);
146 |
147 | xIndex++;
148 | }
149 |
150 | const int separatorCount = 10;
151 | for (var i = 0; i <= separatorCount; i++)
152 | {
153 | var labelY = Instantiate(_labelTemplateY, GraphContainer, false);
154 | var labelYGo = labelY.gameObject;
155 | labelYGo.SetActive(true);
156 | var normalizedValue = i * 1f / separatorCount;
157 | labelY.anchoredPosition = new Vector2(-7f, normalizedValue * graphHeight);
158 | labelY.GetComponent().text = getAxisLabelY(yMinimum + (normalizedValue * (yMaximum - yMinimum)));
159 | LabelYObjects.Add(labelYGo);
160 |
161 | var dashY = Instantiate(_dashTemplateY, GraphContainer, false);
162 | var dashYGo = dashY.gameObject;
163 | dashYGo.SetActive(true);
164 | dashY.anchoredPosition = new Vector2(-4f, normalizedValue * graphHeight);
165 | DashYObjects.Add(dashYGo);
166 | }
167 | }
168 |
169 | private GameObject CreateCircle(Vector2 anchoredPosition, bool makeDotsVisible)
170 | {
171 | var go = new GameObject("Circle", typeof(ImageView));
172 | go.transform.SetParent(GraphContainer, false);
173 | var image = go.GetComponent();
174 | image.sprite = circleSprite;
175 | image.useSpriteMesh = true;
176 | image.enabled = makeDotsVisible;
177 |
178 | var rectTransform = go.GetComponent();
179 | rectTransform.anchoredPosition = anchoredPosition;
180 | rectTransform.sizeDelta = new Vector2(8, 8);
181 | rectTransform.anchorMin = new Vector2(0, 0);
182 | rectTransform.anchorMax = new Vector2(0, 0);
183 |
184 | return go;
185 | }
186 |
187 | private GameObject CreateDotConnection(Vector2 dotPositionA, Vector2 dotPositionB, bool makeLinkVisible, Color linkColor)
188 | {
189 | var go = new GameObject("DotConnection", typeof(ImageView));
190 | go.transform.SetParent(GraphContainer, false);
191 |
192 | var image = go.GetComponent();
193 | image.color = linkColor;
194 | image.enabled = makeLinkVisible;
195 |
196 | var rectTransform = go.GetComponent();
197 | var dir = (dotPositionB - dotPositionA).normalized;
198 | var distance = Vector2.Distance(dotPositionA, dotPositionB);
199 | rectTransform.anchorMin = new Vector2(0, 0);
200 | rectTransform.anchorMax = new Vector2(0, 0);
201 | rectTransform.sizeDelta = new Vector2(distance, 2f);
202 | rectTransform.anchoredPosition = dotPositionA + dir * distance * .5f;
203 | rectTransform.localEulerAngles = new Vector3(0, 0, Mathf.Atan2(dir.y, dir.x) * Mathf.Rad2Deg);
204 |
205 | return go;
206 | }
207 |
208 | private void ClearOldData()
209 | {
210 | static void ClearGameObjectList(ICollection? list)
211 | {
212 | if (list == null)
213 | {
214 | return;
215 | }
216 |
217 | foreach (var go in list)
218 | {
219 | Destroy(go);
220 | }
221 |
222 | list.Clear();
223 | }
224 |
225 | ClearGameObjectList(DotObjects);
226 | ClearGameObjectList(LinkObjects);
227 | ClearGameObjectList(LabelXObjects);
228 | ClearGameObjectList(LabelYObjects);
229 | ClearGameObjectList(DashXObjects);
230 | ClearGameObjectList(DashYObjects);
231 | }
232 | }
233 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Directory.Build.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | True
6 | BSIPA
7 | True
8 | manifest.json
9 |
10 |
11 |
12 |
13 | Eris
14 |
15 |
16 |
17 | True
18 |
19 |
20 |
21 | False
22 |
23 |
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Installers/ScvAppInstaller.cs:
--------------------------------------------------------------------------------
1 | using SongChartVisualizer.Services;
2 | using Zenject;
3 |
4 | namespace SongChartVisualizer.Installers
5 | {
6 | internal class ScvAppInstaller : Installer
7 | {
8 | private readonly PluginConfig _config;
9 |
10 | public ScvAppInstaller(PluginConfig config)
11 | {
12 | _config = config;
13 | }
14 |
15 | public override void InstallBindings()
16 | {
17 | Container.BindInstance(_config).AsSingle();
18 | Container.BindInterfacesAndSelfTo().AsSingle().Lazy();
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Installers/SvcGameInstaller.cs:
--------------------------------------------------------------------------------
1 | using SongChartVisualizer.UI.ViewControllers;
2 | using Zenject;
3 |
4 | namespace SongChartVisualizer.Installers
5 | {
6 | internal class SvcGameInstaller : Installer
7 | {
8 | private readonly PluginConfig _pluginConfig;
9 | private readonly GameplayCoreSceneSetupData _gameCoreSceneSetupData;
10 |
11 | public SvcGameInstaller(PluginConfig pluginConfig, GameplayCoreSceneSetupData gameplayCoreSceneSetupData)
12 | {
13 | _pluginConfig = pluginConfig;
14 | _gameCoreSceneSetupData = gameplayCoreSceneSetupData;
15 | }
16 |
17 | public override void InstallBindings()
18 | {
19 | if (!_pluginConfig.EnablePlugin
20 | || _gameCoreSceneSetupData.playerSpecificSettings.noTextsAndHuds
21 | || _gameCoreSceneSetupData.gameplayModifiers.zenMode
22 | || _gameCoreSceneSetupData.transformedBeatmapData == null
23 | || _gameCoreSceneSetupData.transformedBeatmapData.cuttableNotesCount == 0)
24 | {
25 | return;
26 | }
27 |
28 | Container.BindInterfacesAndSelfTo().FromNewComponentAsViewController().AsSingle();
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Installers/SvcMenuInstaller.cs:
--------------------------------------------------------------------------------
1 | using SongChartVisualizer.UI;
2 | using SongChartVisualizer.UI.ViewControllers;
3 | using Zenject;
4 |
5 | namespace SongChartVisualizer.Installers
6 | {
7 | internal class SvcMenuInstaller : Installer
8 | {
9 | public override void InstallBindings()
10 | {
11 | Container.Bind().AsSingle();
12 | Container.BindInterfacesAndSelfTo().AsSingle();
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Models/NpsInfo.cs:
--------------------------------------------------------------------------------
1 | namespace SongChartVisualizer.Models
2 | {
3 | internal class NpsInfo
4 | {
5 | public readonly float Nps;
6 | public readonly float FromTime;
7 | public readonly float ToTime;
8 |
9 | public NpsInfo(float nps, float fromTime, float toTime)
10 | {
11 | Nps = nps;
12 | FromTime = fromTime;
13 | ToTime = toTime;
14 | }
15 | }
16 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Plugin.cs:
--------------------------------------------------------------------------------
1 | using IPA;
2 | using IPA.Config;
3 | using IPA.Config.Stores;
4 | using IPA.Logging;
5 | using SiraUtil.Zenject;
6 | using SongChartVisualizer.Installers;
7 |
8 | namespace SongChartVisualizer
9 | {
10 | [Plugin(RuntimeOptions.DynamicInit), NoEnableDisable]
11 | public class Plugin
12 | {
13 | [Init]
14 | public Plugin(Logger logger, Config config, Zenjector zenject)
15 | {
16 | zenject.UseLogger(logger);
17 | zenject.UseMetadataBinder();
18 |
19 | zenject.Install(Location.App,config.Generated());
20 | zenject.Install(Location.Menu);
21 | zenject.Install(Location.StandardPlayer | Location.MultiPlayer);
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/PluginConfig.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.CompilerServices;
3 | using IPA.Config.Stores;
4 | using IPA.Config.Stores.Attributes;
5 | using IPA.Config.Stores.Converters;
6 | using UnityEngine;
7 |
8 | [assembly: InternalsVisibleTo(GeneratedStore.AssemblyVisibilityTarget)]
9 | namespace SongChartVisualizer
10 | {
11 | internal class PluginConfig
12 | {
13 | public virtual bool EnablePlugin { get; set; } = true;
14 | public virtual bool PeakWarning { get; set; } = true;
15 |
16 | [Ignore]
17 | public virtual Vector3 ChartSize { get; } = new Vector2(105, 65);
18 |
19 | [UseConverter]
20 | public virtual Vector3 ChartStandardLevelPosition { get; set; } = new Vector3(0, -0.4f, 2.25f);
21 |
22 | [UseConverter]
23 | public virtual Vector3 ChartStandardLevelRotation { get; set; } = new Vector3(35, 0, 0);
24 |
25 | [UseConverter]
26 | public virtual Vector3 Chart360LevelPosition { get; set; } = new Vector3(0, 3.5f, 3);
27 |
28 | [UseConverter]
29 | public virtual Vector3 Chart360LevelRotation { get; set; } = new Vector3(-30, 0, 0);
30 |
31 | public virtual bool HasBackground { get; set; } = false;
32 | public virtual float BackgroundOpacity { get; set; } = .05f;
33 |
34 | [UseConverter(typeof(HexColorConverter))]
35 | public virtual Color BackgroundColor { get; set; } = Color.blue;
36 |
37 | [Ignore]
38 | public Color CombinedBackgroundColor => new Color(BackgroundColor.r, BackgroundColor.b, BackgroundColor.b, BackgroundOpacity);
39 |
40 | [UseConverter(typeof(HexColorConverter))]
41 | public Color LineColor { get; set; } = Color.white;
42 |
43 | [UseConverter(typeof(HexColorConverter))]
44 | public Color PointerColor { get; set; } = Color.green;
45 |
46 | public virtual IDisposable ChangeTransaction() => null!;
47 | }
48 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/Services/ScvAssetLoader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using UnityEngine;
4 |
5 | namespace SongChartVisualizer.Services
6 | {
7 | internal class ScvAssetLoader : IDisposable
8 | {
9 | private Material? _uiNoGlowMaterial;
10 | public Material UINoGlowMaterial => _uiNoGlowMaterial ??= Resources.FindObjectsOfTypeAll().First(x => x.name == "UINoGlow");
11 |
12 | public void Dispose()
13 | {
14 | _uiNoGlowMaterial = null;
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/SongChartVisualizer.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net472
5 | Library
6 | 8
7 | enable
8 | false
9 | ..\Refs
10 | $(LocalRefsDir)
11 | $(MSBuildProjectDirectory)\
12 |
13 |
14 |
15 | full
16 |
17 |
18 |
19 | pdbonly
20 |
21 |
22 |
23 |
24 | $(BeatSaberDir)\Beat Saber_Data\Managed\BeatSaber.ViewSystem.dll
25 | False
26 | False
27 |
28 |
29 | $(BeatSaberDir)\Beat Saber_Data\Managed\DataModels.dll
30 | False
31 | False
32 |
33 |
34 | $(BeatSaberDir)\Beat Saber_Data\Managed\Tweening.dll
35 | False
36 | False
37 |
38 |
39 | $(BeatSaberDir)\Beat Saber_Data\Managed\Unity.TextMeshPro.dll
40 | False
41 |
42 |
43 | $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.AssetBundleModule.dll
44 | False
45 |
46 |
47 | $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.CoreModule.dll
48 | False
49 |
50 |
51 | $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UI.dll
52 | False
53 |
54 |
55 | $(BeatSaberDir)\Beat Saber_Data\Managed\UnityEngine.UIModule.dll
56 | False
57 |
58 |
59 | $(BeatSaberDir)\Beat Saber_Data\Managed\Main.dll
60 | False
61 |
62 |
63 | $(BeatSaberDir)\Beat Saber_Data\Managed\BeatmapCore.dll
64 | False
65 |
66 |
67 | $(BeatSaberDir)\Beat Saber_Data\Managed\GameplayCore.dll
68 | false
69 |
70 |
71 | $(BeatSaberDir)\Beat Saber_Data\Managed\HMUI.dll
72 | False
73 |
74 |
75 | $(BeatSaberDir)\Beat Saber_Data\Managed\IPA.Loader.dll
76 | False
77 |
78 |
79 | $(BeatSaberDir)\Plugins\BSML.dll
80 | False
81 |
82 |
83 | $(BeatSaberDir)\Beat Saber_Data\Managed\Zenject.dll
84 | false
85 |
86 |
87 | $(BeatSaberDir)\Beat Saber_Data\Managed\Zenject-usage.dll
88 | false
89 |
90 |
91 | $(BeatSaberDir)\Plugins\SiraUtil.dll
92 | false
93 |
94 |
95 | $(BeatSaberDir)\Beat Saber_Data\Managed\HMLib.dll
96 | false
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 | all
113 | build; native; contentfiles; analyzers; buildtransitive
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/source/SongChartVisualizer/UI/SettingsControllerManager.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using BeatSaberMarkupLanguage.Settings;
3 | using IPA.Loader;
4 | using SiraUtil.Zenject;
5 | using SongChartVisualizer.UI.ViewControllers;
6 | using Zenject;
7 |
8 | namespace SongChartVisualizer.UI
9 | {
10 | internal sealed class SettingsControllerManager : IInitializable, IDisposable
11 | {
12 | private readonly string _name;
13 | private SettingsController? _settingsHost;
14 |
15 | public SettingsControllerManager(SettingsController settingsHost, UBinder pluginMetadata)
16 | {
17 | _settingsHost = settingsHost;
18 | _name = pluginMetadata.Value.Name;
19 | }
20 |
21 | public void Initialize()
22 | {
23 | BSMLSettings.Instance.AddSettingsMenu($"{_name}", "SongChartVisualizer.UI.Views.settings.bsml", _settingsHost);
24 | }
25 |
26 | public void Dispose()
27 | {
28 | if (_settingsHost == null)
29 | {
30 | return;
31 | }
32 |
33 | BSMLSettings.Instance.RemoveSettingsMenu(_settingsHost);
34 | _settingsHost = null!;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/source/SongChartVisualizer/UI/ViewControllers/ChartViewController.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Reflection;
5 | using BeatSaberMarkupLanguage;
6 | using BeatSaberMarkupLanguage.Attributes;
7 | using BeatSaberMarkupLanguage.FloatingScreen;
8 | using BeatSaberMarkupLanguage.ViewControllers;
9 | using HMUI;
10 | using SiraUtil.Logging;
11 | using SongChartVisualizer.Core;
12 | using SongChartVisualizer.Models;
13 | using SongChartVisualizer.Services;
14 | using TMPro;
15 | using Tweening;
16 | using UnityEngine;
17 | using Zenject;
18 |
19 | namespace SongChartVisualizer.UI.ViewControllers
20 | {
21 | [HotReload(RelativePathToLayout = @"../Views/ChartView.bsml")]
22 | [ViewDefinition("SongChartVisualizer.UI.Views.ChartView.bsml")]
23 | internal class ChartViewController : BSMLAutomaticViewController, IInitializable, ITickable, IDisposable
24 | {
25 | private SiraLog _siraLog = null!;
26 | private PluginConfig _config = null!;
27 | private ScvAssetLoader _assetLoader = null!;
28 |
29 | private AudioTimeSyncController _audioTimeSyncController = null!;
30 | private IReadonlyBeatmapData _beatmapData = null!;
31 | private BeatmapKey _beatmapKey;
32 | private TimeTweeningManager _timeTweeningManager = null!;
33 |
34 | private FloatingScreen _floatingScreen = null!;
35 | private WindowGraph _windowGraph = null!;
36 |
37 | private AssetBundle? _assetBundle;
38 |
39 | private List? _npsSections;
40 | private int _currentSectionIdx;
41 | private NpsInfo? _currentSection;
42 | private GameObject _selfCursor = null!;
43 |
44 | private GameObject? _peakWarningGo;
45 | private int _hardestSectionIdx;
46 | private TextMeshProUGUI? _text;
47 | private float _timeTillPeak;
48 |
49 | private bool _shouldNotRunTick;
50 |
51 | [Inject]
52 | internal void Construct(SiraLog siraLog, PluginConfig config, ScvAssetLoader assetLoader, AudioTimeSyncController audioTimeSyncController,
53 | IReadonlyBeatmapData beatmap, BeatmapKey beatmapKey, TimeTweeningManager timeTweeningManager)
54 | {
55 | _timeTweeningManager = timeTweeningManager;
56 | _assetLoader = assetLoader;
57 | _siraLog = siraLog;
58 | _config = config;
59 | _audioTimeSyncController = audioTimeSyncController;
60 | _beatmapData = beatmap;
61 | _beatmapKey = beatmapKey;
62 |
63 | name = $"{nameof(SongChartVisualizer)} View";
64 | }
65 |
66 | public void Initialize()
67 | {
68 | var is360Level = _beatmapKey.beatmapCharacteristic.requires360Movement;
69 | var pos = is360Level ? _config.Chart360LevelPosition : _config.ChartStandardLevelPosition;
70 | var rot = is360Level
71 | ? Quaternion.Euler(_config.Chart360LevelRotation)
72 | : Quaternion.Euler(_config.ChartStandardLevelRotation);
73 | _floatingScreen = FloatingScreen.CreateFloatingScreen(_config.ChartSize, false, pos, rot, curvatureRadius: 0f, hasBackground: _config.HasBackground);
74 | _floatingScreen.SetRootViewController(this, AnimationType.None);
75 | _floatingScreen.name = nameof(SongChartVisualizer);
76 |
77 | if (_config.HasBackground)
78 | {
79 | var imageView = _floatingScreen.GetComponentInChildren();
80 | imageView.material = _assetLoader.UINoGlowMaterial;
81 | imageView.color = _config.CombinedBackgroundColor;
82 |
83 | transform.SetParent(imageView.transform);
84 | }
85 |
86 | if (_audioTimeSyncController.songLength < 0)
87 | {
88 | _shouldNotRunTick = true;
89 | return;
90 | }
91 |
92 | // _siraLog.Debug($"There are {_beatmapData.beatmapObjectsData.Count(x => x.beatmapObjectType == BeatmapObjectType.Note)} notes");
93 | // _siraLog.Debug($"There are {_beatmapData.beatmapLinesData.Count} lines");
94 |
95 | _npsSections = GetNpsSections(_beatmapData);
96 | #if DEBUG
97 | for (var i = 0; i < _npsSections.Count; i++)
98 | {
99 | var npsInfos = _npsSections[i];
100 | _siraLog.Debug($"Nps at section {i + 1}: {npsInfos.Nps} (from [{npsInfos.FromTime}] to [{npsInfos.ToTime}])");
101 | }
102 | #endif
103 |
104 | _siraLog.Debug("Loading assetbundle..");
105 | var assembly = Assembly.GetExecutingAssembly();
106 | using (var stream = assembly.GetManifestResourceStream("SongChartVisualizer.UI.linegraph"))
107 | {
108 | _assetBundle = AssetBundle.LoadFromStream(stream);
109 | }
110 |
111 | if (!_assetBundle)
112 | {
113 | _siraLog.Warn("Failed to load AssetBundle! The chart will not work properly..");
114 | }
115 | else
116 | {
117 | var prefab = _assetBundle.LoadAsset("LineGraph");
118 | var sprite = _assetBundle.LoadAsset("Circle");
119 | var go = Instantiate(prefab, transform);
120 |
121 | go.transform.Translate(0.04f, 0, 0);
122 | _windowGraph = go.AddComponent();
123 | _windowGraph.circleSprite = sprite;
124 | _windowGraph.transform.localScale /= 10;
125 | var npsValues = _npsSections.Select(info => info.Nps).ToList();
126 | _windowGraph.ShowGraph(npsValues, false, linkColor: _config.LineColor);
127 |
128 | _currentSectionIdx = 0;
129 | _currentSection = _npsSections[_currentSectionIdx];
130 |
131 | CreateSelfCursor(_config.PointerColor);
132 |
133 | if (_config.PeakWarning)
134 | {
135 | var highestValue = _npsSections.Max(info => info.Nps);
136 | _hardestSectionIdx = _npsSections.FindIndex(info => Math.Abs(info.Nps - highestValue) < 0.001f);
137 | PrepareWarningText();
138 |
139 | FadeInTextIfNeeded();
140 | }
141 | }
142 | }
143 |
144 | public void Tick()
145 | {
146 | if (_shouldNotRunTick)
147 | {
148 | return;
149 | }
150 |
151 | if (_audioTimeSyncController.songTime > _currentSection!.ToTime)
152 | {
153 | _currentSectionIdx++;
154 |
155 | if (_currentSectionIdx + 1 >= _npsSections!.Count)
156 | {
157 | _shouldNotRunTick = true;
158 | return;
159 | }
160 |
161 | _currentSection = _npsSections[_currentSectionIdx];
162 |
163 | if (_config.PeakWarning)
164 | {
165 | FadeInTextIfNeeded();
166 | }
167 | }
168 |
169 | var dotPos = Vector3.Lerp(_windowGraph.DotObjects[_currentSectionIdx].GetComponent().position,
170 | _windowGraph.DotObjects[_currentSectionIdx + 1].GetComponent().position,
171 | (_audioTimeSyncController.songTime - _currentSection.FromTime) / (_currentSection.ToTime - _currentSection.FromTime));
172 | dotPos.z -= 0.001f;
173 | _selfCursor.transform.position = dotPos;
174 |
175 | if (_config.PeakWarning && _peakWarningGo!.activeSelf)
176 | {
177 | var timeTillPeakLocal = _currentSection.ToTime - _audioTimeSyncController.songTime;
178 | if (_timeTillPeak - timeTillPeakLocal < 0.05f)
179 | {
180 | return;
181 | }
182 |
183 | _timeTillPeak = timeTillPeakLocal;
184 |
185 | _text!.text = $"You're about to reach the peak difficulty in {_timeTillPeak:F1} seconds!";
186 | }
187 | }
188 |
189 | public void Dispose()
190 | {
191 | if (_assetBundle != null)
192 | {
193 | _assetBundle.Unload(true);
194 | }
195 | }
196 |
197 | ///
198 | /// Make sure to call this method after the npsSections have been added to the windowGraph.
199 | ///
200 | /// The color of the cursor.
201 | private void CreateSelfCursor(Color cursorColor)
202 | {
203 | _selfCursor = new GameObject("SelfCursor");
204 | _selfCursor.transform.SetParent(_windowGraph.GraphContainer, false);
205 |
206 | var image = _selfCursor.AddComponent();
207 | image.sprite = _windowGraph.circleSprite;
208 | image.useSpriteMesh = true;
209 | image.color = cursorColor;
210 |
211 | var rt = _selfCursor.GetComponent();
212 | rt.sizeDelta = new Vector2(11, 11);
213 |
214 | var dotPos = _windowGraph.DotObjects[_currentSectionIdx].GetComponent().position;
215 | dotPos.z -= 0.001f;
216 |
217 | _selfCursor.transform.position = dotPos;
218 | }
219 |
220 | // ReSharper disable once CognitiveComplexity
221 | private List GetNpsSections(IReadonlyBeatmapData beatmapData)
222 | {
223 | var npsSections = new List();
224 |
225 | var songDuration = _audioTimeSyncController.songLength;
226 | if (songDuration < 0)
227 | {
228 | return npsSections;
229 | }
230 |
231 | var notes = beatmapData.GetBeatmapDataItems(0)
232 | .Where(noteData => noteData.gameplayType != NoteData.GameplayType.Bomb)
233 | .OrderBy(s => s.time)
234 | .ToList();
235 |
236 | if (!notes.Any())
237 | {
238 | return npsSections;
239 | }
240 |
241 | var tempNoteCount = 0;
242 | var startingTime = notes[0].time;
243 | npsSections.Add(new NpsInfo(0, 0, startingTime));
244 | for (var i = 0; i < notes.Count; ++i)
245 | {
246 | tempNoteCount += 1;
247 | if (i <= 0 || (i % 25 != 0 && i + 1 != notes.Count))
248 | {
249 | continue;
250 | }
251 |
252 | float nps;
253 | if (tempNoteCount >= 25)
254 | {
255 | nps = tempNoteCount / (notes[i].time - startingTime);
256 | }
257 | else // end of a map or a map with notes.Count < 25
258 | {
259 | // if total notes count < 25 - do the usual way
260 | // if there are more than 25 notes - try to normalize nps with data from tempNoteCount and (25 - tempNoteCount) notes from a section before
261 | nps = notes.Count < 25
262 | ? tempNoteCount / (notes[i].time - notes[0].time)
263 | : 25 / (notes[i].time - notes[i - 25].time);
264 | }
265 |
266 | if (!float.IsInfinity(nps))
267 | {
268 | npsSections.Add(new NpsInfo(nps, startingTime, notes[i].time));
269 | }
270 |
271 | tempNoteCount = 0;
272 | startingTime = notes[i].time;
273 | }
274 |
275 | npsSections.Add(new NpsInfo(0, startingTime, songDuration));
276 |
277 | return npsSections;
278 | }
279 |
280 | private void PrepareWarningText()
281 | {
282 | _peakWarningGo = new GameObject("DiffWarningCanvas");
283 | var canvas = _peakWarningGo.AddComponent