Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into avalonia-v11-port
Browse files Browse the repository at this point in the history
  • Loading branch information
psyGamer committed Jul 19, 2023
2 parents e688ff2 + 799f06d commit 3ab9f21
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 66 deletions.
2 changes: 1 addition & 1 deletion CelesteTAS-EverestInterop
Submodule CelesteTAS-EverestInterop updated 81 files
+1 −1 .editorconfig
+9 −9 CelesteTAS-EverestInterop.sln
+1 −0 CelesteTAS-EverestInterop/CelesteTAS-EverestInterop.csproj
+1 −0 CelesteTAS-EverestInterop/Dialog/English.txt
+1 −0 CelesteTAS-EverestInterop/Dialog/Simplified Chinese.txt
+42 −6 CelesteTAS-EverestInterop/Source/Communication/StudioCommunicationClient.cs
+10 −0 CelesteTAS-EverestInterop/Source/EverestInterop/AreaCompleteInfo.cs
+2 −0 CelesteTAS-EverestInterop/Source/EverestInterop/CenterCamera.cs
+66 −32 CelesteTAS-EverestInterop/Source/EverestInterop/Core.cs
+1 −1 CelesteTAS-EverestInterop/Source/EverestInterop/DebugRcPage.cs
+93 −28 CelesteTAS-EverestInterop/Source/EverestInterop/DesyncFixer.cs
+7 −0 CelesteTAS-EverestInterop/Source/EverestInterop/DisableRumble.cs
+2 −2 CelesteTAS-EverestInterop/Source/EverestInterop/EntityDataHelper.cs
+9 −3 CelesteTAS-EverestInterop/Source/EverestInterop/FastForwardBoost.cs
+14 −4 CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/ActualEntityCollideHitbox.cs
+37 −8 CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/CycleHitboxColor.cs
+4 −2 CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxColor.cs
+41 −1 CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxNpc.cs
+149 −38 CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxOptimized.cs
+36 −8 CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/HitboxSimplified.cs
+9 −5 CelesteTAS-EverestInterop/Source/EverestInterop/Hitboxes/UnloadedRoomHitbox.cs
+4 −0 CelesteTAS-EverestInterop/Source/EverestInterop/Hotkeys.cs
+11 −9 CelesteTAS-EverestInterop/Source/EverestInterop/InfoHUD/InfoCustom.cs
+1 −1 CelesteTAS-EverestInterop/Source/EverestInterop/InfoHUD/InfoHud.cs
+2 −2 CelesteTAS-EverestInterop/Source/EverestInterop/InfoHUD/InfoMouse.cs
+34 −2 CelesteTAS-EverestInterop/Source/EverestInterop/MonocleCommands.cs
+24 −0 CelesteTAS-EverestInterop/Source/EverestInterop/PreventExitGame.cs
+0 −2 CelesteTAS-EverestInterop/Source/EverestInterop/RestoreSettings.cs
+31 −12 CelesteTAS-EverestInterop/Source/EverestInterop/SimplifiedGraphicsFeature.cs
+5 −3 CelesteTAS-EverestInterop/Source/GlobalUsings.cs
+4 −1 CelesteTAS-EverestInterop/Source/Module/CelesteTasMenu.cs
+4 −10 CelesteTAS-EverestInterop/Source/Module/CelesteTasModule.cs
+16 −7 CelesteTAS-EverestInterop/Source/Module/CelesteTasSettings.cs
+7 −4 CelesteTAS-EverestInterop/Source/TAS/AnalogHelper.cs
+14 −5 CelesteTAS-EverestInterop/Source/TAS/BindingHelper.cs
+55 −10 CelesteTAS-EverestInterop/Source/TAS/ExportGameInfo.cs
+37 −18 CelesteTAS-EverestInterop/Source/TAS/GameInfo.cs
+97 −0 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/AssertCommand.cs
+5 −3 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/Command.cs
+33 −5 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/ConsoleCommand.cs
+12 −0 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/DummyCommands.cs
+5 −0 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/ExitGameCommand.cs
+20 −0 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/MouseCommand.cs
+6 −2 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/ReadCommand.cs
+22 −3 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/SetCommand.cs
+37 −18 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/StunPauseCommand.cs
+1 −1 CelesteTAS-EverestInterop/Source/TAS/Input/Commands/TasCommandAttribute.cs
+6 −2 CelesteTAS-EverestInterop/Source/TAS/Input/InputController.cs
+88 −202 CelesteTAS-EverestInterop/Source/TAS/Input/InputFrame.cs
+102 −0 CelesteTAS-EverestInterop/Source/TAS/InputHelper.cs
+1 −0 CelesteTAS-EverestInterop/Source/TAS/LibTasHelper.cs
+3 −96 CelesteTAS-EverestInterop/Source/TAS/Manager.cs
+2 −1 CelesteTAS-EverestInterop/Source/TAS/Savestates.cs
+20 −10 CelesteTAS-EverestInterop/Source/Utils/ExtendedVariantsUtils.cs
+23 −10 CelesteTAS-EverestInterop/Source/Utils/Extensions.cs
+32 −0 CelesteTAS-EverestInterop/Source/Utils/HookHelper.cs
+5 −9 CelesteTAS-EverestInterop/Source/Utils/LogUtil.cs
+13 −2 CelesteTAS-EverestInterop/Source/Utils/SpeedrunToolUtils.cs
+2 −1 CelesteTAS-EverestInterop/everest.yaml
+ CelesteTAS-EverestInterop/lib-stripped/ExtendedVariantMode.dll
+58 −52 CelesteTAS-EverestInterop/packages.lock.json
+18 −2 Docs/Commands.md
+9 −6 README.md
+2 −2 Studio/CelesteStudio.csproj
+5 −5 Studio/Communication/StudioCommunicationServer.cs
+4 −1 Studio/DialogUtils.cs
+64 −191 Studio/Entities/InputRecord.cs
+201 −0 Studio/IntegrateReadFiles.cs
+9 −1 Studio/RichText/CommandManager.cs
+6 −4 Studio/RichText/Commands.cs
+7 −7 Studio/RichText/RichText.cs
+1 −0 Studio/Settings.cs
+31 −3 Studio/Studio.Designer.cs
+72 −17 Studio/Studio.cs
+60 −54 Studio/Themes.cs
+14 −0 Studio/Win32Api.cs
+102 −0 StudioCommunication/Actions.cs
+8 −0 StudioCommunication/PlatformUtils.cs
+1 −1 StudioCommunication/State.cs
+2 −0 StudioCommunication/StudioCommunication.projitems
+9 −3 StudioCommunication/StudioCommunicationBase.cs
5 changes: 4 additions & 1 deletion TAS.Avalonia/Controls/EditorControl.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// #define AUTOMATIC_CURSOR

using Avalonia;
using Avalonia.Controls;
using AvaloniaEdit;
Expand Down Expand Up @@ -40,10 +42,11 @@ public EditorControl() {
_textMateInstallation = editor.InstallTextMate(_registryOptions);
var csharpLanguage = _registryOptions.GetLanguageByExtension(".cs");
_textMateInstallation.SetGrammar(_registryOptions.GetScopeByLanguageId(csharpLanguage.Id));
#if AUTOMATIC_CURSOR
editor.TextArea.ActiveInputHandler = new TASInputHandler(editor.TextArea);
editor.TextArea.PushStackedInputHandler(new TASStackedInputHandler(editor.TextArea));
editor.TextArea.Caret.PositionChanged += (_, _) => CaretPosition = editor.TextArea.Caret.Position;

#endif
PropertyChanged += (_, e) => {
if (e.Property == CaretPositionProperty) {
editor.TextArea.Caret.Position = (TextViewPosition) e.NewValue!;
Expand Down
2 changes: 2 additions & 0 deletions TAS.Avalonia/Models/MenuModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public MenuItem ToMenuItem() {
Header = Header,
Command = Command,
CommandParameter = CommandParameter,
HotKey = Gesture,
InputGesture = Gesture,
IsEnabled = IsEnabled ?? (Items.Any() || Command?.CanExecute(CommandParameter) == true),
IsVisible = IsVisible,
};
Expand Down
133 changes: 70 additions & 63 deletions TAS.Avalonia/ViewModels/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,72 +127,79 @@ public MainWindowViewModel() {
EditorContextMenu = CreateContextMenu();
}

private MenuModel[] CreateMenu(bool includeExit) => new[] {
new MenuModel("_File", isEnabled: true) {
new MenuModel("New File", NewFileCommand, gesture: new KeyGesture(Key.N, KeyModifiers.Meta)),
MenuModel.Separator,
new MenuModel("Open File...", OpenFileCommand, gesture: new KeyGesture(Key.O, KeyModifiers.Meta)),
new MenuModel("Open Previous File"),
new MenuModel("Open Recent") {
new MenuModel("Celeste.tas"),
},
new MenuModel("Open Backup") {
new MenuModel("Celeste.tas"),
private MenuModel[] CreateMenu(bool includeExit) {
var commandModifier = KeyModifiers.Control;
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) {
commandModifier = KeyModifiers.Meta;
}

return new[] {
new MenuModel("_File", isEnabled: true) {
new MenuModel("New File", NewFileCommand, gesture: new KeyGesture(Key.N, commandModifier)),
MenuModel.Separator,
new MenuModel("Open File...", OpenFileCommand, gesture: new KeyGesture(Key.O, commandModifier)),
new MenuModel("Open Previous File"),
new MenuModel("Open Recent") {
new MenuModel("Celeste.tas"),
},
new MenuModel("Open Backup") {
new MenuModel("Celeste.tas"),
},
MenuModel.Separator,
new MenuModel("Save", SaveFileCommand, gesture: new KeyGesture(Key.S, commandModifier)),
new MenuModel("Save As...", SaveFileAsCommand, gesture: new KeyGesture(Key.S, commandModifier | KeyModifiers.Shift)),
new MenuModel("Convert to LibTAS Inputs..."),
new MenuModel(string.Empty, isVisible: includeExit),
new MenuModel("Exit", ExitCommand, isVisible: includeExit),
},
MenuModel.Separator,
new MenuModel("Save", SaveFileCommand, gesture: new KeyGesture(Key.S, KeyModifiers.Meta)),
new MenuModel("Save As...", SaveFileAsCommand, gesture: new KeyGesture(Key.S, KeyModifiers.Meta | KeyModifiers.Shift)),
new MenuModel("Convert to LibTAS Inputs..."),
new MenuModel(string.Empty, isVisible: includeExit),
new MenuModel("Exit", ExitCommand, isVisible: includeExit),
},
new MenuModel("Settings") {
new MenuModel("Send Inputs to Celeste"),
new MenuModel("Auto Remove Mutually Exclusive Actions"),
new MenuModel("Show Game Info"),
new MenuModel("Automatic Backup") {
new MenuModel("Enabled"),
new MenuModel("Backup Rate (minutes): 1"),
new MenuModel("Backup File Count: 100"),
new MenuModel("Settings") {
new MenuModel("Send Inputs to Celeste"),
new MenuModel("Auto Remove Mutually Exclusive Actions"),
new MenuModel("Show Game Info"),
new MenuModel("Automatic Backup") {
new MenuModel("Enabled"),
new MenuModel("Backup Rate (minutes): 1"),
new MenuModel("Backup File Count: 100"),
},
new MenuModel("Font..."),
new MenuModel("Themes") {
new MenuModel("Light"),
new MenuModel("Dark"),
new MenuModel("Custom"),
},
},
new MenuModel("Font..."),
new MenuModel("Themes") {
new MenuModel("Light"),
new MenuModel("Dark"),
new MenuModel("Custom"),
new MenuModel("Toggles") {
new MenuModel("Hitboxes", command: ToggleHitboxesCommand),
new MenuModel("Trigger Hitboxes", command: ToggleTriggerHitboxesCommand),
new MenuModel("Unloaded Rooms Hitboxes", command: ToggleUnloadedRoomsHitboxesCommand),
new MenuModel("Camera Hitboxes", command: ToggleCameraHitboxesCommand),
new MenuModel("Simplified Hitboxes", command: ToggleSimplifiedHitboxesCommand),
new MenuModel("Actual Collide Hitboxes", command: ToggleActualCollideHitboxesCommand),
MenuModel.Separator,
new MenuModel("Simplified Graphics", command: ToggleSimplifiedGraphicsCommand),
new MenuModel("Gameplay", command: ToggleGameplayCommand),
MenuModel.Separator,
new MenuModel("Center Camera", command: ToggleCenterCameraCommand),
MenuModel.Separator,
new MenuModel("Info HUD", command: ToggleInfoHudCommand),
new MenuModel("TAS Input Info", command: ToggleInfoTasInputCommand),
new MenuModel("Game Info", command: ToggleInfoGameCommand),
new MenuModel("Watch Entity Info", command: ToggleInfoWatchEntityCommand),
new MenuModel("Custom Info", command: ToggleInfoCustomCommand),
new MenuModel("Subpixel Indicator", command: ToggleInfoSubpixelIndicatorCommand),
new MenuModel("Unit of Speed", command: ToggleUnitOfSpeedCommand),
MenuModel.Separator,
new MenuModel("Position Decimals", command: SetPositionDecimalsCommand),
new MenuModel("Speed Decimals", command: SetSpeedDecimalsCommand),
new MenuModel("Velocity Decimals", command: SetVelocityDecimalsCommand),
new MenuModel("Custom Info Decimals", command: SetCustomInfoDecimalsCommand),
new MenuModel("Subpixel Indicator Decimals", command: SetSubpixelIndicatorDecimalsCommand),
MenuModel.Separator,
new MenuModel("Fast Forward Speed", command: SetFastForwardSpeedCommand),
new MenuModel("Slow Forward Speed", command: SetSlowForwardSpeedCommand),
},
},
new MenuModel("Toggles") {
new MenuModel("Hitboxes", command: ToggleHitboxesCommand),
new MenuModel("Trigger Hitboxes", command: ToggleTriggerHitboxesCommand),
new MenuModel("Unloaded Rooms Hitboxes", command: ToggleUnloadedRoomsHitboxesCommand),
new MenuModel("Camera Hitboxes", command: ToggleCameraHitboxesCommand),
new MenuModel("Simplified Hitboxes", command: ToggleSimplifiedHitboxesCommand),
new MenuModel("Actual Collide Hitboxes", command: ToggleActualCollideHitboxesCommand),
MenuModel.Separator,
new MenuModel("Simplified Graphics", command: ToggleSimplifiedGraphicsCommand),
new MenuModel("Gameplay", command: ToggleGameplayCommand),
MenuModel.Separator,
new MenuModel("Center Camera", command: ToggleCenterCameraCommand),
MenuModel.Separator,
new MenuModel("Info HUD", command: ToggleInfoHudCommand),
new MenuModel("TAS Input Info", command: ToggleInfoTasInputCommand),
new MenuModel("Game Info", command: ToggleInfoGameCommand),
new MenuModel("Watch Entity Info", command: ToggleInfoWatchEntityCommand),
new MenuModel("Custom Info", command: ToggleInfoCustomCommand),
new MenuModel("Subpixel Indicator", command: ToggleInfoSubpixelIndicatorCommand),
new MenuModel("Unit of Speed", command: ToggleUnitOfSpeedCommand),
MenuModel.Separator,
new MenuModel("Position Decimals", command: SetPositionDecimalsCommand),
new MenuModel("Speed Decimals", command: SetSpeedDecimalsCommand),
new MenuModel("Velocity Decimals", command: SetVelocityDecimalsCommand),
new MenuModel("Custom Info Decimals", command: SetCustomInfoDecimalsCommand),
new MenuModel("Subpixel Indicator Decimals", command: SetSubpixelIndicatorDecimalsCommand),
MenuModel.Separator,
new MenuModel("Fast Forward Speed", command: SetFastForwardSpeedCommand),
new MenuModel("Slow Forward Speed", command: SetSlowForwardSpeedCommand),
},
};
};
}

private MenuModel[] CreateContextMenu() => new[] {
new MenuModel("Cut"),
Expand Down
2 changes: 1 addition & 1 deletion TAS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TAS.Avalonia", "TAS.Avalonia\TAS.Avalonia.csproj", "{1B77590F-1D93-4B7C-953A-8C718D15D855}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "StudioCommunication", "..\CelesteTAS-EverestInterop\StudioCommunication\StudioCommunication.shproj", "{6B20B22D-D4C8-4F9D-A84A-E340551AE591}"
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "StudioCommunication", "CelesteTAS-EverestInterop\StudioCommunication\StudioCommunication.shproj", "{6B20B22D-D4C8-4F9D-A84A-E340551AE591}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

0 comments on commit 3ab9f21

Please sign in to comment.