From 16bd288e7039e7c49a4fc3a5e22bc4f4956ac480 Mon Sep 17 00:00:00 2001 From: TrueZhuanjia Date: Sun, 28 Dec 2025 20:50:21 +0800 Subject: [PATCH] preset profile editing --- VoidLink/Input/CustomOSC/OSCProfilesManager.h | 4 ++-- .../LayoutOnScreenControlsViewController.m | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/VoidLink/Input/CustomOSC/OSCProfilesManager.h b/VoidLink/Input/CustomOSC/OSCProfilesManager.h index 11f994bc..2178251b 100644 --- a/VoidLink/Input/CustomOSC/OSCProfilesManager.h +++ b/VoidLink/Input/CustomOSC/OSCProfilesManager.h @@ -45,8 +45,6 @@ NS_ASSUME_NONNULL_BEGIN * Returns the index of the 'selected' profile within the array it's in */ - (NSInteger) getIndexOfSelectedProfile; -- (void)replaceSelectedProfileWith:(OSCProfile*)newProfile overwriteDefault:(bool)overwriteDefault; - - (NSMutableArray *) getEncodedProfiles; // - (NSData* )getSelectedEncodedProfile; - (void) importEncodedProfiles:(NSMutableArray* )profilesEncoded; @@ -58,6 +56,8 @@ NS_ASSUME_NONNULL_BEGIN * Sets the profile object with the particular index as the selected profile to be displayed on screen during game streaming */ - (void) setProfileToSelected:(uint32_t)index; +- (void) replaceSelectedProfileWith:(OSCProfile*)newProfile overwriteDefault:(bool)overwriteDefault; +- (void) replaceProfile:(OSCProfile*)oldProfile withProfile:(OSCProfile*)newProfile; /** * Saves a profile object with a particular 'name' and an array of button layers (the CALayer button layers are the objects currently visible on screen) to persistent storage diff --git a/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m b/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m index 5afccda9..c4d9b2b3 100644 --- a/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m +++ b/VoidLink/ViewControllers/CustomOSCViewControl/LayoutOnScreenControlsViewController.m @@ -834,6 +834,15 @@ typedef NS_ENUM(NSUInteger, DecelerationRateSliderMode) { /* show pop up notification that lets users choose to save the current OSC layout configuration as a profile they can load when they want. User can also choose to cancel out of this pop up */ - (IBAction) saveTapped:(id)sender { + + /* + OSCProfile* targetProfile = [profilesManager getAllProfiles][3]; + OSCProfile* currentProfile = [profilesManager getSelectedProfile]; + currentProfile.name = @"RPG游戏示例 / RPG example (ZZZ in Genshin style)"; + // currentProfile.name = @"Default"; + [profilesManager replaceProfile:targetProfile withProfile:currentProfile]; + */ + [self clearSickInput]; [OSCProfilesManager setLayoutViewBounds:self.view.bounds];