├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ ├── feature_request.yml │ └── help_wanted.yml ├── dependabot.yml └── workflows │ └── build.yml ├── .gitignore ├── CHANGELOG.md ├── Directory.Build.props ├── Directory.Packages.props ├── LICENSE.txt ├── MuseDashModTools.sln ├── MuseDashModTools.sln.DotSettings ├── MuseDashModTools.slnx ├── README.md ├── Settings.XamlStyler ├── assets ├── Analysis.png ├── Charts.png ├── Developers.png ├── MainView.png ├── Setting.png ├── Translator1.png └── Translator2.png ├── global.json ├── src ├── MuseDashModTools.Abstractions │ ├── DownloadServices │ │ ├── ICustomDownloadService.cs │ │ ├── IDownloadManager.cs │ │ ├── IDownloadService.cs │ │ ├── IGitHubDownloadService.cs │ │ ├── IGitHubMirrorDownloadService.cs │ │ └── IGiteeDownloadService.cs │ ├── GlobalUsings.cs │ ├── IFileSystemPickerService.cs │ ├── IFileSystemService.cs │ ├── ILocalService.cs │ ├── IMessageBoxService.cs │ ├── IModManageService.cs │ ├── IPlatformService.cs │ ├── IResourceService.cs │ ├── ISettingService.cs │ ├── IUpdateService.cs │ ├── MuseDashModTools.Abstractions.csproj │ ├── MuseDashModTools.Abstractions.csproj.DotSettings │ └── Serializations │ │ ├── IJsonSerializationService.cs │ │ └── ISerializationService.cs ├── MuseDashModTools.Common │ ├── Attributes │ │ └── LazyProxyAttribute.cs │ ├── AvaloniaResources.cs │ ├── BuildInfo.cs │ ├── Collections │ │ ├── BiDictionary.cs │ │ └── FrozenBiDictionary.cs │ ├── Extensions │ │ └── StringExtensions.cs │ ├── GitHub │ │ ├── GitHubConstants.cs │ │ └── GitHubResources.cs │ ├── MuseDashModTools.Common.csproj │ ├── MuseDashModTools.Common.csproj.DotSettings │ └── PageNames.cs ├── MuseDashModTools.Core.Generators │ ├── BuildInfo.cs │ ├── Generators │ │ ├── LazyProxyExtensionsGenerator.cs │ │ └── LazyProxyGenerator.cs │ ├── GlobalUsings.cs │ ├── IndentedStringBuilder.cs │ ├── MuseDashModTools.Core.Generators.csproj │ ├── MuseDashModTools.Core.Generators.csproj.DotSettings │ ├── Properties │ │ └── launchSettings.json │ └── SourceGenerationText.cs ├── MuseDashModTools.Core │ ├── BannedSymbols.txt │ ├── Extensions │ │ ├── ByteExtensions.cs │ │ └── CoreServiceExtensions.cs │ ├── GlobalUsings.cs │ ├── Logger │ │ ├── AnsiEscapeColors.cs │ │ ├── LogConsoleFormatter.cs │ │ └── LogFileFormatter.cs │ ├── MuseDashModTools.Core.csproj │ ├── MuseDashModTools.Core.csproj.DotSettings │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Proxies │ │ └── TopLevelProxy.cs │ ├── Services │ │ ├── DownloadServices │ │ │ ├── CustomDownloadService.cs │ │ │ ├── DownloadManager.cs │ │ │ ├── GitHubMirrorDownloadService │ │ │ │ ├── GitHubMirrorDownloadService.Private.cs │ │ │ │ └── GitHubMirrorDownloadService.cs │ │ │ ├── GiteeDownloadService.cs │ │ │ └── GithubDownloadService │ │ │ │ ├── GitHubDownloadService.Private.cs │ │ │ │ └── GitHubDownloadService.cs │ │ ├── FileSystemPickerService.cs │ │ ├── FileSystemService.cs │ │ ├── JsonSerializationService.cs │ │ ├── LocalService │ │ │ ├── LocalService.Private.cs │ │ │ └── LocalService.cs │ │ ├── MessageBoxService.cs │ │ ├── ModManageService │ │ │ ├── ModManageService.Private.cs │ │ │ └── ModManageService.cs │ │ ├── PlatformServices │ │ │ ├── LinuxService.cs │ │ │ ├── MacOSService.cs │ │ │ └── WindowsService.cs │ │ ├── ResourceService.cs │ │ ├── SavingService │ │ │ ├── SavingService.Private.cs │ │ │ └── SettingService.cs │ │ └── UpdateService │ │ │ ├── UpdateService.Private.cs │ │ │ └── UpdateService.cs │ ├── SourceGenerationContext.cs │ └── Utils │ │ ├── DesktopUtils.cs │ │ └── HashUtils.cs ├── MuseDashModTools.Generators │ ├── BuildInfo.cs │ ├── Generators │ │ ├── PageNavigateGenerator.cs │ │ └── ServiceExtensionsGenerator.cs │ ├── GlobalUsings.cs │ ├── IndentedStringBuilder.cs │ ├── MuseDashModTools.Generators.csproj │ ├── MuseDashModTools.Generators.csproj.DotSettings │ ├── Properties │ │ └── launchSettings.json │ └── SourceGenerationText.cs ├── MuseDashModTools.Localization │ ├── General │ │ ├── Resources.Designer.cs │ │ ├── Resources.de.resx │ │ ├── Resources.es.resx │ │ ├── Resources.fr.resx │ │ ├── Resources.hr.resx │ │ ├── Resources.hu.resx │ │ ├── Resources.ja.resx │ │ ├── Resources.ko.resx │ │ ├── Resources.resx │ │ ├── Resources.ru.resx │ │ ├── Resources.zh-Hans.resx │ │ └── Resources.zh-Hant.resx │ ├── ModDescription │ │ ├── Resources.Designer.cs │ │ ├── Resources.de.resx │ │ ├── Resources.es.resx │ │ ├── Resources.fr.resx │ │ ├── Resources.hr.resx │ │ ├── Resources.hu.resx │ │ ├── Resources.ja.resx │ │ ├── Resources.ko.resx │ │ ├── Resources.resx │ │ ├── Resources.ru.resx │ │ ├── Resources.zh-Hans.resx │ │ └── Resources.zh-Hant.resx │ ├── MsgBox │ │ ├── Resources.Designer.cs │ │ ├── Resources.de.resx │ │ ├── Resources.es.resx │ │ ├── Resources.fr.resx │ │ ├── Resources.hr.resx │ │ ├── Resources.hu.resx │ │ ├── Resources.ja.resx │ │ ├── Resources.ko.resx │ │ ├── Resources.resx │ │ ├── Resources.ru.resx │ │ ├── Resources.zh-Hans.resx │ │ └── Resources.zh-Hant.resx │ ├── MuseDashModTools.Localization.csproj │ └── XAML │ │ ├── Resources.Designer.cs │ │ ├── Resources.de.resx │ │ ├── Resources.es.resx │ │ ├── Resources.fr.resx │ │ ├── Resources.hr.resx │ │ ├── Resources.hu.resx │ │ ├── Resources.ja.resx │ │ ├── Resources.ko.resx │ │ ├── Resources.resx │ │ ├── Resources.ru.resx │ │ ├── Resources.zh-Hans.resx │ │ └── Resources.zh-Hant.resx ├── MuseDashModTools.Models │ ├── AppState.cs │ ├── Chart │ │ ├── Analytic.cs │ │ ├── Chart.cs │ │ ├── InfoJson.cs │ │ └── MapInfo.cs │ ├── Config.cs │ ├── Controls │ │ ├── ContributorCardItem.cs │ │ ├── ContributorGroup.cs │ │ ├── ContributorLink.cs │ │ ├── DropDownButtonItem.cs │ │ ├── DropDownMenuItem.cs │ │ └── NavItem.cs │ ├── DTOs │ │ ├── LibDto.cs │ │ └── ModDto.cs │ ├── Enums │ │ ├── AskType.cs │ │ ├── ChartFilterType.cs │ │ ├── ChartSortOptions.cs │ │ ├── DeleteOption.cs │ │ ├── DownloadSource.cs │ │ ├── ModFilterType.cs │ │ ├── ModState.cs │ │ └── UpdateSource.cs │ ├── GitHub │ │ ├── GitHubRSS.cs │ │ ├── GitHubRelease.cs │ │ ├── GitHubReleaseAsset.cs │ │ ├── GitHubRepoContent.cs │ │ ├── GitHubRepoContentLinks.cs │ │ └── ReadmeContent.cs │ ├── GlobalUsings.cs │ ├── Language.cs │ ├── Lib.cs │ ├── Mapper.cs │ ├── Mod.cs │ ├── MuseDashModTools.Models.csproj │ └── MuseDashModTools.Models.csproj.DotSettings ├── MuseDashModTools.Styles │ ├── ExtendControls │ │ ├── DifficultyFilter.axaml │ │ ├── DifficultyFilter.axaml.cs │ │ ├── ImageButton.axaml │ │ ├── ImageButton.axaml.cs │ │ ├── NaviPanelListControl.axaml │ │ └── NaviPanelListControl.axaml.cs │ ├── GlobalUsing.cs │ ├── ModToolsStyles.axaml │ ├── MuseDashModTools.Styles.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Resources │ │ ├── DarkResource.axaml │ │ ├── LightResource.axaml │ │ └── SharedResource.axaml │ ├── Styles │ │ ├── BorderStyles.axaml │ │ ├── ButtonStyles.axaml │ │ ├── ImageStyles.axaml │ │ ├── LabelStyles.axaml │ │ ├── SplitButtonStyles.axaml │ │ ├── StackPanelStyles.axaml │ │ └── TextBlockStyles.axaml │ └── TemplatedControls │ │ ├── ContributorCardControl.axaml │ │ ├── ContributorCardControl.axaml.cs │ │ ├── Difficulty.axaml │ │ ├── Difficulty.axaml.cs │ │ ├── NaviButtonsControl.axaml │ │ └── NaviButtonsControl.axaml.cs ├── MuseDashModTools.Updater │ ├── Contracts │ │ └── ILocalService.cs │ ├── GlobalUsings.cs │ ├── MuseDashModTools.Updater.csproj │ ├── Program.cs │ └── Services │ │ └── LocalService.cs └── MuseDashModTools │ ├── App.axaml │ ├── App.axaml.cs │ ├── Assets │ ├── Avalonia_Logo.png │ ├── Background-Dark.webp │ ├── Background-Light.webp │ ├── Contributors │ │ ├── Balint.webp │ │ ├── Bigbeesushi.webp │ │ ├── KARPED1EM.webp │ │ ├── MEMOLie.webp │ │ ├── MNight4.webp │ │ ├── Ronner.webp │ │ ├── Shiron Lee.webp │ │ ├── Super Pig.webp │ │ ├── Ultra Rabbit.webp │ │ ├── aquawtf.webp │ │ ├── lxy.webp │ │ ├── lxymahatma.webp │ │ └── taypexx.webp │ ├── Difficulties │ │ ├── Easy.png │ │ ├── Hard.png │ │ ├── Hidden.png │ │ └── Master.png │ ├── DonationQRs │ │ ├── Alipay.webp │ │ ├── Paypal.webp │ │ └── Wechat.webp │ ├── DotNet_Logo.png │ ├── Genshin.webp │ ├── Icon.ico │ ├── MDMC_Title.webp │ ├── MDMC_Title_Dark.webp │ ├── MDMC_Title_Light.webp │ ├── MIT_Logo.png │ ├── ML_Icon.png │ ├── ML_Text.png │ ├── Melon.webp │ ├── Melon_Blur.webp │ ├── Neko_Blur.webp │ ├── Raw │ │ ├── Avalonia │ │ │ ├── Avalonia_Logo.png │ │ │ ├── Avalonia_Logo.psd │ │ │ └── Avalonia_Logo.svg │ │ ├── Background │ │ │ ├── Background-Dark.png │ │ │ ├── Background-Light.png │ │ │ └── Original.png │ │ ├── Blur │ │ │ ├── Melon_Blur.png │ │ │ ├── Melon_Blur.psd │ │ │ ├── Neko_Blur.png │ │ │ └── Neko_Blur.psd │ │ ├── Contributors │ │ │ ├── Balint.png │ │ │ ├── Bigbeesushi.jpg │ │ │ ├── KARPED1EM.png │ │ │ ├── MEMOLie.png │ │ │ ├── MNight4.png │ │ │ ├── Ronner.jpg │ │ │ ├── Shiron_Lee.jpg │ │ │ ├── Super_Pig.png │ │ │ ├── Ultra_Rabbit.jpg │ │ │ ├── aquawtf.png │ │ │ ├── lxy.png │ │ │ ├── lxymahatma.jpg │ │ │ └── taypexx.jpg │ │ ├── DotNet │ │ │ ├── DotNet_Logo.png │ │ │ ├── DotNet_Logo.psd │ │ │ └── DotNet_Logo.svg │ │ ├── Genshin │ │ │ ├── Genshin.png │ │ │ ├── Genshin.psd │ │ │ └── Genshin.webp │ │ ├── Icon.ico │ │ ├── MDMC_Logo.png │ │ ├── MDMC_Title.png │ │ ├── MIT │ │ │ ├── MIT_Logo.png │ │ │ ├── MIT_Logo.psd │ │ │ └── MIT_Logo.svg │ │ ├── ML_Icon.png │ │ ├── ML_Text.png │ │ ├── Melon.png │ │ ├── Melon_With_Mod.png │ │ ├── MuseDash.png │ │ ├── Neko.png │ │ ├── QR │ │ │ ├── Alipay.png │ │ │ ├── QR.psd │ │ │ └── Wechat.png │ │ └── Title │ │ │ ├── Title-Dark.png │ │ │ ├── Title-Light.png │ │ │ └── Title.psd │ ├── Title-Dark.webp │ ├── Title-Light.webp │ └── classdata.tpk │ ├── BannedSymbols.txt │ ├── Converters │ └── FuncValueConverters.cs │ ├── Extensions │ ├── JsonNodeExtensions.cs │ ├── ServiceExtensions.cs │ ├── StreamReaderExtensions.cs │ ├── StringExtensions.cs │ └── VisualExtensions.cs │ ├── GlobalUsings.cs │ ├── LangKeys.cs │ ├── MuseDashModTools.csproj │ ├── MuseDashModTools.csproj.DotSettings │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── Services │ └── NavigationService.cs │ ├── TrimAssemblyConfig.xml │ ├── Utils │ └── ModDescriptionProvider.cs │ ├── ViewModels │ ├── Dialogs │ │ └── DonationDialogViewModel.cs │ ├── MainWindowViewModel.cs │ ├── NavViewModelBase.cs │ ├── Pages │ │ ├── ChartingPageViewModel.cs │ │ ├── HomePageViewModel.cs │ │ ├── LogAnalysisPageViewModel.cs │ │ ├── ModdingPageViewModel.cs │ │ └── SettingPageViewModel.cs │ ├── Panels │ │ ├── Charting │ │ │ ├── CharterPanelViewModel.cs │ │ │ └── ChartsPanelViewModel.cs │ │ ├── Modding │ │ │ ├── DevelopPanelViewModel.cs │ │ │ ├── MelonLoaderPanelViewModel.cs │ │ │ └── ModsPanelViewModel.cs │ │ └── Setting │ │ │ ├── AboutPanelViewModel.cs │ │ │ ├── AdvancedPanelViewModel.cs │ │ │ ├── AppearancePanelViewModel.cs │ │ │ ├── DownloadPanelViewModel.cs │ │ │ ├── ExperiencePanelViewModel.cs │ │ │ └── FileManagementPanelViewModel.cs │ └── ViewModelBase.cs │ └── Views │ ├── Dialogs │ ├── DonationDialog.axaml │ └── DonationDialog.axaml.cs │ ├── MainWindow.axaml │ ├── MainWindow.axaml.cs │ ├── Pages │ ├── ChartingPage.axaml │ ├── ChartingPage.axaml.cs │ ├── HomePage.axaml │ ├── HomePage.axaml.cs │ ├── LogAnalysisPage.axaml │ ├── LogAnalysisPage.axaml.cs │ ├── ModdingPage.axaml │ ├── ModdingPage.axaml.cs │ ├── SettingPage.axaml │ └── SettingPage.axaml.cs │ └── Panels │ ├── Charting │ ├── CharterPanel.axaml │ ├── CharterPanel.axaml.cs │ ├── ChartsPanel.axaml │ └── ChartsPanel.axaml.cs │ ├── Modding │ ├── DevelopPanel.axaml │ ├── DevelopPanel.axaml.cs │ ├── MelonLoaderPanel.axaml │ ├── MelonLoaderPanel.axaml.cs │ ├── ModsPanel.axaml │ └── ModsPanel.axaml.cs │ └── Setting │ ├── AboutPanel.axaml │ ├── AboutPanel.axaml.cs │ ├── AdvancedPanel.axaml │ ├── AdvancedPanel.axaml.cs │ ├── AppearancePanel.axaml │ ├── AppearancePanel.axaml.cs │ ├── DownloadPanel.axaml │ ├── DownloadPanel.axaml.cs │ ├── ExperiencePanel.axaml │ ├── ExperiencePanel.axaml.cs │ ├── FileManagementPanel.axaml │ └── FileManagementPanel.axaml.cs └── tests ├── MuseDashModTools.Generators.Tests └── MuseDashModTools.Generators.Tests.csproj └── MuseDashModTools.Tests ├── .gitignore ├── CurrentFile.cs ├── GlobalUsings.cs ├── JsonSerializationServiceTest.cs ├── MuseDashModTools.Tests.csproj ├── VerifyChecksTests.cs ├── VerifyGlobalSettings.cs └── snapshots ├── JsonSerializationServiceTest.DeserializeAsyncTest.verified.txt ├── JsonSerializationServiceTest.DeserializeIndentedTest.verified.txt ├── JsonSerializationServiceTest.DeserializeTest.verified.txt ├── JsonSerializationServiceTest.SerializeAsyncTest.verified.txt ├── JsonSerializationServiceTest.SerializeIndentedTest.verified.txt └── JsonSerializationServiceTest.SerializeTest.verified.txt /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Tell us a bug 3 | title: "[Bug]: " 4 | labels: "bug" 5 | body: 6 | - type: checkboxes 7 | id: checking1 8 | attributes: 9 | label: I'm using the latest build release of Muse Dash Mod Tools and this problem still exists. 10 | options: 11 | - label: "Yes" 12 | required: true 13 | 14 | - type: checkboxes 15 | id: checking2 16 | attributes: 17 | label: There are no similar issues on the issue list 18 | description: https://github.com/MDModsDev/MuseDashModToolsUI/issues 19 | options: 20 | - label: "Yes" 21 | required: true 22 | 23 | - type: dropdown 24 | id: os 25 | attributes: 26 | label: Operating system 27 | description: which OS you are using ? 28 | options: 29 | - Windows 10 and below 30 | - Windows 11 31 | - Ubuntu 32 | - Other Linux distribution 33 | validations: 34 | required: true 35 | 36 | - type: textarea 37 | id: bug_detail 38 | attributes: 39 | label: Bug Detail 40 | placeholder: Please describe your problem in detail 41 | validations: 42 | required: true 43 | 44 | - type: textarea 45 | id: screenshot 46 | attributes: 47 | label: Screenshots (Optional) 48 | placeholder: |- 49 | Clicking on this box and drag your screenshots or videos here to upload. 50 | Make sure the screenshots or videos are displayed normally after submitting the issue 51 | validations: 52 | required: false 53 | 54 | - type: textarea 55 | id: logs 56 | attributes: 57 | label: Logs 58 | placeholder: |- 59 | 1. Go to Logs folder under the application folder (usually MuseDashModToolsUI\Logs) and choose the bottom file. 60 | 2. If the application crashed, it should automatically open the folder and select the log file 61 | 3. Drag and drop the log file (*.log) here 62 | validations: 63 | required: true 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Discord 4 | url: https://discord.gg/mdmc 5 | about: If you have any questions, you can ask them on MDMC Discord server. 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: What things do you think is needed to add into Muse Dash Mod Tools UI 3 | title: "[Feature Request]: " 4 | labels: "enhancement" 5 | body: 6 | - type: textarea 7 | id: introduction 8 | attributes: 9 | label: Brief Introduction 10 | placeholder: Briefly describes the functions you want to add 11 | validations: 12 | required: true 13 | 14 | - type: textarea 15 | id: detail 16 | attributes: 17 | label: Details 18 | placeholder: More details like method parameters or what specifically the variables could do 19 | validations: 20 | required: true 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/help_wanted.yml: -------------------------------------------------------------------------------- 1 | name: Help Wanted 2 | description: You've met a problem and need help 3 | title: "[Help Wanted]: " 4 | labels: "help wanted" 5 | body: 6 | - type: dropdown 7 | id: os 8 | attributes: 9 | label: Operating system 10 | description: which OS you are using ? 11 | options: 12 | - Windows 10 and below 13 | - Windows 11 14 | - Ubuntu 15 | - Other Linux distribution 16 | validations: 17 | required: true 18 | 19 | - type: textarea 20 | id: problem_detail 21 | attributes: 22 | label: Problem Detail (Optional) 23 | placeholder: Please describe your problem 24 | validations: 25 | required: false 26 | 27 | - type: textarea 28 | id: screenshot 29 | attributes: 30 | label: Screenshots (Optional) 31 | placeholder: |- 32 | Clicking on this box and drag your screenshots or videos here to upload. 33 | Make sure the screenshots or videos are displayed normally after submitting the issue 34 | validations: 35 | required: false 36 | 37 | - type: textarea 38 | id: logs 39 | attributes: 40 | label: Logs 41 | placeholder: |- 42 | 1. Go to Logs folder under the application folder (usually MuseDashModToolsUI\Logs) and choose the bottom file. 43 | 2. If the application crashed, it should automatically open the folder and select the log file 44 | 3. Drag and drop the log file (*.log) here 45 | validations: 46 | required: true 47 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "nuget" 4 | target-branch: "dev/rewrite" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | open-pull-requests-limit: 10 9 | 10 | - package-ecosystem: "github-actions" 11 | target-branch: "dev/rewrite" 12 | directory: "/" 13 | schedule: 14 | interval: "daily" -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build and Test Project 2 | 3 | on: 4 | push: 5 | branches: 6 | - 'master' 7 | - 'dev' 8 | tags: 9 | - 'v?[0-9]+.[0-9]+.[0-9]+' 10 | paths: 11 | - src/** 12 | - tests/** 13 | pull_request: 14 | branches: 15 | - 'master' 16 | - 'dev' 17 | workflow_dispatch: 18 | 19 | defaults: 20 | run: 21 | shell: bash 22 | 23 | jobs: 24 | build: 25 | strategy: 26 | fail-fast: false 27 | matrix: 28 | build-type: 29 | - Debug 30 | - Release 31 | target-platform: 32 | - { os: ubuntu-latest, name: linux } 33 | - { os: windows-latest, name: win } 34 | target-arch: 35 | - x64 36 | - arm64 37 | dotnet-version: 38 | - '9.0' 39 | runs-on: ${{ matrix.target-platform.os }} 40 | steps: 41 | - name: Checkout 42 | uses: actions/checkout@v4 43 | 44 | - name: Setup dotnet 45 | uses: actions/setup-dotnet@v4 46 | with: 47 | dotnet-version: ${{ matrix.dotnet-version }} 48 | 49 | - name: Build Project 50 | run: | 51 | dotnet publish -a ${{ matrix.target-arch }} -c ${{ matrix.build-type }} 52 | 53 | - name: Test Project 54 | run: | 55 | dotnet test -c ${{ matrix.build-type }} 56 | 57 | - name: List Result 58 | working-directory: ./ 59 | run: | 60 | ls -l bin/${{ matrix.build-type }}/net${{ matrix.dotnet-version }}/${{matrix.target-platform.name}}-${{ matrix.target-arch }}/publish 61 | 62 | - name: Upload Artifacts 63 | uses: actions/upload-artifact@v4 64 | with: 65 | name: MuseDashModTools-${{ matrix.build-type }}-${{matrix.target-platform.name}}-net${{ matrix.dotnet-version }}-${{ matrix.target-arch }} 66 | path: bin/${{ matrix.build-type }}/net${{ matrix.dotnet-version }}/${{matrix.target-platform.name}}-${{ matrix.target-arch }}/publish/* 67 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | enable 5 | preview 6 | enable 7 | true 8 | 9 | 10 | 11 | none 12 | 13 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024-2025 MDModsDev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MuseDashModTools.sln.DotSettings: -------------------------------------------------------------------------------- 1 |  4 | True -------------------------------------------------------------------------------- /MuseDashModTools.slnx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Settings.XamlStyler: -------------------------------------------------------------------------------- 1 | { 2 | "AttributesTolerance": 2, 3 | "KeepFirstAttributeOnSameLine": true, 4 | "MaxAttributeCharactersPerLine": 0, 5 | "MaxAttributesPerLine": 1, 6 | "NewlineExemptionElements": "RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransform, SkewTransform, RotateTransform, TranslateTransform, Trigger, Condition, Setter", 7 | "SeparateByGroups": true, 8 | "AttributeIndentation": 0, 9 | "AttributeIndentationStyle": 1, 10 | "RemoveDesignTimeReferences": false, 11 | "IgnoreDesignTimeReferencePrefix": false, 12 | "EnableAttributeReordering": true, 13 | "AttributeOrderingRuleGroups": [ 14 | "xmlns, xmlns:x", 15 | "xmlns:*", 16 | "x:Class, x:DataType", 17 | "DataContext", 18 | "x:Key, Key, x:Name, Name, x:Uid, Uid, x:*, Title", 19 | "Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, DockPanel.Dock, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom", 20 | "Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight", 21 | "Margin, Padding, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment, Panel.ZIndex", 22 | "PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint", 23 | "mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText, d:*", 24 | "Storyboard.*, From, To, Duration", 25 | "*:*, *" 26 | ], 27 | "FirstLineAttributes": "Name, x:Name, Grid.Row, Grid.Column", 28 | "OrderAttributesByName": true, 29 | "PutEndingBracketOnNewLine": false, 30 | "RemoveEndingTagOfEmptyElement": true, 31 | "SpaceBeforeClosingSlash": true, 32 | "RootElementLineBreakRule": 0, 33 | "ReorderVSM": 2, 34 | "ReorderGridChildren": true, 35 | "ReorderCanvasChildren": false, 36 | "ReorderSetters": 3, 37 | "FormatMarkupExtension": true, 38 | "NoNewLineMarkupExtensions": "x:Bind, Binding, TemplateBinding", 39 | "ThicknessSeparator": 2, 40 | "ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin", 41 | "FormatOnSave": true, 42 | "CommentPadding": 2 43 | } -------------------------------------------------------------------------------- /assets/Analysis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/assets/Analysis.png -------------------------------------------------------------------------------- /assets/Charts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/assets/Charts.png -------------------------------------------------------------------------------- /assets/Developers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/assets/Developers.png -------------------------------------------------------------------------------- /assets/MainView.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/assets/MainView.png -------------------------------------------------------------------------------- /assets/Setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/assets/Setting.png -------------------------------------------------------------------------------- /assets/Translator1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/assets/Translator1.png -------------------------------------------------------------------------------- /assets/Translator2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/assets/Translator2.png -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.0", 4 | "rollForward": "latestMajor", 5 | "allowPrerelease": true 6 | } 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/DownloadServices/ICustomDownloadService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface ICustomDownloadService : IDownloadService; -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/DownloadServices/IDownloadManager.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IDownloadManager : IDownloadService; -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/DownloadServices/IDownloadService.cs: -------------------------------------------------------------------------------- 1 | using Downloader; 2 | 3 | namespace MuseDashModTools.Abstractions; 4 | 5 | public interface IDownloadService 6 | { 7 | Task DownloadMelonLoaderAsync( 8 | EventHandler onDownloadStarted, 9 | IProgress downloadProgress, 10 | CancellationToken cancellationToken = default); 11 | 12 | Task DownloadModAsync(ModDto mod, CancellationToken cancellationToken = default); 13 | Task DownloadLibAsync(LibDto lib, CancellationToken cancellationToken = default); 14 | Task DownloadReleaseByTagAsync(string tag, CancellationToken cancellationToken = default); 15 | Task FetchReadmeAsync(string repoId, CancellationToken cancellationToken = default); 16 | IAsyncEnumerable GetModListAsync(CancellationToken cancellationToken = default); 17 | IAsyncEnumerable GetLibListAsync(CancellationToken cancellationToken = default); 18 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/DownloadServices/IGitHubDownloadService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IGitHubDownloadService : IDownloadService; -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/DownloadServices/IGitHubMirrorDownloadService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IGitHubMirrorDownloadService : IDownloadService; -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/DownloadServices/IGiteeDownloadService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IGiteeDownloadService : IDownloadService; -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System.Diagnostics.CodeAnalysis; 2 | global using MuseDashModTools.Models; 3 | global using MuseDashModTools.Models.Enums; -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/IFileSystemPickerService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IFileSystemPickerService 4 | { 5 | Task GetSingleFolderPathAsync(string dialogTitle); 6 | Task> GetMultipleFolderPathAsync(string dialogTitle); 7 | Task GetSingleFilePathAsync(string dialogTitle); 8 | Task> GetMultipleFilePathAsync(string dialogTitle); 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/IFileSystemService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IFileSystemService 4 | { 5 | bool CheckFileExists(string filePath); 6 | bool TryDeleteFile(string filePath, DeleteOption deleteOption = DeleteOption.FailIfNotFound); 7 | bool CheckDirectoryExists(string directoryPath); 8 | bool TryDeleteDirectory(string directoryPath, DeleteOption deleteOption = DeleteOption.FailIfNotFound); 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/ILocalService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface ILocalService 4 | { 5 | Task CheckDotNetRuntimeInstallAsync(); 6 | Task GetMuseDashFolderAsync(); 7 | IEnumerable GetModFilePaths(); 8 | IEnumerable GetLibFilePaths(); 9 | Task InstallMelonLoaderAsync(); 10 | Task UninstallMelonLoaderAsync(); 11 | ModDto? LoadModFromPath(string filePath); 12 | LibDto LoadLibFromPath(string filePath); 13 | void LaunchGame(bool isModded); 14 | ValueTask ReadGameVersionAsync(); 15 | bool ExtractZipFile(string zipPath, string extractPath); 16 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/IMessageBoxService.cs: -------------------------------------------------------------------------------- 1 | using Ursa.Controls; 2 | 3 | namespace MuseDashModTools.Abstractions; 4 | 5 | public interface IMessageBoxService 6 | { 7 | #region Confirm MessageBox 8 | 9 | public Task WarningConfirmMessageBoxAsync(string message, string title = "Warning"); 10 | 11 | public Task FormatWarningConfirmMessageBoxAsync(string message, params ReadOnlySpan args); 12 | 13 | public Task NoticeConfirmMessageBoxAsync(string message, string title = "Notice"); 14 | 15 | public Task FormatNoticeConfirmMessageBoxAsync(string message, params ReadOnlySpan args); 16 | 17 | #endregion 18 | 19 | #region Error MessageBox 20 | 21 | // Normal 22 | public Task ErrorMessageBoxAsync(string message, string title = "Error"); 23 | 24 | public Task FormatErrorMessageBoxAsync(string message, params ReadOnlySpan args); 25 | 26 | // Overlay 27 | public Task ErrorMessageBoxOverlayAsync(string message, string title = "Error"); 28 | 29 | public Task FormatErrorMessageBoxOverlayAsync(string message, params ReadOnlySpan args); 30 | 31 | #endregion 32 | 33 | #region Notice MessageBox 34 | 35 | // Normal 36 | public Task NoticeMessageBoxAsync(string message, string title = "Notice"); 37 | 38 | public Task FormatNoticeMessageBoxAsync(string message, params ReadOnlySpan args); 39 | 40 | // Overlay 41 | public Task NoticeMessageBoxOverlayAsync(string message, string title = "Notice"); 42 | 43 | #endregion 44 | 45 | #region Success MessageBox 46 | 47 | // Normal 48 | public Task SuccessMessageBoxAsync(string message, string title = "Success"); 49 | 50 | public Task FormatSuccessMessageBoxAsync(string message, params ReadOnlySpan args); 51 | 52 | // Overlay 53 | public Task SuccessMessageBoxOverlayAsync(string message, string title = "Success"); 54 | public Task FormatSuccessMessageBoxOverlayAsync(string message, params ReadOnlySpan args); 55 | 56 | #endregion 57 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/IModManageService.cs: -------------------------------------------------------------------------------- 1 | using DynamicData; 2 | 3 | namespace MuseDashModTools.Abstractions; 4 | 5 | public interface IModManageService 6 | { 7 | Task InitializeModsAsync(SourceCache sourceCache); 8 | Task InstallModAsync(ModDto mod); 9 | Task UninstallModAsync(ModDto mod); 10 | Task ToggleModAsync(ModDto mod); 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/IPlatformService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IPlatformService 4 | { 5 | /// 6 | /// Get OS string for download link 7 | /// 8 | string OsString { get; } 9 | 10 | /// 11 | /// Get game folder path 12 | /// 13 | /// 14 | /// Is success 15 | bool GetGamePath([NotNullWhen(true)] out string? folderPath); 16 | 17 | /// 18 | /// Get Updater file path 19 | /// 20 | /// Created Updater folder path 21 | /// Updater file path 22 | string GetUpdaterFilePath(string folderPath); 23 | 24 | /// 25 | /// Reveal file with path 26 | /// 27 | /// 28 | void RevealFile(string filePath); 29 | 30 | /// 31 | /// Set MD_DIRECTORY environment variable 32 | /// 33 | /// 34 | bool SetPathEnvironmentVariable(); 35 | 36 | /// 37 | /// Open Folder 38 | /// 39 | /// 40 | /// 41 | Task OpenFolderAsync(string folderPath); 42 | 43 | /// 44 | /// Open File 45 | /// 46 | /// 47 | /// 48 | Task OpenFileAsync(string filePath); 49 | 50 | /// 51 | /// Open Uri 52 | /// 53 | /// 54 | /// 55 | Task OpenUriAsync(string uri); 56 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/IResourceService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IResourceService 4 | { 5 | Stream GetAssetAsStream(string fileName); 6 | T? TryGetAppResource(string key) where T : class; 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/ISettingService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface ISettingService 4 | { 5 | Task LoadAsync(); 6 | Task SaveAsync(); 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/IUpdateService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface IUpdateService 4 | { 5 | Task CheckForUpdatesAsync(CancellationToken cancellationToken = default); 6 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/MuseDashModTools.Abstractions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/MuseDashModTools.Abstractions.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  4 | True 5 | True -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/Serializations/IJsonSerializationService.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | 3 | namespace MuseDashModTools.Abstractions; 4 | 5 | public interface IJsonSerializationService : ISerializationService 6 | { 7 | #region AOT Compatible 8 | 9 | ValueTask DeserializeConfigAsync(Stream utf8Json, CancellationToken cancellationToken = default); 10 | Task SerializeConfigAsync(Stream utf8Json, Config value, CancellationToken cancellationToken = default); 11 | 12 | #endregion AOT Compatible 13 | 14 | #region AOT Incompatible 15 | 16 | T? Deserialize(string json, JsonSerializerOptions? options); 17 | T? DeserializeIndented(string json); 18 | 19 | ValueTask DeserializeAsync( 20 | Stream utf8Json, 21 | JsonSerializerOptions? options = null, 22 | CancellationToken cancellationToken = default); 23 | 24 | ValueTask DeserializeIndentedAsync( 25 | Stream utf8Json, 26 | CancellationToken cancellationToken = default); 27 | 28 | string Serialize(T value, JsonSerializerOptions? options); 29 | string SerializeIndented(T value); 30 | 31 | Task SerializeAsync( 32 | Stream utf8Json, 33 | T value, 34 | JsonSerializerOptions? options = null, 35 | CancellationToken cancellationToken = default); 36 | 37 | Task SerializeIndentedAsync( 38 | Stream utf8Json, 39 | T value, 40 | CancellationToken cancellationToken = default); 41 | 42 | #endregion AOT Incompatible 43 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Abstractions/Serializations/ISerializationService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Abstractions; 2 | 3 | public interface ISerializationService 4 | { 5 | T? Deserialize(string text); 6 | 7 | string Serialize(T value); 8 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/Attributes/LazyProxyAttribute.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Common.Attributes; 2 | 3 | [AttributeUsage(AttributeTargets.Class)] 4 | public sealed class LazyProxyAttribute(Type baseType) : Attribute 5 | { 6 | public Type BaseType { get; init; } = baseType; 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/AvaloniaResources.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Styling; 2 | using MuseDashModTools.Common.Collections; 3 | 4 | namespace MuseDashModTools.Common; 5 | 6 | public static class AvaloniaResources 7 | { 8 | public static readonly FrozenBiDictionary ThemeVariants = new BiDictionary 9 | { 10 | ["Light"] = ThemeVariant.Light, 11 | ["Dark"] = ThemeVariant.Dark 12 | }.ToFrozenBiDictionary(); 13 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/BuildInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Common; 2 | 3 | public static class BuildInfo 4 | { 5 | public const string Company = "MDModsDev"; 6 | public const string CopyRight = "Copyright © 2024-2025 MDModsDev"; 7 | public const string Description = "A tool for Muse Dash modding"; 8 | public const string AppName = "MuseDashModTools"; 9 | public const string AppVersion = "2.0.0"; 10 | public const string DisplayVersion = $"v{AppVersion}"; 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/Collections/FrozenBiDictionary.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Frozen; 3 | 4 | namespace MuseDashModTools.Common.Collections; 5 | 6 | public sealed class FrozenBiDictionary(FrozenDictionary forward, FrozenDictionary reverse) 7 | : IEnumerable> 8 | where T1 : notnull 9 | where T2 : notnull 10 | { 11 | public T2 this[T1 key] => forward[key]; 12 | 13 | public T1 this[T2 key] => reverse[key]; 14 | 15 | public IEnumerator> GetEnumerator() => forward.GetEnumerator(); 16 | IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); 17 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Diagnostics.CodeAnalysis; 2 | using System.Text.RegularExpressions; 3 | 4 | namespace MuseDashModTools.Common.Extensions; 5 | 6 | public static class StringExtensions 7 | { 8 | /// 9 | /// Check whether the string is null or empty 10 | /// 11 | /// 12 | /// 13 | public static bool IsNullOrEmpty([NotNullWhen(false)] this string? str) => string.IsNullOrEmpty(str); 14 | 15 | /// 16 | /// Parse level from string 17 | /// 18 | /// 19 | /// 20 | public static int ParseLevel(this string str) => !int.TryParse(str, out var level) ? 0 : level; 21 | 22 | /// 23 | /// Remove invalid chars for file names from string 24 | /// 25 | /// 26 | /// 27 | public static string RemoveInvalidChars(this string str) 28 | { 29 | var invalidFileNameChars = new string(Path.GetInvalidFileNameChars()); 30 | var invalidCharRegex = new Regex($"[{Regex.Escape(invalidFileNameChars)}]"); 31 | return invalidCharRegex.Replace(str, "_"); 32 | } 33 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/GitHub/GitHubConstants.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Common; 2 | 3 | public static class GitHubConstants 4 | { 5 | // GitHub Urls 6 | public const string GitHubBaseUrl = "https://github.com/"; 7 | public const string GitHubAPIBaseUrl = "https://api.github.com/repos/"; 8 | public const string GitHubRawContentBaseUrl = "https://raw.githubusercontent.com/"; 9 | 10 | // Mod Tools Urls 11 | public const string ModToolsRepoIdentifier = "MDModsDev/MuseDashModTools/"; 12 | public const string ModToolsReleaseDownloadBaseUrl = GitHubBaseUrl + ModToolsRepoIdentifier + "releases/download/"; 13 | 14 | // Mod Links Urls 15 | public const string ModLinksRepoIdentifier = "MDModsDev/ModLinks/"; 16 | public const string ModLinksBranch = "dev/"; 17 | public const string ModLinksBaseUrl = ModLinksRepoIdentifier + ModLinksBranch; 18 | 19 | // Download File Urls 20 | public const string MelonLoaderBaseUrl = "LavaGang/MelonLoader/releases/download/v0.6.1/MelonLoader.x64.zip"; 21 | public const string UnityDependencyBaseUrl = "LavaGang/Unity-Runtime-Libraries/master/2019.4.32.zip"; 22 | 23 | public const string Cpp2ILBaseUrl = 24 | "SamboyCoding/Cpp2IL/releases/download/2022.1.0-pre-release.10/Cpp2IL-2022.1.0-pre-release.10-Windows-Netframework472.zip"; 25 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/GitHub/GitHubResources.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Immutable; 2 | 3 | namespace MuseDashModTools.Common; 4 | 5 | public static class GitHubResources 6 | { 7 | public static readonly Dictionary ReadmeCache = []; 8 | 9 | public static ImmutableArray CommonReadmeNames { get; } = ["README.md", "readme.md", "Readme.md", "ReadMe.md", "README.MD"]; 10 | 11 | public static ImmutableArray Branches { get; } = ["main", "master"]; 12 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/MuseDashModTools.Common.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/MuseDashModTools.Common.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  4 | True -------------------------------------------------------------------------------- /src/MuseDashModTools.Common/PageNames.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Common; 2 | 3 | public static class PageNames 4 | { 5 | public const string HomePageName = "Home"; 6 | 7 | public const string ModdingPageName = "Modding"; 8 | public const string ModsPanelName = "Mods"; 9 | public const string MelonLoaderPanelName = "Melon Loader"; 10 | public const string DevelopPanelName = "Develop"; 11 | 12 | public const string ChartingPageName = "Charting"; 13 | public const string ChartsPanelName = "Charts"; 14 | public const string CharterPanelName = "Charter"; 15 | 16 | public const string SettingPageName = "Setting"; 17 | public const string AboutPanelName = "About"; 18 | public const string AppearancePanelName = "Appearance"; 19 | public const string ExperiencePanelName = "Experience"; 20 | public const string FileManagementPanelName = "File Management"; 21 | public const string DownloadPanelName = "Download"; 22 | public const string AdvancedPanelName = "Advanced"; 23 | 24 | public const string LogAnalysisPageName = "Log Analysis"; 25 | public const string ModManagePageName = "Mod Manage"; 26 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core.Generators/BuildInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core.Generators; 2 | 3 | internal static class BuildInfo 4 | { 5 | internal const string SourceGeneratorVersion = "1.0.0"; 6 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core.Generators/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System.Collections.Immutable; 2 | global using Microsoft.CodeAnalysis; 3 | global using Microsoft.CodeAnalysis.CSharp.Syntax; 4 | global using static MuseDashModTools.Core.Generators.BuildInfo; 5 | global using static MuseDashModTools.Core.Generators.SourceGenerationTexts; -------------------------------------------------------------------------------- /src/MuseDashModTools.Core.Generators/MuseDashModTools.Core.Generators.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | true 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Core.Generators/MuseDashModTools.Core.Generators.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  4 | True -------------------------------------------------------------------------------- /src/MuseDashModTools.Core.Generators/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "DebugRoslynSourceGenerator": { 5 | "commandName": "DebugRoslynComponent", 6 | "targetProject": "../MuseDashModTools.Core/MuseDashModTools.Core.csproj" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core.Generators/SourceGenerationText.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core.Generators; 2 | 3 | internal static class SourceGenerationTexts 4 | { 5 | internal const string Header = """ 6 | //------------------------------------------------------------------------------ 7 | // 8 | // This code was generated by the MuseDashModTools source generator 9 | // 10 | // Changes to this file may cause incorrect behavior and will be lost if 11 | // the code is regenerated. 12 | // 13 | //------------------------------------------------------------------------------ 14 | 15 | #nullable enable 16 | 17 | 18 | """; 19 | 20 | internal static string GetGeneratedCodeAttribute(string generatorName) => 21 | $"""[global::System.CodeDom.Compiler.GeneratedCodeAttribute("MuseDashModTools.SourceGenerators.{generatorName}", "{SourceGeneratorVersion}")]"""; 22 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/BannedSymbols.txt: -------------------------------------------------------------------------------- 1 | T:Microsoft.Extensions.Logging.LoggerExtensions;Don't use this, use ZLog instead. -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Extensions/ByteExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core.Extensions; 2 | 3 | public static class ByteExtensions 4 | { 5 | public static string ToHexStringLower(this byte[] bytes) => Convert.ToHexStringLower(bytes); 6 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System.Diagnostics; 2 | global using System.Diagnostics.CodeAnalysis; 3 | global using System.Globalization; 4 | global using System.Runtime.InteropServices; 5 | global using System.Runtime.Versioning; 6 | global using Autofac; 7 | global using Avalonia.Controls; 8 | global using Downloader; 9 | global using JetBrains.Annotations; 10 | global using Microsoft.Extensions.DependencyInjection; 11 | global using Microsoft.Extensions.Logging; 12 | global using MuseDashModTools.Abstractions; 13 | global using MuseDashModTools.Common.Extensions; 14 | global using MuseDashModTools.Core.Extensions; 15 | global using MuseDashModTools.Core.Logger; 16 | global using MuseDashModTools.Core.Proxies; 17 | global using MuseDashModTools.Core.Utils; 18 | global using MuseDashModTools.Models; 19 | global using MuseDashModTools.Models.Enums; 20 | global using MuseDashModTools.Models.GitHub; 21 | global using Semver; 22 | global using Ursa.Controls; 23 | global using ZLogger; 24 | global using static MuseDashModTools.Common.BuildInfo; 25 | global using static MuseDashModTools.Common.GitHubConstants; 26 | global using static MuseDashModTools.Common.GitHubResources; 27 | global using static MuseDashModTools.Core.SourceGenerationContext; 28 | global using static MuseDashModTools.Core.Utils.DesktopUtils; 29 | global using static MuseDashModTools.Localization.General.Resources; 30 | global using static MuseDashModTools.Localization.MsgBox.Resources; 31 | global using IDownloadService = MuseDashModTools.Abstractions.IDownloadService; 32 | global using MultiThreadDownloader = Downloader.DownloadService; -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Logger/AnsiEscapeColors.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core.Logger; 2 | 3 | public static class AnsiEscapeColors 4 | { 5 | public const string Reset = "\e[0m"; 6 | public const string Bold = "\e[1m"; 7 | 8 | public const string Black = "\e[30m"; 9 | public const string Red = "\e[31m"; 10 | public const string Green = "\e[32m"; 11 | public const string Yellow = "\e[33m"; 12 | public const string Blue = "\e[34m"; 13 | public const string Magenta = "\e[35m"; 14 | public const string Cyan = "\e[36m"; 15 | public const string White = "\e[37m"; 16 | 17 | public const string BrightBlack = "\e[30;1m"; 18 | public const string BrightRed = "\e[31;1m"; 19 | public const string BrightGreen = "\e[32;1m"; 20 | public const string BrightYellow = "\e[33;1m"; 21 | public const string BrightBlue = "\e[34;1m"; 22 | public const string BrightMagenta = "\e[35;1m"; 23 | public const string BrightCyan = "\e[36;1m"; 24 | public const string BrightWhite = "\e[37;1m"; 25 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Logger/LogConsoleFormatter.cs: -------------------------------------------------------------------------------- 1 | using System.Buffers; 2 | using Utf8StringInterpolation; 3 | using static MuseDashModTools.Core.Logger.AnsiEscapeColors; 4 | 5 | namespace MuseDashModTools.Core.Logger; 6 | 7 | public sealed class LogConsoleFormatter : IZLoggerFormatter 8 | { 9 | public void FormatLogEntry(IBufferWriter writer, IZLoggerEntry entry) 10 | { 11 | using var utf8Writer = new Utf8StringWriter>(writer); 12 | switch (entry.LogInfo.LogLevel) 13 | { 14 | case LogLevel.Trace: 15 | utf8Writer.Append($"{Blue}[TRC]{Reset}"); 16 | break; 17 | case LogLevel.Debug: 18 | utf8Writer.Append($"{BrightGreen}[DBG]{Reset}"); 19 | break; 20 | case LogLevel.Information: 21 | utf8Writer.Append($"{BrightCyan}[INF]{Reset}"); 22 | break; 23 | case LogLevel.Warning: 24 | utf8Writer.Append($"{Yellow}[WRN]{Reset}"); 25 | break; 26 | case LogLevel.Error: 27 | utf8Writer.Append($"{Red}[ERR]{Reset}"); 28 | break; 29 | case LogLevel.Critical: 30 | utf8Writer.Append($"{BrightRed}[CRT]{Reset}"); 31 | break; 32 | case LogLevel.None: 33 | utf8Writer.Append("[NON]"); 34 | break; 35 | default: 36 | throw new UnreachableException(); 37 | } 38 | 39 | utf8Writer.AppendUtf8("("u8); 40 | utf8Writer.AppendUtf8(entry.LogInfo.Category.Utf8Span[17..]); 41 | utf8Writer.AppendUtf8(") "u8); 42 | utf8Writer.Append(entry.ToString()); 43 | 44 | if (entry.LogInfo.Exception is not { } ex) 45 | { 46 | return; 47 | } 48 | 49 | utf8Writer.AppendLine(); 50 | utf8Writer.Append(ex.ToString()); 51 | } 52 | 53 | public bool WithLineBreak => true; 54 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Logger/LogFileFormatter.cs: -------------------------------------------------------------------------------- 1 | using System.Buffers; 2 | using Utf8StringInterpolation; 3 | 4 | namespace MuseDashModTools.Core.Logger; 5 | 6 | public sealed class LogFileFormatter : IZLoggerFormatter 7 | { 8 | public void FormatLogEntry(IBufferWriter writer, IZLoggerEntry entry) 9 | { 10 | using var utf8Writer = new Utf8StringWriter>(writer); 11 | 12 | utf8Writer.AppendLine($"[{entry.LogInfo.Timestamp.Local:HH:mm:ss.fff zzz}] [{entry.LogInfo.LogLevel}] ({entry.LogInfo.Category})"); 13 | utf8Writer.AppendLine(entry.ToString()); 14 | 15 | if (entry.LogInfo.Exception is { } ex) 16 | { 17 | utf8Writer.AppendLine(ex.ToString()); 18 | } 19 | } 20 | 21 | public bool WithLineBreak => true; 22 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/MuseDashModTools.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("MuseDashModTools.Tests")] -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Proxies/TopLevelProxy.cs: -------------------------------------------------------------------------------- 1 | using MuseDashModTools.Common.Attributes; 2 | 3 | namespace MuseDashModTools.Core.Proxies; 4 | 5 | [LazyProxy(typeof(TopLevel))] 6 | [UsedImplicitly] 7 | public sealed partial class TopLevelProxy; -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/DownloadServices/CustomDownloadService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core; 2 | 3 | internal sealed class CustomDownloadService : ICustomDownloadService 4 | { 5 | public Task DownloadMelonLoaderAsync( 6 | EventHandler onDownloadStarted, 7 | IProgress downloadProgress, 8 | CancellationToken cancellationToken = default) => throw new NotImplementedException(); 9 | 10 | public Task DownloadModAsync(ModDto mod, CancellationToken cancellationToken = default) => throw new NotImplementedException(); 11 | public Task DownloadLibAsync(LibDto lib, CancellationToken cancellationToken = default) => throw new NotImplementedException(); 12 | public Task DownloadReleaseByTagAsync(string tag, CancellationToken cancellationToken = default) => throw new NotImplementedException(); 13 | 14 | public Task FetchReadmeAsync(string repoId, CancellationToken cancellationToken = default) => throw new NotImplementedException(); 15 | 16 | public IAsyncEnumerable GetModListAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException(); 17 | public IAsyncEnumerable GetLibListAsync(CancellationToken cancellationToken = default) => throw new NotImplementedException(); 18 | 19 | #region Injections 20 | 21 | [UsedImplicitly] 22 | public ILogger Logger { get; init; } = null!; 23 | 24 | [UsedImplicitly] 25 | public Config Config { get; init; } = null!; 26 | 27 | #endregion Injections 28 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/DownloadServices/GithubDownloadService/GitHubDownloadService.Private.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | 3 | namespace MuseDashModTools.Core; 4 | 5 | internal sealed partial class GitHubDownloadService 6 | { 7 | private async Task TryFetchContentAsync(string url, CancellationToken cancellationToken) 8 | { 9 | try 10 | { 11 | using var request = new HttpRequestMessage(HttpMethod.Get, url); 12 | var response = await Client.SendAsync(request, cancellationToken).ConfigureAwait(false); 13 | 14 | if (response.StatusCode is HttpStatusCode.NotFound or HttpStatusCode.Forbidden) 15 | { 16 | return null; 17 | } 18 | 19 | response.EnsureSuccessStatusCode(); 20 | 21 | return await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false); 22 | } 23 | catch (Exception ex) 24 | { 25 | Logger.ZLogError(ex, $"Failed to fetch content from URL: {url}"); 26 | return null; 27 | } 28 | } 29 | 30 | private async Task FetchReadmeFromBranchAsync(string repoId, string branch, CancellationToken cancellationToken = default) 31 | { 32 | foreach (var url in CommonReadmeNames.Select(readmeName => $"{GitHubRawContentBaseUrl}{repoId}/{branch}/{readmeName}")) 33 | { 34 | var content = await TryFetchContentAsync(url, cancellationToken).ConfigureAwait(false); 35 | 36 | if (string.IsNullOrEmpty(content)) 37 | { 38 | continue; 39 | } 40 | 41 | Logger.ZLogInformation($"Successfully fetched Readme from branch {branch} of {repoId} using URL: {url}"); 42 | return content; 43 | } 44 | 45 | return null; 46 | } 47 | 48 | private async Task FetchReadmeFromBranchesAsync(string repoId, CancellationToken cancellationToken) 49 | { 50 | foreach (var branch in Branches) 51 | { 52 | var readme = await FetchReadmeFromBranchAsync(repoId, branch, cancellationToken).ConfigureAwait(false); 53 | if (!string.IsNullOrEmpty(readme)) 54 | { 55 | return readme; 56 | } 57 | } 58 | 59 | Logger.ZLogInformation($"No Readme found in any branches for {repoId}"); 60 | return null; 61 | } 62 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/FileSystemPickerService.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Platform.Storage; 2 | 3 | namespace MuseDashModTools.Core; 4 | 5 | internal sealed class FileSystemPickerService : IFileSystemPickerService 6 | { 7 | [UsedImplicitly] 8 | public required TopLevelProxy TopLevel { get; init; } 9 | 10 | public async Task GetSingleFolderPathAsync(string dialogTitle) 11 | { 12 | var dialog = await TopLevel.StorageProvider.OpenFolderPickerAsync( 13 | new FolderPickerOpenOptions 14 | { 15 | AllowMultiple = false, 16 | Title = dialogTitle 17 | }).ConfigureAwait(true); 18 | 19 | return dialog is not [] ? dialog[0].TryGetLocalPath() : null; 20 | } 21 | 22 | public async Task> GetMultipleFolderPathAsync(string dialogTitle) 23 | { 24 | var dialog = await TopLevel.StorageProvider.OpenFolderPickerAsync( 25 | new FolderPickerOpenOptions 26 | { 27 | AllowMultiple = true, 28 | Title = dialogTitle 29 | }).ConfigureAwait(true); 30 | 31 | return dialog.Select(x => x.TryGetLocalPath()); 32 | } 33 | 34 | public async Task GetSingleFilePathAsync(string dialogTitle) 35 | { 36 | var dialog = await TopLevel.StorageProvider.OpenFilePickerAsync( 37 | new FilePickerOpenOptions 38 | { 39 | AllowMultiple = false, 40 | Title = dialogTitle 41 | }).ConfigureAwait(true); 42 | 43 | return dialog is not [] ? dialog[0].TryGetLocalPath() : null; 44 | } 45 | 46 | public async Task> GetMultipleFilePathAsync(string dialogTitle) 47 | { 48 | var dialog = await TopLevel.StorageProvider.OpenFilePickerAsync( 49 | new FilePickerOpenOptions 50 | { 51 | AllowMultiple = true, 52 | Title = dialogTitle 53 | }).ConfigureAwait(true); 54 | 55 | return dialog.Select(x => x.TryGetLocalPath()); 56 | } 57 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/FileSystemService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core; 2 | 3 | internal sealed class FileSystemService : IFileSystemService 4 | { 5 | #region Injections 6 | 7 | [UsedImplicitly] 8 | public required ILogger Logger { get; init; } 9 | 10 | #endregion Injections 11 | 12 | public bool CheckFileExists(string filePath) 13 | { 14 | if (File.Exists(filePath)) 15 | { 16 | return true; 17 | } 18 | 19 | Logger.ZLogError($"{Path.GetFileName(filePath)} does not exists on {filePath}"); 20 | return false; 21 | } 22 | 23 | public bool TryDeleteFile(string filePath, DeleteOption deleteOption = DeleteOption.FailIfNotFound) 24 | { 25 | if (deleteOption == DeleteOption.IgnoreIfNotFound && !File.Exists(filePath)) 26 | { 27 | Logger.ZLogWarning($"{filePath} does not exists, skipping deletion"); 28 | return true; 29 | } 30 | 31 | try 32 | { 33 | File.Delete(filePath); 34 | return true; 35 | } 36 | catch (Exception ex) 37 | { 38 | Logger.ZLogError(ex, $"Failed to delete file {filePath}"); 39 | return false; 40 | } 41 | } 42 | 43 | public bool CheckDirectoryExists(string directoryPath) 44 | { 45 | if (Directory.Exists(directoryPath)) 46 | { 47 | return true; 48 | } 49 | 50 | Logger.ZLogError($"{Path.GetDirectoryName(directoryPath)} does not exists on {directoryPath}"); 51 | return false; 52 | } 53 | 54 | public bool TryDeleteDirectory(string directoryPath, DeleteOption deleteOption = DeleteOption.FailIfNotFound) 55 | { 56 | if (deleteOption == DeleteOption.IgnoreIfNotFound && !Directory.Exists(directoryPath)) 57 | { 58 | Logger.ZLogWarning($"{directoryPath} does not exists, skipping deletion"); 59 | return true; 60 | } 61 | 62 | try 63 | { 64 | Directory.Delete(directoryPath, true); 65 | return true; 66 | } 67 | catch (Exception ex) 68 | { 69 | Logger.ZLogError(ex, $"Failed to delete directory {directoryPath}"); 70 | return false; 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/LocalService/LocalService.Private.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core; 2 | 3 | internal sealed partial class LocalService 4 | { 5 | private async Task CheckValidPathAsync(string folderPath) 6 | { 7 | var exePath = Path.Combine(folderPath, "MuseDash.exe"); 8 | var dllPath = Path.Combine(folderPath, "GameAssembly.dll"); 9 | 10 | if (!File.Exists(exePath) || !File.Exists(dllPath)) 11 | { 12 | Logger.ZLogError($"MuseDash.exe or GameAssembly.dll not found in {folderPath}"); 13 | await MessageBoxService.ErrorMessageBoxAsync(MsgBox_Content_InvalidPath).ConfigureAwait(true); 14 | return false; 15 | } 16 | 17 | Logger.ZLogInformation($"MuseDash.exe and GameAssembly.dll found in {folderPath}"); 18 | return true; 19 | } 20 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/ModManageService/ModManageService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using DynamicData; 3 | 4 | namespace MuseDashModTools.Core; 5 | 6 | internal sealed partial class ModManageService : IModManageService 7 | { 8 | private string _gameVersion = null!; 9 | private ConcurrentDictionary _libsDict = []; 10 | private SourceCache _sourceCache = null!; 11 | 12 | public async Task InitializeModsAsync(SourceCache sourceCache) 13 | { 14 | _sourceCache = sourceCache; 15 | _gameVersion = await LocalService.ReadGameVersionAsync().ConfigureAwait(false); 16 | 17 | await LoadLibsAsync().ConfigureAwait(false); 18 | await LoadModsAsync().ConfigureAwait(false); 19 | } 20 | 21 | public async Task InstallModAsync(ModDto mod) 22 | { 23 | await DownloadManager.DownloadModAsync(mod).ConfigureAwait(false); 24 | CheckLibDependencies(mod); 25 | await EnableModDependenciesAsync(mod).ConfigureAwait(false); 26 | mod.AddLocalInfo(); 27 | } 28 | 29 | public async Task UninstallModAsync(ModDto mod) 30 | { 31 | File.Delete(Path.Combine(Config.ModsFolder, mod.LocalFileName)); 32 | await DisableModDependentsAsync(mod).ConfigureAwait(false); 33 | mod.RemoveLocalInfo(); 34 | } 35 | 36 | public Task ToggleModAsync(ModDto mod) => mod.IsDisabled ? EnableModAsync(mod) : DisableModAsync(mod); 37 | 38 | #region Injections 39 | 40 | [UsedImplicitly] 41 | public required Config Config { get; init; } 42 | 43 | [UsedImplicitly] 44 | public required WindowNotificationManager WindowNotificationManager { get; init; } 45 | 46 | [UsedImplicitly] 47 | public required IDownloadManager DownloadManager { get; init; } 48 | 49 | [UsedImplicitly] 50 | public required ILocalService LocalService { get; init; } 51 | 52 | [UsedImplicitly] 53 | public required ILogger Logger { get; init; } 54 | 55 | [UsedImplicitly] 56 | public required IMessageBoxService MessageBoxService { get; init; } 57 | 58 | #endregion Injections 59 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/PlatformServices/MacOSService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core; 2 | 3 | internal sealed class MacOsService : IPlatformService 4 | { 5 | public string OsString => "MacOS"; 6 | public bool GetGamePath([NotNullWhen(true)] out string? folderPath) => throw new NotImplementedException(); 7 | public string GetUpdaterFilePath(string folderPath) => throw new NotImplementedException(); 8 | public void RevealFile(string filePath) => throw new NotImplementedException(); 9 | public bool SetPathEnvironmentVariable() => throw new NotImplementedException(); 10 | public Task OpenFolderAsync(string folderPath) => throw new NotImplementedException(); 11 | public Task OpenFileAsync(string filePath) => throw new NotImplementedException(); 12 | public Task OpenUriAsync(string uri) => throw new NotImplementedException(); 13 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/ResourceService.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Platform; 2 | 3 | namespace MuseDashModTools.Core; 4 | 5 | internal sealed class ResourceService : IResourceService 6 | { 7 | public Stream GetAssetAsStream(string fileName) => AssetLoader.Open(new Uri($"avares://{nameof(MuseDashModTools)}/Assets/{fileName}")); 8 | 9 | public T? TryGetAppResource(string key) where T : class 10 | { 11 | if (!GetCurrentApplication().TryGetResource(key, out var result)) 12 | { 13 | return null; 14 | } 15 | 16 | return result as T; 17 | } 18 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/SavingService/SavingService.Private.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core; 2 | 3 | internal sealed partial class SettingService 4 | { 5 | private async Task CheckValidSettingAsync() 6 | { 7 | Logger.ZLogInformation($"Checking for valid setting..."); 8 | await CheckMuseDashFolderAsync().ConfigureAwait(true); 9 | 10 | Logger.ZLogInformation($"Checking for valid setting done"); 11 | } 12 | 13 | private async Task CheckMuseDashFolderAsync() 14 | { 15 | if (Config.MuseDashFolder.IsNullOrEmpty()) 16 | { 17 | Logger.ZLogError($"MuseDash folder is null or empty"); 18 | if (PlatformService.GetGamePath(out var folderPath)) 19 | { 20 | var result = await MessageBoxService.NoticeConfirmMessageBoxAsync($"Auto detected MuseDash folder\r\n{folderPath}").ConfigureAwait(true); 21 | Config.MuseDashFolder = result is MessageBoxResult.Yes ? folderPath : await LocalService.GetMuseDashFolderAsync().ConfigureAwait(true); 22 | } 23 | else 24 | { 25 | Logger.ZLogInformation($"Letting user choose MuseDash folder..."); 26 | Config.MuseDashFolder = await LocalService.GetMuseDashFolderAsync().ConfigureAwait(true); 27 | } 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Services/UpdateService/UpdateService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Core; 2 | 3 | internal sealed partial class UpdateService : IUpdateService 4 | { 5 | private const string ReleaseAPIUrl = GitHubAPIBaseUrl + ModToolsRepoIdentifier + "releases"; 6 | private const string LatestReleaseAPIUrl = GitHubAPIBaseUrl + ModToolsRepoIdentifier + "releases/latest"; 7 | private const string TagsRSSUrl = GitHubBaseUrl + ModToolsRepoIdentifier + "tags.atom"; 8 | 9 | private static readonly SemVersion _currentVersion = SemVersion.Parse(AppVersion); 10 | 11 | public Task CheckForUpdatesAsync(CancellationToken cancellationToken = default) 12 | { 13 | return Config.UpdateSource switch 14 | { 15 | UpdateSource.GitHubAPI => CheckGitHubAPIForUpdatesAsync(cancellationToken), 16 | UpdateSource.GitHubRSS => CheckGitHubRSSForUpdatesAsync(cancellationToken), 17 | _ => throw new UnreachableException() 18 | }; 19 | } 20 | 21 | #region Injections 22 | 23 | [UsedImplicitly] 24 | public required HttpClient Client { get; init; } 25 | 26 | [UsedImplicitly] 27 | public required Config Config { get; init; } 28 | 29 | [UsedImplicitly] 30 | public required IDownloadManager DownloadManager { get; init; } 31 | 32 | [UsedImplicitly] 33 | public required ILogger Logger { get; init; } 34 | 35 | [UsedImplicitly] 36 | public required IMessageBoxService MessageBoxService { get; init; } 37 | 38 | #endregion Injections 39 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/SourceGenerationContext.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace MuseDashModTools.Core; 4 | 5 | [JsonSourceGenerationOptions(WriteIndented = true, IndentCharacter = ' ', IndentSize = 4)] 6 | [JsonSerializable(typeof(Config))] 7 | [JsonSerializable(typeof(Mod))] 8 | [JsonSerializable(typeof(Lib))] 9 | [JsonSerializable(typeof(GitHubRelease[]))] 10 | internal sealed partial class SourceGenerationContext : JsonSerializerContext; -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Utils/DesktopUtils.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls.ApplicationLifetimes; 3 | 4 | namespace MuseDashModTools.Core.Utils; 5 | 6 | public static class DesktopUtils 7 | { 8 | public static Application GetCurrentApplication() 9 | { 10 | var app = Application.Current; 11 | if (app is null) 12 | { 13 | throw new InvalidOperationException("Application is null."); 14 | } 15 | 16 | return app; 17 | } 18 | 19 | public static IClassicDesktopStyleApplicationLifetime GetCurrentDesktop() 20 | { 21 | if (GetCurrentApplication().ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop) 22 | { 23 | throw new InvalidOperationException("Desktop is null."); 24 | } 25 | 26 | return desktop; 27 | } 28 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Core/Utils/HashUtils.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Cryptography; 2 | 3 | namespace MuseDashModTools.Core.Utils; 4 | 5 | public static class HashUtils 6 | { 7 | public static string ComputeSHA256HashFromPath(string filePath) => 8 | SHA256.HashData(File.ReadAllBytes(filePath)).ToHexStringLower(); 9 | 10 | public async static Task ComputeSHA256HashFromPathAsync(string filePath) => 11 | SHA256.HashData(await File.ReadAllBytesAsync(filePath).ConfigureAwait(false)).ToHexStringLower(); 12 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Generators/BuildInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Generators; 2 | 3 | internal static class BuildInfo 4 | { 5 | internal const string SourceGeneratorVersion = "1.0.0"; 6 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Generators/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System.Collections.Immutable; 2 | global using Microsoft.CodeAnalysis; 3 | global using Microsoft.CodeAnalysis.CSharp; 4 | global using Microsoft.CodeAnalysis.CSharp.Syntax; 5 | global using static MuseDashModTools.Generators.BuildInfo; 6 | global using static MuseDashModTools.Generators.SourceGenerationTexts; -------------------------------------------------------------------------------- /src/MuseDashModTools.Generators/MuseDashModTools.Generators.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | true 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Generators/MuseDashModTools.Generators.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  3 | True -------------------------------------------------------------------------------- /src/MuseDashModTools.Generators/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "DebugRoslynSourceGenerator": { 5 | "commandName": "DebugRoslynComponent", 6 | "targetProject": "../MuseDashModTools/MuseDashModTools.csproj" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Generators/SourceGenerationText.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Generators; 2 | 3 | internal static class SourceGenerationTexts 4 | { 5 | internal const string Header = """ 6 | //------------------------------------------------------------------------------ 7 | // 8 | // This code was generated by the MuseDashModTools source generator 9 | // 10 | // Changes to this file may cause incorrect behavior and will be lost if 11 | // the code is regenerated. 12 | // 13 | //------------------------------------------------------------------------------ 14 | 15 | #nullable enable 16 | 17 | 18 | """; 19 | 20 | internal static string GetGeneratedCodeAttribute(string generatorName) => 21 | $"""[global::System.CodeDom.Compiler.GeneratedCodeAttribute("MuseDashModTools.SourceGenerators.{generatorName}", "{SourceGeneratorVersion}")]"""; 22 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.de.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | Choose Muse Dash Folder 26 | 27 | 28 | Choose Chart Folder 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.es.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | Selecciona la carpeta de Muse Dash 26 | 27 | 28 | Selecciona la carpeta de Charts 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.fr.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | Choose Muse Dash Folder 26 | 27 | 28 | Choose Chart Folder 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.hr.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | Choose Muse Dash Folder 26 | 27 | 28 | Choose Chart Folder 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.hu.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | Válaszd ki a Muse Dash mappát 26 | 27 | 28 | Válaszd ki a zene mappádat 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.ja.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | Muse Dashのインストールフォルダを選んでね 26 | 27 | 28 | チャートフォルダを選択 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.ko.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | 뮤즈대쉬 폴더를 선택해주세요 26 | 27 | 28 | Choose Chart Folder 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | text/microsoft-resx 11 | 12 | 13 | 1.3 14 | 15 | 16 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 17 | PublicKeyToken=b77a5c561934e089 18 | 19 | 20 | 21 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 22 | PublicKeyToken=b77a5c561934e089 23 | 24 | 25 | 26 | Choose Muse Dash Folder 27 | 28 | 29 | Choose Chart Folder 30 | 31 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.ru.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | Выберите папку Muse Dash 26 | 27 | 28 | Выберите папку чарта 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.zh-Hans.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | 选择 Muse Dash 文件夹 26 | 27 | 28 | 选择谱面文件夹 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/General/Resources.zh-Hant.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | text/microsoft-resx 10 | 11 | 12 | 1.3 13 | 14 | 15 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 16 | PublicKeyToken=b77a5c561934e089 17 | 18 | 19 | 20 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, 21 | PublicKeyToken=b77a5c561934e089 22 | 23 | 24 | 25 | 選擇 Muse Dash 文件夾 26 | 27 | 28 | 選擇譜面文件夾 29 | 30 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Localization/MuseDashModTools.Localization.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | PublicResXFileCodeGenerator 6 | Resources.Designer.cs 7 | 8 | 9 | True 10 | True 11 | Resources.resx 12 | 13 | 14 | 15 | PublicResXFileCodeGenerator 16 | Resources.Designer.cs 17 | 18 | 19 | True 20 | True 21 | Resources.resx 22 | 23 | 24 | 25 | PublicResXFileCodeGenerator 26 | Resources.Designer.cs 27 | 28 | 29 | True 30 | True 31 | Resources.resx 32 | 33 | 34 | 35 | PublicResXFileCodeGenerator 36 | Resources.Designer.cs 37 | 38 | 39 | True 40 | True 41 | Resources.resx 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/AppState.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models; 2 | 3 | public sealed class AppState 4 | { 5 | public int Appid { get; set; } 6 | public string? Name { get; set; } 7 | public Dictionary> InstalledDepots { get; set; } = new(); 8 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Chart/Analytic.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models; 2 | 3 | [UsedImplicitly] 4 | public sealed class Analytic 5 | { 6 | [JsonPropertyName("likes")] 7 | public string[] Likes { get; set; } = []; 8 | 9 | [JsonIgnore] 10 | public int LikesCount => Likes.Length; 11 | 12 | [JsonPropertyName("plays")] 13 | public int Plays { get; set; } 14 | 15 | [JsonPropertyName("views")] 16 | public int Views { get; set; } 17 | 18 | [JsonPropertyName("downloads")] 19 | public int Downloads { get; set; } 20 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Chart/Chart.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Media.Imaging; 2 | 3 | namespace MuseDashModTools.Models; 4 | 5 | public sealed class Chart 6 | { 7 | [JsonPropertyName("analytics")] 8 | public Analytic Analytics { get; set; } = null!; 9 | 10 | [JsonPropertyName("_id")] 11 | public string IdStr { get; set; } = string.Empty; 12 | 13 | [JsonPropertyName("id")] 14 | public int Id { get; set; } 15 | 16 | [JsonPropertyName("name")] 17 | public string Name { get; set; } = string.Empty; 18 | 19 | [JsonPropertyName("author")] 20 | public string Author { get; set; } = string.Empty; 21 | 22 | [JsonPropertyName("bpm")] 23 | public string Bpm { get; set; } = string.Empty; 24 | 25 | [JsonPropertyName("difficulties")] 26 | public string[] Difficulties { get; set; } = []; 27 | 28 | [JsonPropertyName("charter")] 29 | public string Charter { get; set; } = string.Empty; 30 | 31 | [JsonPropertyName("charter_id")] 32 | public string[] CharterId { get; set; } = []; 33 | 34 | [JsonPropertyName("__v")] 35 | public int V { get; set; } 36 | 37 | [JsonIgnore] 38 | public Bitmap? Cover { get; set; } 39 | 40 | [JsonIgnore] 41 | public string EasyLevel => Difficulties[0]; 42 | 43 | [JsonIgnore] 44 | public string HardLevel => Difficulties[1]; 45 | 46 | [JsonIgnore] 47 | public string MasterLevel => Difficulties[2]; 48 | 49 | [JsonIgnore] 50 | public string HiddenLevel => Difficulties[3]; 51 | 52 | public int GetHighestLevel() 53 | { 54 | var highestLevel = Difficulties.Max(x => x.ParseLevel()); 55 | return highestLevel; 56 | } 57 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Chart/MapInfo.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models; 2 | 3 | public sealed class MapInfo 4 | { 5 | public string LevelDesigner { get; set; } = string.Empty; 6 | public string Difficulty { get; set; } = string.Empty; 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Controls/ContributorCardItem.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Media.Imaging; 2 | using Avalonia.Platform; 3 | 4 | namespace MuseDashModTools.Models.Controls; 5 | 6 | public sealed class ContributorCardItem 7 | { 8 | public string Name { get; } 9 | public Bitmap Avatar { get; } 10 | public string? Description { get; } 11 | public ContributorLink[]? Links { get; } 12 | 13 | public ContributorCardItem(string name, string? description = null, ContributorLink[]? links = null, string? avatarName = null) 14 | { 15 | Name = name; 16 | Description = description; 17 | Links = links; 18 | 19 | var avatarPath = avatarName is null ? $"{name}.webp" : $"{avatarName}.webp"; 20 | Avatar = new Bitmap(AssetLoader.Open(new Uri($"avares://{nameof(MuseDashModTools)}/Assets/Contributors/{avatarPath}"))); 21 | } 22 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Controls/ContributorGroup.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Controls; 2 | 3 | public sealed class ContributorGroup(string groupName, ContributorCardItem[] contributors) 4 | { 5 | public string GroupName { get; } = groupName; 6 | public ContributorCardItem[] Contributors { get; } = contributors; 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Controls/ContributorLink.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Controls; 2 | 3 | public sealed class ContributorLink(string name, string url) 4 | { 5 | public string Name { get; } = name; 6 | public string Url { get; } = url; 7 | 8 | public static implicit operator ContributorLink((string name, string url) tuple) => new(tuple.name, tuple.url); 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Controls/DropDownButtonItem.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace MuseDashModTools.Models.Controls; 4 | 5 | public sealed class DropDownButtonItem(string text, ObservableCollection? menuItems) 6 | { 7 | public string Text { get; init; } = text; 8 | public ObservableCollection? MenuItems { get; init; } = menuItems; 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Controls/DropDownMenuItem.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | 3 | namespace MuseDashModTools.Models.Controls; 4 | 5 | public sealed class DropDownMenuItem(string text, ICommand command, string? commandParameter = null) 6 | { 7 | public string Text { get; init; } = text; 8 | public ICommand Command { get; init; } = command; 9 | public string? CommandParameter { get; init; } = commandParameter; 10 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Controls/NavItem.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Controls; 2 | 3 | public sealed class NavItem(string displayName, string navigateKey, string iconResourceKey = "") : ObservableObject 4 | { 5 | public NavItem[] Children { get; init; } = []; 6 | public string DisplayName { get; set; } = displayName; 7 | public string NavigateKey { get; init; } = navigateKey; 8 | public string IconResourceKey { get; set; } = iconResourceKey; 9 | public string? Status { get; init; } 10 | public bool IsNavigable { get; init; } = true; 11 | public bool IsSeparator { get; init; } 12 | public bool ShowAtBottom { get; init; } 13 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/DTOs/LibDto.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models; 2 | 3 | public sealed class LibDto 4 | { 5 | public bool IsLocal { get; set; } 6 | 7 | #region Lib Properties 8 | public string Name { get; set; } = string.Empty; 9 | public string FileName { get; set; } = string.Empty; 10 | public string SHA256 { get; set; } = string.Empty; 11 | 12 | #endregion Lib Properties 13 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/AskType.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | [JsonConverter(typeof(JsonStringEnumConverter))] 4 | public enum AskType 5 | { 6 | Always, 7 | YesAndNoAsk, 8 | NoAndNoAsk 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/ChartFilterType.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | public enum ChartFilterType 4 | { 5 | Easy, 6 | Hard, 7 | Master, 8 | Hidden 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/ChartSortOptions.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | public enum ChartSortOptions 4 | { 5 | Id, 6 | Name, 7 | Downloads, 8 | Likes, 9 | Level, 10 | Latest 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/DeleteOption.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | public enum DeleteOption 4 | { 5 | FailIfNotFound, 6 | IgnoreIfNotFound 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/DownloadSource.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | [JsonConverter(typeof(JsonStringEnumConverter))] 4 | public enum DownloadSource 5 | { 6 | GitHub, 7 | GitHubMirror, 8 | Gitee, 9 | Custom 10 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/ModFilterType.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | public enum ModFilterType 4 | { 5 | All = 0, 6 | Installed = 1, 7 | Enabled = 2, 8 | Disabled = 3, 9 | Outdated = 4, 10 | Incompatible = 5 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/ModState.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | public enum ModState 4 | { 5 | Incompatible = -3, 6 | Duplicated = -2, 7 | Outdated = -1, 8 | Normal = 0, 9 | Modified = 1, 10 | Newer = 2 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Enums/UpdateSource.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.Enums; 2 | 3 | [JsonConverter(typeof(JsonStringEnumConverter))] 4 | public enum UpdateSource 5 | { 6 | GitHubAPI, 7 | GitHubRSS 8 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/GitHub/GitHubRSS.cs: -------------------------------------------------------------------------------- 1 | using Semver; 2 | 3 | namespace MuseDashModTools.Models.GitHub; 4 | 5 | public sealed class GitHubRSS(SemVersion version) 6 | { 7 | public SemVersion Version { get; init; } = version; 8 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/GitHub/GitHubRelease.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.GitHub; 2 | 3 | public sealed class GitHubRelease 4 | { 5 | [JsonPropertyName("url")] public string Url { get; set; } = string.Empty; 6 | 7 | [JsonPropertyName("assets_url")] public string AssetsUrl { get; set; } = string.Empty; 8 | 9 | [JsonPropertyName("upload_url")] public string UploadUrl { get; set; } = string.Empty; 10 | 11 | [JsonPropertyName("html_url")] public string HtmlUrl { get; set; } = string.Empty; 12 | 13 | [JsonPropertyName("id")] public int Id { get; set; } 14 | 15 | [JsonPropertyName("node_id")] public string NodeId { get; set; } = string.Empty; 16 | 17 | [JsonPropertyName("tag_name")] public string TagName { get; set; } = string.Empty; 18 | 19 | [JsonPropertyName("target_commitish")] public string TargetCommitish { get; set; } = string.Empty; 20 | 21 | [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; 22 | 23 | [JsonPropertyName("draft")] public bool Draft { get; set; } 24 | 25 | [JsonPropertyName("prerelease")] public bool Prerelease { get; set; } 26 | 27 | [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } 28 | 29 | [JsonPropertyName("published_at")] public DateTime PublishedAt { get; set; } 30 | 31 | [JsonPropertyName("assets")] public GitHubReleaseAsset[] Assets { get; set; } = []; 32 | 33 | [JsonPropertyName("tarball_url")] public string TarballUrl { get; set; } = string.Empty; 34 | 35 | [JsonPropertyName("zipball_url")] public string ZipballUrl { get; set; } = string.Empty; 36 | 37 | [JsonPropertyName("body")] public string Body { get; set; } = string.Empty; 38 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/GitHub/GitHubReleaseAsset.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.GitHub; 2 | 3 | [UsedImplicitly] 4 | public sealed class GitHubReleaseAsset 5 | { 6 | [JsonPropertyName("url")] public string Url { get; set; } = string.Empty; 7 | 8 | [JsonPropertyName("id")] public int Id { get; set; } 9 | 10 | [JsonPropertyName("node_id")] public string NodeId { get; set; } = string.Empty; 11 | 12 | [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; 13 | 14 | [JsonPropertyName("label")] public object? Label { get; set; } 15 | 16 | [JsonPropertyName("content_type")] public string ContentType { get; set; } = string.Empty; 17 | 18 | [JsonPropertyName("state")] public string State { get; set; } = string.Empty; 19 | 20 | [JsonPropertyName("size")] public int Size { get; set; } 21 | 22 | [JsonPropertyName("download_count")] public int DownloadCount { get; set; } 23 | 24 | [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } 25 | 26 | [JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; } 27 | 28 | [JsonPropertyName("browser_download_url")] 29 | public string BrowserDownloadUrl { get; set; } = string.Empty; 30 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/GitHub/GitHubRepoContent.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.GitHub; 2 | 3 | public class GitHubRepoContent 4 | { 5 | [JsonPropertyName("name")] public string Name { get; set; } = string.Empty; 6 | [JsonPropertyName("path")] public string Path { get; set; } = string.Empty; 7 | [JsonPropertyName("sha")] public string SHA { get; set; } = string.Empty; 8 | [JsonPropertyName("size")] public int Size { get; set; } 9 | [JsonPropertyName("url")] public string Url { get; set; } = string.Empty; 10 | [JsonPropertyName("html_url")] public string HtmlUrl { get; set; } = string.Empty; 11 | [JsonPropertyName("git_url")] public string GitUrl { get; set; } = string.Empty; 12 | [JsonPropertyName("download_url")] public string DownloadUrl { get; set; } = string.Empty; 13 | [JsonPropertyName("type")] public string Type { get; set; } = string.Empty; 14 | [JsonPropertyName("_links")] public GitHubRepoContentLinks Links { get; set; } = new(); 15 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/GitHub/GitHubRepoContentLinks.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.GitHub; 2 | 3 | public sealed class GitHubRepoContentLinks 4 | { 5 | [JsonPropertyName("self")] public string Self { get; set; } = string.Empty; 6 | [JsonPropertyName("git")] public string Git { get; set; } = string.Empty; 7 | [JsonPropertyName("html")] public string Html { get; set; } = string.Empty; 8 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/GitHub/ReadmeContent.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models.GitHub; 2 | 3 | public sealed class ReadmeContent : GitHubRepoContent 4 | { 5 | [JsonPropertyName("content")] public string Content { get; set; } = string.Empty; 6 | [JsonPropertyName("encoding")] public string Encoding { get; set; } = string.Empty; 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System.Text.Json.Serialization; 2 | global using CommunityToolkit.Mvvm.ComponentModel; 3 | global using JetBrains.Annotations; 4 | global using MuseDashModTools.Common.Extensions; 5 | global using MuseDashModTools.Models.Enums; 6 | global using static MuseDashModTools.Common.GitHubConstants; 7 | global using static MuseDashModTools.Localization.XAML.Resources; -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Language.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace MuseDashModTools.Models; 4 | 5 | public sealed class Language(CultureInfo cultureInfo) 6 | { 7 | public string? Name { get; } = cultureInfo.Name; 8 | private string? DisplayName { get; } = cultureInfo.DisplayName; 9 | public string FullName => $"{Name} - {DisplayName}"; 10 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Lib.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models; 2 | 3 | [PublicAPI] 4 | public sealed class Lib 5 | { 6 | public string Name { get; set; } = string.Empty; 7 | public string FileName { get; set; } = string.Empty; 8 | public string SHA256 { get; set; } = string.Empty; 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Mapper.cs: -------------------------------------------------------------------------------- 1 | using Riok.Mapperly.Abstractions; 2 | 3 | namespace MuseDashModTools.Models; 4 | 5 | [Mapper(RequiredMappingStrategy = RequiredMappingStrategy.None)] 6 | public static partial class Mapper 7 | { 8 | public static partial ModDto ToDto(this Mod mod); 9 | public static partial LibDto ToDto(this Lib lib); 10 | public static partial void UpdateFromMod([MappingTarget] this ModDto modDto, Mod mod); 11 | public static partial void CopyFrom([MappingTarget] this Config currentConfig, Config savedConfig); 12 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/Mod.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Models; 2 | 3 | [PublicAPI] 4 | public sealed class Mod 5 | { 6 | public string Name { get; set; } = string.Empty; 7 | public string Version { get; set; } = string.Empty; 8 | public string Author { get; set; } = string.Empty; 9 | public string FileName { get; set; } = string.Empty; 10 | public string Repository { get; set; } = string.Empty; 11 | public string ConfigFile { get; set; } = string.Empty; 12 | public string GameVersion { get; set; } = string.Empty; 13 | public string Description { get; set; } = string.Empty; 14 | public string[] ModDependencies { get; set; } = []; 15 | public string[] LibDependencies { get; set; } = []; 16 | public string[] IncompatibleMods { get; set; } = []; 17 | public string SHA256 { get; set; } = string.Empty; 18 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/MuseDashModTools.Models.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Models/MuseDashModTools.Models.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  2 | True 3 | True -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/ExtendControls/DifficultyFilter.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 22 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/ExtendControls/DifficultyFilter.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Styles.ExtendControls; 2 | 3 | public class DifficultyFilter : MenuItem 4 | { 5 | /*public static readonly StyledProperty IsCheckedProperty = 6 | AvaloniaProperty.Register(nameof(IsChecked), false, 7 | defaultBindingMode: BindingMode.TwoWay); 8 | 9 | public bool? IsChecked 10 | { 11 | get => GetValue(IsCheckedProperty); 12 | set => SetValue(IsCheckedProperty, value); 13 | } 14 | 15 | protected override void OnPointerPressed(PointerPressedEventArgs e) 16 | { 17 | base.OnPointerPressed(e); 18 | IsChecked = !IsChecked; 19 | }*/ 20 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/ExtendControls/ImageButton.axaml: -------------------------------------------------------------------------------- 1 |  4 | 5 | 6 | 7 | 8 | 18 | 21 | 24 | 25 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/ExtendControls/ImageButton.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Styles.ExtendControls; 2 | 3 | public sealed class ImageButton : Button 4 | { 5 | public static readonly StyledProperty ImageSourceProperty = 6 | AvaloniaProperty.Register(nameof(ImageSource)); 7 | 8 | public static readonly StyledProperty ImageHeightProperty = 9 | AvaloniaProperty.Register(nameof(ImageHeight)); 10 | 11 | public static readonly StyledProperty ImageMarginProperty = 12 | AvaloniaProperty.Register(nameof(ImageMargin)); 13 | 14 | public static readonly StyledProperty ImageCursorProperty = 15 | AvaloniaProperty.Register(nameof(ImageCursor)); 16 | 17 | [Content] 18 | public IImage ImageSource 19 | { 20 | get => GetValue(ImageSourceProperty); 21 | set => SetValue(ImageSourceProperty, value); 22 | } 23 | 24 | public double ImageHeight 25 | { 26 | get => GetValue(ImageHeightProperty); 27 | set => SetValue(ImageHeightProperty, value); 28 | } 29 | 30 | public Thickness ImageMargin 31 | { 32 | get => GetValue(ImageMarginProperty); 33 | set => SetValue(ImageMarginProperty, value); 34 | } 35 | 36 | public Cursor? ImageCursor 37 | { 38 | get => GetValue(ImageCursorProperty); 39 | set => SetValue(ImageCursorProperty, value); 40 | } 41 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/ExtendControls/NaviPanelListControl.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 21 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/ExtendControls/NaviPanelListControl.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Styles.ExtendControls; 2 | 3 | public sealed class NaviPanelListControl : ListBox; -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/GlobalUsing.cs: -------------------------------------------------------------------------------- 1 | global using Avalonia; 2 | global using Avalonia.Controls; 3 | global using Avalonia.Controls.Primitives; 4 | global using Avalonia.Data; 5 | global using Avalonia.Input; 6 | global using Avalonia.Layout; 7 | global using Avalonia.Media; 8 | global using Avalonia.Metadata; -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/ModToolsStyles.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/MuseDashModTools.Styles.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 8 | none 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | [assembly: XmlnsDefinition("https://github.com/MDModsDev/MuseDashModTools", "MuseDashModTools.Styles.ExtendControls")] 2 | [assembly: XmlnsDefinition("https://github.com/MDModsDev/MuseDashModTools", "MuseDashModTools.Styles.TemplatedControls")] 3 | [assembly: XmlnsPrefix("https://github.com/MDModsDev/MuseDashModTools", "mdmt")] -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Resources/DarkResource.axaml: -------------------------------------------------------------------------------- 1 | 2 | avares://MuseDashModTools/Assets/Title-Dark.webp 3 | avares://MuseDashModTools/Assets/Background-Dark.webp 4 | avares://MuseDashModTools/Assets/MDMC_Title_Dark.webp 5 | #1F2024 6 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Resources/LightResource.axaml: -------------------------------------------------------------------------------- 1 | 2 | avares://MuseDashModTools/Assets/Title-Light.webp 3 | avares://MuseDashModTools/Assets/Background-Light.webp 4 | avares://MuseDashModTools/Assets/MDMC_Title_Light.webp 5 | #FAFAFA 6 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Resources/SharedResource.axaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Styles/BorderStyles.axaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Styles/ButtonStyles.axaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 15 | 16 | 19 | 20 | 23 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Styles/ImageStyles.axaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Styles/LabelStyles.axaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Styles/StackPanelStyles.axaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/Styles/TextBlockStyles.axaml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 9 | 14 | 15 | 16 | 19 | 20 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/TemplatedControls/ContributorCardControl.axaml.cs: -------------------------------------------------------------------------------- 1 | using System.Windows.Input; 2 | using MuseDashModTools.Models.Controls; 3 | 4 | namespace MuseDashModTools.Styles.TemplatedControls; 5 | 6 | public class ContributorCardControl : TemplatedControl 7 | { 8 | public static readonly StyledProperty AvatarProperty = 9 | AvaloniaProperty.Register(nameof(Avatar)); 10 | 11 | public static readonly StyledProperty ContributorNameProperty = 12 | AvaloniaProperty.Register(nameof(ContributorName)); 13 | 14 | public static readonly StyledProperty ContributorDescriptionProperty = 15 | AvaloniaProperty.Register(nameof(ContributorDescription)); 16 | 17 | public static readonly StyledProperty?> LinksProperty = 18 | AvaloniaProperty.Register?>(nameof(Links)); 19 | 20 | public static readonly StyledProperty ButtonCommandProperty = 21 | AvaloniaProperty.Register(nameof(ButtonCommand)); 22 | 23 | [Content] 24 | public IImage Avatar 25 | { 26 | get => GetValue(AvatarProperty); 27 | set => SetValue(AvatarProperty, value); 28 | } 29 | 30 | public string ContributorName 31 | { 32 | get => GetValue(ContributorNameProperty); 33 | set => SetValue(ContributorNameProperty, value); 34 | } 35 | 36 | public string? ContributorDescription 37 | { 38 | get => GetValue(ContributorDescriptionProperty); 39 | set => SetValue(ContributorDescriptionProperty, value); 40 | } 41 | 42 | public IEnumerable? Links 43 | { 44 | get => GetValue(LinksProperty); 45 | set => SetValue(LinksProperty, value); 46 | } 47 | 48 | public ICommand ButtonCommand 49 | { 50 | get => GetValue(ButtonCommandProperty); 51 | set => SetValue(ButtonCommandProperty, value); 52 | } 53 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/TemplatedControls/Difficulty.axaml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 25 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/TemplatedControls/Difficulty.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Styles.TemplatedControls; 2 | 3 | public sealed class Difficulty : TemplatedControl 4 | { 5 | public static readonly StyledProperty SourceProperty = 6 | AvaloniaProperty.Register(nameof(Source)); 7 | 8 | public static readonly StyledProperty TextProperty = 9 | AvaloniaProperty.Register(nameof(Text)); 10 | 11 | [Content] 12 | public IImage? Source 13 | { 14 | get => GetValue(SourceProperty); 15 | set => SetValue(SourceProperty, value); 16 | } 17 | 18 | public string? Text 19 | { 20 | get => GetValue(TextProperty); 21 | set => SetValue(TextProperty, value); 22 | } 23 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Styles/TemplatedControls/NaviButtonsControl.axaml.cs: -------------------------------------------------------------------------------- 1 | using MuseDashModTools.Models.Controls; 2 | 3 | namespace MuseDashModTools.Styles.TemplatedControls; 4 | 5 | public class NaviButtonsControl : TemplatedControl 6 | { 7 | public static readonly StyledProperty> SourceProperty = 8 | AvaloniaProperty.Register>(nameof(Source)); 9 | 10 | [Content] 11 | public IEnumerable Source 12 | { 13 | get => GetValue(SourceProperty); 14 | set => SetValue(SourceProperty, value); 15 | } 16 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Updater/Contracts/ILocalService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Updater.Contracts; 2 | 3 | public interface ILocalService 4 | { 5 | bool ExtractZipFile(string zipPath, string extractPath); 6 | } -------------------------------------------------------------------------------- /src/MuseDashModTools.Updater/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using ConsoleAppFramework; 2 | global using MuseDashModTools.Updater; 3 | global using MuseDashModTools.Updater.Contracts; 4 | global using MuseDashModTools.Updater.Services; -------------------------------------------------------------------------------- /src/MuseDashModTools.Updater/MuseDashModTools.Updater.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | $(SolutionDir)bin 6 | true 7 | true 8 | Updater 9 | 10 | 11 | 12 | none 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/MuseDashModTools.Updater/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection; 2 | using Microsoft.Extensions.Logging; 3 | using ZLogger; 4 | 5 | var services = new ServiceCollection(); 6 | services.AddSingleton(); 7 | services.AddLogging(x => 8 | { 9 | x.ClearProviders(); 10 | #if DEBUG 11 | x.SetMinimumLevel(LogLevel.Trace); 12 | #else 13 | x.SetMinimumLevel(LogLevel.Information); 14 | #endif 15 | x.AddZLoggerConsole(); 16 | }); 17 | 18 | await using var serviceProvider = services.BuildServiceProvider(); 19 | ConsoleApp.ServiceProvider = serviceProvider; 20 | 21 | var app = ConsoleApp.Create(); 22 | 23 | await app.RunAsync(args).ConfigureAwait(false); -------------------------------------------------------------------------------- /src/MuseDashModTools.Updater/Services/LocalService.cs: -------------------------------------------------------------------------------- 1 | using System.IO.Compression; 2 | using Microsoft.Extensions.Logging; 3 | 4 | namespace MuseDashModTools.Updater.Services; 5 | 6 | public sealed class LocalService(ILogger logger) : ILocalService 7 | { 8 | private readonly ILogger _logger = logger; 9 | 10 | public bool ExtractZipFile(string zipPath, string extractPath) 11 | { 12 | try 13 | { 14 | ZipFile.ExtractToDirectory(zipPath, extractPath, true); 15 | _logger.LogInformation("Successfully extracted {ZipPath} to {ExtractPath}", zipPath, extractPath); 16 | return true; 17 | } 18 | catch (Exception ex) 19 | { 20 | _logger.LogError(ex, "Failed to extract file {ZipPath} to {ExtractPath}", zipPath, extractPath); 21 | return false; 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Avalonia_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Avalonia_Logo.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Background-Dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Background-Dark.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Background-Light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Background-Light.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/Balint.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/Balint.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/Bigbeesushi.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/Bigbeesushi.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/KARPED1EM.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/KARPED1EM.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/MEMOLie.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/MEMOLie.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/MNight4.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/MNight4.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/Ronner.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/Ronner.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/Shiron Lee.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/Shiron Lee.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/Super Pig.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/Super Pig.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/Ultra Rabbit.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/Ultra Rabbit.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/aquawtf.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/aquawtf.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/lxy.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/lxy.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/lxymahatma.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/lxymahatma.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Contributors/taypexx.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Contributors/taypexx.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Difficulties/Easy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Difficulties/Easy.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Difficulties/Hard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Difficulties/Hard.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Difficulties/Hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Difficulties/Hidden.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Difficulties/Master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Difficulties/Master.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/DonationQRs/Alipay.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/DonationQRs/Alipay.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/DonationQRs/Paypal.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/DonationQRs/Paypal.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/DonationQRs/Wechat.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/DonationQRs/Wechat.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/DotNet_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/DotNet_Logo.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Genshin.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Genshin.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Icon.ico -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/MDMC_Title.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/MDMC_Title.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/MDMC_Title_Dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/MDMC_Title_Dark.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/MDMC_Title_Light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/MDMC_Title_Light.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/MIT_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/MIT_Logo.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/ML_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/ML_Icon.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/ML_Text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/ML_Text.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Melon.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Melon.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Melon_Blur.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Melon_Blur.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Neko_Blur.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Neko_Blur.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Avalonia/Avalonia_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Avalonia/Avalonia_Logo.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Avalonia/Avalonia_Logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Avalonia/Avalonia_Logo.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Avalonia/Avalonia_Logo.svg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 9 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Background/Background-Dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Background/Background-Dark.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Background/Background-Light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Background/Background-Light.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Background/Original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Background/Original.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Blur/Melon_Blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Blur/Melon_Blur.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Blur/Melon_Blur.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Blur/Melon_Blur.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Blur/Neko_Blur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Blur/Neko_Blur.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Blur/Neko_Blur.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Blur/Neko_Blur.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/Balint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/Balint.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/Bigbeesushi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/Bigbeesushi.jpg -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/KARPED1EM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/KARPED1EM.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/MEMOLie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/MEMOLie.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/MNight4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/MNight4.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/Ronner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/Ronner.jpg -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/Shiron_Lee.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/Shiron_Lee.jpg -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/Super_Pig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/Super_Pig.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/Ultra_Rabbit.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/Ultra_Rabbit.jpg -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/aquawtf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/aquawtf.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/lxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/lxy.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/lxymahatma.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/lxymahatma.jpg -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Contributors/taypexx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Contributors/taypexx.jpg -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/DotNet/DotNet_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/DotNet/DotNet_Logo.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/DotNet/DotNet_Logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/DotNet/DotNet_Logo.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/DotNet/DotNet_Logo.svg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Genshin/Genshin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Genshin/Genshin.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Genshin/Genshin.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Genshin/Genshin.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Genshin/Genshin.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Genshin/Genshin.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Icon.ico -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/MDMC_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/MDMC_Logo.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/MDMC_Title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/MDMC_Title.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/MIT/MIT_Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/MIT/MIT_Logo.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/MIT/MIT_Logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/MIT/MIT_Logo.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/MIT/MIT_Logo.svg: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/ML_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/ML_Icon.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/ML_Text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/ML_Text.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Melon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Melon.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Melon_With_Mod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Melon_With_Mod.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/MuseDash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/MuseDash.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Neko.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Neko.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/QR/Alipay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/QR/Alipay.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/QR/QR.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/QR/QR.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/QR/Wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/QR/Wechat.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Title/Title-Dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Title/Title-Dark.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Title/Title-Light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Title/Title-Light.png -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Raw/Title/Title.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Raw/Title/Title.psd -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Title-Dark.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Title-Dark.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/Title-Light.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/Title-Light.webp -------------------------------------------------------------------------------- /src/MuseDashModTools/Assets/classdata.tpk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MDModsDev/MuseDashModTools/a340199c9dbd3d79ffcebefa2d5b1d4478c06fe3/src/MuseDashModTools/Assets/classdata.tpk -------------------------------------------------------------------------------- /src/MuseDashModTools/BannedSymbols.txt: -------------------------------------------------------------------------------- 1 | T:Microsoft.Extensions.Logging.LoggerExtensions;Don't use this, use ZLog instead. -------------------------------------------------------------------------------- /src/MuseDashModTools/Converters/FuncValueConverters.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Media; 2 | 3 | namespace MuseDashModTools.Converters; 4 | 5 | public static class FuncValueConverters 6 | { 7 | private const string IconPrefix = "SemiIcon"; 8 | private static readonly IResourceService _resourceService = App.Container.Resolve(); 9 | 10 | public static FuncValueConverter SemiIconConverter { get; } = new(iconKeyName => 11 | { 12 | if (iconKeyName.IsNullOrEmpty() || _resourceService.TryGetAppResource($"{IconPrefix}{iconKeyName}") is not { } result) 13 | { 14 | return null; 15 | } 16 | 17 | return result; 18 | }); 19 | 20 | public static FuncValueConverter ChartSceneConverter { get; } = new(scene => scene switch 21 | { 22 | "scene_01" => XAML_Scene_SpaceStation, 23 | "scene_02" => XAML_Scene_Retrocity, 24 | "scene_03" => XAML_Scene_Castle, 25 | "scene_04" => XAML_Scene_RainyNight, 26 | "scene_05" => XAML_Scene_Candyland, 27 | "scene_06" => XAML_Scene_Oriental, 28 | "scene_07" => XAML_Scene_LetsGroove, 29 | "scene_08" => XAML_Scene_Touhou, 30 | "scene_09" => XAML_Scene_DJMAX, 31 | _ => scene 32 | }); 33 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Extensions/JsonNodeExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Nodes; 2 | 3 | namespace MuseDashModTools.Extensions; 4 | 5 | public static class JsonNodeExtensions 6 | { 7 | public static string? GetString(this JsonNode node, string key, string? defaultValue = default) => 8 | node[key]?.ToString() ?? defaultValue; 9 | 10 | public static T? GetValue(this JsonNode node, string key, Func converter, T? defaultValue = default) 11 | { 12 | var value = node[key]?.ToString(); 13 | return value is not null ? converter(value) : defaultValue; 14 | } 15 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Extensions/ServiceExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Extensions; 2 | 3 | public static partial class ServiceExtensions 4 | { 5 | public static void RegisterInternalServices(this ContainerBuilder builder) 6 | { 7 | // Self Services 8 | builder.RegisterType().PropertiesAutowired().SingleInstance(); 9 | 10 | // TopLevel 11 | builder.Register(context => context.Resolve().GetTopLevel()).As().SingleInstance(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Extensions/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Media; 2 | 3 | namespace MuseDashModTools.Extensions; 4 | 5 | public static class StringExtensions 6 | { 7 | /// 8 | /// Replace "\\n" with "\n" to normalize newline 9 | /// 10 | /// 11 | /// 12 | public static string NormalizeNewline(this string str) => str.Replace("\\n", "\n"); 13 | 14 | /// 15 | /// Convert string to IBrush 16 | /// 17 | /// 18 | /// 19 | public static IBrush ToBrush(this string str) => (IBrush)new BrushConverter().ConvertFromString(str)!; 20 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Extensions/VisualExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Extensions; 2 | 3 | public static class VisualExtensions 4 | { 5 | public static TopLevel GetTopLevel(this Visual visual) => 6 | TopLevel.GetTopLevel(visual) ?? throw new InvalidOperationException("TopLevel not found."); 7 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/LangKeys.cs: -------------------------------------------------------------------------------- 1 | /* 2 | using Antelcat.I18N.Attributes; 3 | using MuseDashModTools.Localization.XAML; 4 | 5 | namespace MuseDashModTools; 6 | 7 | [ResourceKeysOf(typeof(Resources))] 8 | [UsedImplicitly] 9 | public partial class LangKeys; 10 | */ 11 | 12 | -------------------------------------------------------------------------------- /src/MuseDashModTools/MuseDashModTools.csproj.DotSettings: -------------------------------------------------------------------------------- 1 |  3 | True 4 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Program.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Dialogs; 2 | 3 | namespace MuseDashModTools; 4 | 5 | internal static class Program 6 | { 7 | // Initialization code. Don't use any Avalonia, third-party APIs or any 8 | // SynchronizationContext-reliant code before AppMain is called: things aren't initialized 9 | // yet and stuff might break. 10 | [STAThread] 11 | public static void Main(string[] args) 12 | { 13 | // Prevent multiple launch 14 | using var mutex = new Mutex(true, AppName); 15 | if (!mutex.WaitOne(TimeSpan.Zero, true)) 16 | { 17 | return; 18 | } 19 | 20 | DeleteUnusedLogFile(); 21 | BuildAvaloniaApp().StartWithClassicDesktopLifetime(args); 22 | } 23 | 24 | private static void DeleteUnusedLogFile() 25 | { 26 | const string logFolderName = "Logs"; 27 | 28 | if (!Directory.Exists(logFolderName)) 29 | { 30 | return; 31 | } 32 | 33 | var logFiles = Directory.GetFiles(logFolderName, "*.log").OrderDescending().Skip(30).ToArray(); 34 | if (logFiles is []) 35 | { 36 | return; 37 | } 38 | 39 | Parallel.ForEach(logFiles, (logFile, _) => File.Delete(logFile)); 40 | } 41 | 42 | // Avalonia configuration, don't remove; also used by visual designer. 43 | #pragma warning disable CA1416 44 | private static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure() 45 | .UseManagedSystemDialogs() 46 | .UsePlatformDetect() 47 | .WithInterFont() 48 | .LogToTrace() 49 | .UseReactiveUI(); 50 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyCopyright(CopyRight)] 4 | [assembly: AssemblyCompany(Company)] 5 | [assembly: AssemblyDescription(Description)] 6 | [assembly: AssemblyFileVersion(AppVersion)] 7 | [assembly: AssemblyProduct(AppName)] 8 | [assembly: AssemblyTitle(AppName)] -------------------------------------------------------------------------------- /src/MuseDashModTools/Services/NavigationService.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Services; 2 | 3 | public sealed class NavigationService 4 | { 5 | #region Injections 6 | 7 | [UsedImplicitly] 8 | public ILogger Logger { get; init; } = null!; 9 | 10 | #endregion Injections 11 | 12 | public Control NavigateTo() where TView : Control, new() 13 | { 14 | Logger.ZLogInformation($"Navigating to View: {typeof(TView).Name}"); 15 | return App.Container.Resolve(); 16 | } 17 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/TrimAssemblyConfig.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Utils/ModDescriptionProvider.cs: -------------------------------------------------------------------------------- 1 | using MuseDashModTools.Localization.ModDescription; 2 | 3 | namespace MuseDashModTools.Utils; 4 | 5 | public static class ModDescriptionProvider 6 | { 7 | public static string GetDescription(ModDto mod) => Resources.ResourceManager 8 | .GetString(mod.Name, Resources.Culture)?.Replace("\\n", "\n") ?? mod.Description; 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Dialogs/DonationDialogViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Dialogs; 2 | 3 | public class DonationDialogViewModel : ObservableObject 4 | { 5 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/MainWindowViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels; 2 | 3 | public sealed partial class MainWindowViewModel : NavViewModelBase 4 | { 5 | public override IReadOnlyList NavItems { get; } = 6 | [ 7 | new(XAML_Page_Home, HomePageName, "Home"), 8 | new(XAML_Page_Modding, ModdingPageName, "Wrench"), 9 | new(XAML_Page_Charting, ChartingPageName, "Disc"), 10 | new(XAML_Page_Setting, SettingPageName, "Setting") 11 | ]; 12 | 13 | protected override async Task OnActivatedAsync(CompositeDisposable disposables) 14 | { 15 | await base.OnActivatedAsync(disposables).ConfigureAwait(true); 16 | await SettingService.LoadAsync().ConfigureAwait(true); 17 | GetCurrentApplication().RequestedThemeVariant = AvaloniaResources.ThemeVariants[Config.Theme]; 18 | #if RELEASE 19 | await UpdateService.CheckForUpdatesAsync().ConfigureAwait(true); 20 | #endif 21 | Logger.ZLogInformation($"{nameof(MainWindowViewModel)} Initialized"); 22 | } 23 | 24 | protected override void OnError(Exception ex) 25 | { 26 | base.OnError(ex); 27 | Logger.ZLogError(ex, $"{nameof(MainWindowViewModel)} Initialize Failed"); 28 | } 29 | 30 | #region Injections 31 | 32 | [UsedImplicitly] 33 | public required Config Config { get; init; } 34 | 35 | [UsedImplicitly] 36 | public required NavigationService NavigationService { get; init; } 37 | 38 | [UsedImplicitly] 39 | public required ILogger Logger { get; init; } 40 | 41 | [UsedImplicitly] 42 | public required ISettingService SettingService { get; init; } 43 | 44 | #if RELEASE 45 | [UsedImplicitly] 46 | public required IUpdateService UpdateService { get; init; } 47 | #endif 48 | 49 | #endregion Injections 50 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/NavViewModelBase.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels; 2 | 3 | public partial class NavViewModelBase : ViewModelBase 4 | { 5 | [ObservableProperty] 6 | public partial Control? Content { get; set; } 7 | 8 | [ObservableProperty] 9 | public partial NavItem? SelectedItem { get; set; } 10 | 11 | [UsedImplicitly] 12 | public virtual IReadOnlyList NavItems { get; } = null!; 13 | 14 | protected virtual void Navigate(NavItem? value) 15 | { 16 | } 17 | 18 | protected override Task OnActivatedAsync(CompositeDisposable disposables) 19 | { 20 | base.OnActivatedAsync(disposables); 21 | 22 | SelectedItem = NavItems[0]; 23 | return Task.CompletedTask; 24 | } 25 | 26 | [UsedImplicitly] 27 | partial void OnSelectedItemChanged(NavItem? value) 28 | { 29 | Navigate(value); 30 | } 31 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Pages/ChartingPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace MuseDashModTools.ViewModels.Pages; 4 | 5 | public sealed partial class ChartingPageViewModel : NavViewModelBase 6 | { 7 | public override IReadOnlyList NavItems { get; } = 8 | [ 9 | new("Charts", ChartsPanelName), 10 | new("Charter", CharterPanelName) 11 | ]; 12 | 13 | public ObservableCollection DropDownButtons => 14 | [ 15 | new("Open", 16 | [ 17 | new DropDownMenuItem("CustomAlbums Folder", OpenFolderCommand, Config.CustomAlbumsFolder) 18 | ]) 19 | ]; 20 | 21 | protected override Task OnActivatedAsync(CompositeDisposable disposables) 22 | { 23 | base.OnActivatedAsync(disposables); 24 | 25 | Logger.ZLogInformation($"{nameof(ChartingPageViewModel)} Initialized"); 26 | return Task.CompletedTask; 27 | } 28 | 29 | #region Injections 30 | 31 | [UsedImplicitly] 32 | public required ILogger Logger { get; init; } 33 | 34 | [UsedImplicitly] 35 | public required NavigationService NavigationService { get; init; } 36 | 37 | [UsedImplicitly] 38 | public required Config Config { get; init; } 39 | 40 | #endregion Injections 41 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Pages/HomePageViewModel.cs: -------------------------------------------------------------------------------- 1 | using Ursa.Common; 2 | using Ursa.Controls.Options; 3 | 4 | namespace MuseDashModTools.ViewModels.Pages; 5 | 6 | public sealed partial class HomePageViewModel : ViewModelBase 7 | { 8 | [RelayCommand] 9 | private Task ShowDonationDrawerAsync() 10 | { 11 | var options = new DrawerOptions 12 | { 13 | Position = Position.Right, 14 | Title = "原神启动", 15 | IsCloseButtonVisible = true, 16 | CanLightDismiss = true, 17 | MaxWidth = 700, 18 | MinWidth = 700, 19 | Buttons = DialogButton.None, 20 | CanResize = false 21 | }; 22 | 23 | return Drawer.ShowModal(DonationDialogViewModel, "DonationDrawerHost", options); 24 | } 25 | 26 | [RelayCommand] 27 | private void LaunchModdedGame() 28 | { 29 | LocalService.LaunchGame(true); 30 | } 31 | 32 | [RelayCommand] 33 | private void LaunchVanillaGame() 34 | { 35 | // TODO 36 | } 37 | 38 | #region Injections 39 | 40 | [UsedImplicitly] 41 | public required DonationDialogViewModel DonationDialogViewModel { get; init; } 42 | 43 | [UsedImplicitly] 44 | public required ILocalService LocalService { get; init; } 45 | 46 | [UsedImplicitly] 47 | public required ILogger Logger { get; init; } 48 | 49 | #endregion Injections 50 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Pages/LogAnalysisPageViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Pages; 2 | 3 | public sealed class LogAnalysisPageViewModel : ViewModelBase 4 | { 5 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Pages/ModdingPageViewModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.ObjectModel; 2 | 3 | namespace MuseDashModTools.ViewModels.Pages; 4 | 5 | public sealed partial class ModdingPageViewModel : NavViewModelBase 6 | { 7 | public override IReadOnlyList NavItems { get; } = 8 | [ 9 | new("Mods", ModsPanelName), 10 | new("Melon Loader", MelonLoaderPanelName), 11 | new("Develop", DevelopPanelName) 12 | ]; 13 | 14 | public ObservableCollection DropDownButtons => 15 | [ 16 | new("Open", 17 | [ 18 | new DropDownMenuItem("Mods Folder", OpenFolderCommand, Config.ModsFolder), 19 | new DropDownMenuItem("UserData Folder", OpenFolderCommand, Config.UserDataFolder), 20 | new DropDownMenuItem("UserLib Folder", OpenFolderCommand, Config.UserLibsFolder) 21 | ]) 22 | ]; 23 | 24 | protected override Task OnActivatedAsync(CompositeDisposable disposables) 25 | { 26 | base.OnActivatedAsync(disposables); 27 | 28 | Logger.ZLogInformation($"{nameof(ModdingPageViewModel)} Initialized"); 29 | return Task.CompletedTask; 30 | } 31 | 32 | #region Injections 33 | 34 | [UsedImplicitly] 35 | public required ILogger Logger { get; init; } 36 | 37 | [UsedImplicitly] 38 | public required NavigationService NavigationService { get; init; } 39 | 40 | [UsedImplicitly] 41 | public required Config Config { get; init; } 42 | 43 | #endregion Injections 44 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Pages/SettingPageViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Pages; 2 | 3 | public sealed partial class SettingPageViewModel : NavViewModelBase 4 | { 5 | public override IReadOnlyList NavItems { get; } = 6 | [ 7 | new("About", AboutPanelName), 8 | new("Appearance", AppearancePanelName), 9 | new("Experience", ExperiencePanelName), 10 | new("File Management", FileManagementPanelName), 11 | new("Download", DownloadPanelName), 12 | new("Advanced", AdvancedPanelName) 13 | ]; 14 | 15 | protected override Task OnActivatedAsync(CompositeDisposable disposables) 16 | { 17 | base.OnActivatedAsync(disposables); 18 | 19 | Logger.ZLogInformation($"{nameof(SettingPageViewModel)} Initialized"); 20 | return Task.CompletedTask; 21 | } 22 | 23 | #region Injections 24 | 25 | [UsedImplicitly] 26 | public required ILogger Logger { get; init; } 27 | 28 | [UsedImplicitly] 29 | public required NavigationService NavigationService { get; init; } 30 | 31 | #endregion Injections 32 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Charting/CharterPanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Charting; 2 | 3 | public sealed class CharterPanelViewModel : ViewModelBase 4 | { 5 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Charting/ChartsPanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Charting; 2 | 3 | public sealed class ChartsPanelViewModel : ViewModelBase 4 | { 5 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Modding/DevelopPanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Modding; 2 | 3 | public sealed class DevelopPanelViewModel : ViewModelBase 4 | { 5 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Modding/MelonLoaderPanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Modding; 2 | 3 | public sealed partial class MelonLoaderPanelViewModel : ViewModelBase 4 | { 5 | [RelayCommand] 6 | private void InstallMelonLoader() 7 | { 8 | // TODO 9 | } 10 | 11 | [RelayCommand] 12 | private void UninstallMelonLoader() 13 | { 14 | // TODO 15 | } 16 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Setting/AdvancedPanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Setting; 2 | 3 | public sealed class AdvancedPanelViewModel : ViewModelBase 4 | { 5 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Setting/AppearancePanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Setting; 2 | 3 | public sealed class AppearancePanelViewModel : ViewModelBase 4 | { 5 | #region Injections 6 | 7 | [UsedImplicitly] 8 | public required Config Config { get; init; } 9 | 10 | #endregion Injections 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Setting/DownloadPanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Setting; 2 | 3 | public sealed partial class DownloadPanelViewModel : ViewModelBase 4 | { 5 | public static string[] DownloadSources { get; } = 6 | [ 7 | XAML_DownloadSource_Github, 8 | XAML_DownloadSource_GithubMirror, 9 | XAML_DownloadSource_Gitee, 10 | XAML_DownloadSource_Custom 11 | ]; 12 | 13 | public static string[] UpdateSources { get; } = 14 | [ 15 | XAML_UpdateSources_GithubAPI, 16 | XAML_UpdateSources_GithubRSS 17 | ]; 18 | 19 | [ObservableProperty] 20 | public partial int SelectedDownloadSourceIndex { get; set; } 21 | 22 | [ObservableProperty] 23 | public partial int SelectedUpdateSourceIndex { get; set; } 24 | 25 | protected override Task OnActivatedAsync(CompositeDisposable disposables) 26 | { 27 | base.OnActivatedAsync(disposables); 28 | 29 | SelectedDownloadSourceIndex = (int)Config.DownloadSource; 30 | SelectedUpdateSourceIndex = (int)Config.UpdateSource; 31 | 32 | Logger.ZLogInformation($"{nameof(DownloadPanelViewModel)} Initialized"); 33 | return Task.CompletedTask; 34 | } 35 | 36 | [UsedImplicitly] 37 | partial void OnSelectedDownloadSourceIndexChanged(int value) => Config.DownloadSource = (DownloadSource)value; 38 | 39 | [UsedImplicitly] 40 | partial void OnSelectedUpdateSourceIndexChanged(int value) => Config.UpdateSource = (UpdateSource)value; 41 | 42 | #region Injections 43 | 44 | [UsedImplicitly] 45 | public required Config Config { get; init; } 46 | 47 | [UsedImplicitly] 48 | public required ILogger Logger { get; init; } 49 | 50 | #endregion Injections 51 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Setting/ExperiencePanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Setting; 2 | 3 | public sealed class ExperiencePanelViewModel : ViewModelBase 4 | { 5 | #region Injections 6 | 7 | [UsedImplicitly] 8 | public required Config Config { get; init; } 9 | 10 | #endregion Injections 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/Panels/Setting/FileManagementPanelViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.ViewModels.Panels.Setting; 2 | 3 | public sealed class FileManagementPanelViewModel : ViewModelBase 4 | { 5 | #region Injections 6 | 7 | [UsedImplicitly] 8 | public required Config Config { get; init; } 9 | 10 | #endregion Injections 11 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/ViewModels/ViewModelBase.cs: -------------------------------------------------------------------------------- 1 | using System.Reactive; 2 | using System.Reactive.Linq; 3 | 4 | namespace MuseDashModTools.ViewModels; 5 | 6 | public partial class ViewModelBase : ObservableObject, IActivatableViewModel 7 | { 8 | #region Injections 9 | 10 | [UsedImplicitly] 11 | public required IPlatformService PlatformService { get; init; } 12 | 13 | #endregion Injections 14 | 15 | public ViewModelBase() 16 | { 17 | this.WhenActivated(disposables => 18 | { 19 | Observable.FromAsync(() => OnActivatedAsync(disposables)) 20 | .Subscribe(OnNext, OnError, OnCompleted) 21 | .DisposeWith(disposables); 22 | 23 | Disposable.Create(OnDeactivated) 24 | .DisposeWith(disposables); 25 | }); 26 | } 27 | 28 | public ViewModelActivator Activator { get; } = new(); 29 | 30 | protected virtual Task OnActivatedAsync(CompositeDisposable disposables) => Task.CompletedTask; 31 | 32 | protected virtual void OnNext(Unit unit) 33 | { 34 | } 35 | 36 | protected virtual void OnError(Exception ex) 37 | { 38 | } 39 | 40 | protected virtual void OnCompleted() 41 | { 42 | } 43 | 44 | protected virtual void OnDeactivated() 45 | { 46 | } 47 | 48 | [RelayCommand] 49 | private Task OpenFileAsync(string filePath) => PlatformService.OpenFileAsync(filePath); 50 | 51 | [RelayCommand] 52 | private Task OpenFolderAsync(string folderPath) => PlatformService.OpenFolderAsync(folderPath); 53 | 54 | [RelayCommand] 55 | private Task OpenUrlAsync(string url) => PlatformService.OpenUriAsync(url); 56 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Dialogs/DonationDialog.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Dialogs; 2 | 3 | public partial class DonationDialog : UserControl 4 | { 5 | public DonationDialog() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/MainWindow.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views; 2 | 3 | public partial class MainWindow : ReactiveUrsaWindow 4 | { 5 | public MainWindow() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/ChartingPage.axaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/ChartingPage.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Pages; 2 | 3 | public partial class ChartingPage : ReactiveUserControl 4 | { 5 | public ChartingPage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/HomePage.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Pages; 2 | 3 | public partial class HomePage : UserControl 4 | { 5 | public HomePage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/LogAnalysisPage.axaml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 18 | LogAnalysisPage still work in progress... 19 | 20 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/LogAnalysisPage.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Pages; 2 | 3 | public partial class LogAnalysisPage : UserControl 4 | { 5 | public LogAnalysisPage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/ModdingPage.axaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/ModdingPage.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Pages; 2 | 3 | public partial class ModdingPage : ReactiveUserControl 4 | { 5 | public ModdingPage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/SettingPage.axaml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Pages/SettingPage.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Pages; 2 | 3 | public partial class SettingPage : ReactiveUserControl 4 | { 5 | public SettingPage() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Charting/CharterPanel.axaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 18 | CharterPanel still work in progress... 19 | 20 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Charting/CharterPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Charting; 2 | 3 | public partial class CharterPanel : UserControl 4 | { 5 | public CharterPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Charting/ChartsPanel.axaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 18 | ChartsPanel still work in progress... 19 | 20 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Charting/ChartsPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Charting; 2 | 3 | public partial class ChartsPanel : UserControl 4 | { 5 | public ChartsPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Modding/DevelopPanel.axaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 18 | DevelopPanel still work in progress... 19 | 20 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Modding/DevelopPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Modding; 2 | 3 | public partial class DevelopPanel : UserControl 4 | { 5 | public DevelopPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Modding/MelonLoaderPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Modding; 2 | 3 | public partial class MelonLoaderPanel : UserControl 4 | { 5 | public MelonLoaderPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Modding/ModsPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Modding; 2 | 3 | public partial class ModsPanel : ReactiveUserControl 4 | { 5 | public ModsPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/AboutPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Setting; 2 | 3 | public partial class AboutPanel : UserControl 4 | { 5 | public AboutPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/AdvancedPanel.axaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 18 | AdvancedPanel still work in progress... 19 | 20 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/AdvancedPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Setting; 2 | 3 | public partial class AdvancedPanel : UserControl 4 | { 5 | public AdvancedPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/AppearancePanel.axaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 22 | 23 | 24 | 25 | 27 | 30 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/AppearancePanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Setting; 2 | 3 | public partial class AppearancePanel : UserControl 4 | { 5 | public AppearancePanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/DownloadPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Setting; 2 | 3 | public partial class DownloadPanel : ReactiveUserControl 4 | { 5 | public DownloadPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/ExperiencePanel.axaml: -------------------------------------------------------------------------------- 1 |  11 | 12 | 13 | 14 | 15 | 16 | 22 | 23 | 24 | 26 | 29 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/ExperiencePanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Setting; 2 | 3 | public partial class ExperiencePanel : UserControl 4 | { 5 | public ExperiencePanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /src/MuseDashModTools/Views/Panels/Setting/FileManagementPanel.axaml.cs: -------------------------------------------------------------------------------- 1 | namespace MuseDashModTools.Views.Panels.Setting; 2 | 3 | public partial class FileManagementPanel : UserControl 4 | { 5 | public FileManagementPanel() 6 | { 7 | InitializeComponent(); 8 | } 9 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Generators.Tests/MuseDashModTools.Generators.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/.gitignore: -------------------------------------------------------------------------------- 1 | # Verify 2 | *.received.* 3 | *.received/ -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/CurrentFile.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace MuseDashModTools.Tests; 4 | 5 | public static class CurrentFile 6 | { 7 | public static string FilePath([CallerFilePath] string file = "") => file; 8 | 9 | public static string DirectoryPath([CallerFilePath] string file = "") => 10 | Path.GetDirectoryName(file)!; 11 | 12 | public static string RelativePath(string relative, [CallerFilePath] string file = "") 13 | { 14 | var directory = Path.GetDirectoryName(file)!; 15 | return Path.Combine(directory, relative); 16 | } 17 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using System.Diagnostics; 2 | global using System.Globalization; 3 | global using JetBrains.Annotations; 4 | global using Moq; 5 | global using MuseDashModTools.Core; 6 | global using MuseDashModTools.Models; 7 | global using MuseDashModTools.Services; -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/MuseDashModTools.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/VerifyChecksTests.cs: -------------------------------------------------------------------------------- 1 | using VerifyTUnit; 2 | 3 | namespace MuseDashModTools.Tests; 4 | 5 | public class VerifyChecksTests 6 | { 7 | [Test] 8 | public Task Run() => VerifyChecks.Run(); 9 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/VerifyGlobalSettings.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | namespace MuseDashModTools.Tests; 4 | 5 | public static class VerifyGlobalSettings 6 | { 7 | [ModuleInitializer] 8 | public static void Initialize() 9 | { 10 | UseProjectRelativeDirectory("snapshots"); 11 | } 12 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/snapshots/JsonSerializationServiceTest.DeserializeAsyncTest.verified.txt: -------------------------------------------------------------------------------- 1 | { 2 | Name: TestMod, 3 | Version: 1.0.0-beta, 4 | Author: test, 5 | DownloadLink: Test Mod.dll, 6 | RepositoryIdentifier: Org/Repo, 7 | ConfigFile: Config.cfg, 8 | GameVersion: *, 9 | Description: A Test Mod, 10 | SHA256: 9fa86686c2a2f256d052e5319b0e7fded0d1ba9a95fd35113d499a28663b40e7 11 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/snapshots/JsonSerializationServiceTest.DeserializeIndentedTest.verified.txt: -------------------------------------------------------------------------------- 1 | { 2 | Name: TestMod, 3 | Version: 1.0.0-beta, 4 | Author: test, 5 | DownloadLink: Test Mod.dll, 6 | RepositoryIdentifier: Org/Repo, 7 | ConfigFile: Config.cfg, 8 | GameVersion: *, 9 | Description: A Test Mod, 10 | SHA256: 9fa86686c2a2f256d052e5319b0e7fded0d1ba9a95fd35113d499a28663b40e7 11 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/snapshots/JsonSerializationServiceTest.DeserializeTest.verified.txt: -------------------------------------------------------------------------------- 1 | { 2 | Name: TestMod, 3 | Version: 1.0.0-beta, 4 | Author: test, 5 | DownloadLink: Test Mod.dll, 6 | RepositoryIdentifier: Org/Repo, 7 | ConfigFile: Config.cfg, 8 | GameVersion: *, 9 | Description: A Test Mod, 10 | SHA256: 9fa86686c2a2f256d052e5319b0e7fded0d1ba9a95fd35113d499a28663b40e7 11 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/snapshots/JsonSerializationServiceTest.SerializeAsyncTest.verified.txt: -------------------------------------------------------------------------------- 1 | {"Name":"TestMod","Version":"1.0.0-beta","Author":"test","DownloadLink":"Test Mod.dll","RepositoryIdentifier":"Org/Repo","ConfigFile":"Config.cfg","GameVersion":"*","Description":"A Test Mod","DependentMods":[],"DependentLibs":[],"IncompatibleMods":[],"SHA256":"9fa86686c2a2f256d052e5319b0e7fded0d1ba9a95fd35113d499a28663b40e7"} -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/snapshots/JsonSerializationServiceTest.SerializeIndentedTest.verified.txt: -------------------------------------------------------------------------------- 1 | { 2 | "Name": "TestMod", 3 | "Version": "1.0.0-beta", 4 | "Author": "test", 5 | "DownloadLink": "Test Mod.dll", 6 | "RepositoryIdentifier": "Org/Repo", 7 | "ConfigFile": "Config.cfg", 8 | "GameVersion": "*", 9 | "Description": "A Test Mod", 10 | "DependentMods": [], 11 | "DependentLibs": [], 12 | "IncompatibleMods": [], 13 | "SHA256": "9fa86686c2a2f256d052e5319b0e7fded0d1ba9a95fd35113d499a28663b40e7" 14 | } -------------------------------------------------------------------------------- /tests/MuseDashModTools.Tests/snapshots/JsonSerializationServiceTest.SerializeTest.verified.txt: -------------------------------------------------------------------------------- 1 | {"Name":"TestMod","Version":"1.0.0-beta","Author":"test","DownloadLink":"Test Mod.dll","RepositoryIdentifier":"Org/Repo","ConfigFile":"Config.cfg","GameVersion":"*","Description":"A Test Mod","DependentMods":[],"DependentLibs":[],"IncompatibleMods":[],"SHA256":"9fa86686c2a2f256d052e5319b0e7fded0d1ba9a95fd35113d499a28663b40e7"} --------------------------------------------------------------------------------