diff --git a/VoidLink/Base.lproj/iPhone.storyboard b/VoidLink/Base.lproj/iPhone.storyboard index 53088bc5..d4bdd36d 100644 --- a/VoidLink/Base.lproj/iPhone.storyboard +++ b/VoidLink/Base.lproj/iPhone.storyboard @@ -1,9 +1,9 @@ - + - + @@ -14,7 +14,7 @@ - + @@ -81,7 +81,7 @@ - + @@ -677,12 +677,12 @@ - + - + @@ -1542,29 +1542,6 @@ - - - - - - - - - - - - - - - - - - @@ -1626,41 +1603,6 @@ - - - - - - - - - - - - - - - - - - - - - - - @@ -1685,6 +1627,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1729,7 +1727,6 @@ - @@ -1742,6 +1739,7 @@ + diff --git a/VoidLink/Localization/Localizable.xcstrings b/VoidLink/Localization/Localizable.xcstrings index d8dbd8f1..0560ad6a 100644 --- a/VoidLink/Localization/Localizable.xcstrings +++ b/VoidLink/Localization/Localizable.xcstrings @@ -421,6 +421,29 @@ } } }, + "%d%% opacity" : { + "extractionState" : "manual", + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d%%不透明度" + } + }, + "zh-Hant" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d%%不透明度" + } + }, + "zh-HK" : { + "stringUnit" : { + "state" : "translated", + "value" : "%d%%不透明度" + } + } + } + }, "%d%% screen width" : { "extractionState" : "manual", "localizations" : { diff --git a/VoidLink/ViewControllers/SettingsViewController.h b/VoidLink/ViewControllers/SettingsViewController.h index 696792e3..b57faf1e 100644 --- a/VoidLink/ViewControllers/SettingsViewController.h +++ b/VoidLink/ViewControllers/SettingsViewController.h @@ -115,6 +115,7 @@ @property (strong, nonatomic) IBOutlet UILabel *enableGraphsLabel; @property (strong, nonatomic) IBOutlet UISwitch *enableGraphsSwitch; @property (strong, nonatomic) IBOutlet UIStepper *graphOpacityStepper; +@property (strong, nonatomic) IBOutlet UIStackView *graphOpacityStack; @property (strong, nonatomic) IBOutlet UISegmentedControl *renderingBackendSelector; @property (strong, nonatomic) IBOutlet UISegmentedControl *framePacingModeSelector; diff --git a/VoidLink/ViewControllers/SettingsViewController.m b/VoidLink/ViewControllers/SettingsViewController.m index cb90ab5e..ec15ce34 100644 --- a/VoidLink/ViewControllers/SettingsViewController.m +++ b/VoidLink/ViewControllers/SettingsViewController.m @@ -42,7 +42,6 @@ MenuSectionView *touchAndControlSection; NSMutableSet* hiddenStacks; NSInteger _frameQueueSize; - NSInteger _graphOpacity; } @dynamic overrideUserInterfaceStyle; @@ -644,7 +643,10 @@ BOOL isCustomResolution(int resolutionSelected) { [self addSetting:self.optimizeGamesStack ofId:@"optimizeGamesStack" withInfoTag:YES withDynamicLabel:NO to:otherSection]; [self addSetting:self.multiControllerStack ofId:@"multiControllerStack" withInfoTag:NO withDynamicLabel:NO to:otherSection]; [self addSetting:self.softKeyboardToolbarStack ofId:@"softKeyboardToolbarStack" withInfoTag:NO withDynamicLabel:NO to:otherSection]; + [self addSetting:self.performanceGraphStack ofId:@"performanceGraphStack" withInfoTag:YES withDynamicLabel:NO to:otherSection]; + [self addDynamicLabelForStack:self.graphOpacityStack]; + [otherSection addToParentStack:_parentStack]; [otherSection setExpanded:YES]; @@ -1329,7 +1331,6 @@ BOOL isCustomResolution(int resolutionSelected) { // Ensure we pick a bitrate that falls exactly onto a slider notch _bitrate = bitrateTable[[self getSliderValueForBitrate:[currentSettings.bitrate intValue]]]; _frameQueueSize = [currentSettings.frameQueueSize intValue]; - _graphOpacity = [currentSettings.graphOpacity intValue]; // Get the size of the screen with and without safe area insets // UIWindow *window = UIApplication.sharedApplication.windows.firstObject; @@ -1489,9 +1490,9 @@ BOOL isCustomResolution(int resolutionSelected) { [self enableGraphsChanged]; [self.graphOpacityStepper setMinimumValue:0]; [self.graphOpacityStepper setMaximumValue:100]; - [self.graphOpacityStepper setValue:_graphOpacity]; - [self.graphOpacityStepper addTarget:self action:@selector(graphOpacityStepperMoved) forControlEvents:UIControlEventValueChanged]; - [self updateGraphOpacityText]; + [self.graphOpacityStepper setValue:(int)currentSettings.graphOpacity.intValue]; + [self.graphOpacityStepper addTarget:self action:@selector(graphOpacityStepperTapped:) forControlEvents:UIControlEventValueChanged]; + [self graphOpacityStepperTapped:self.graphOpacityStepper]; if (@available(iOS 18.0, tvOS 18.0, *)) {}else{ [self.audioConfigSelector removeSegmentAtIndex:1 animated:false]; @@ -2272,14 +2273,9 @@ BOOL isCustomResolution(int resolutionSelected) { [self.graphOpacityStepper setEnabled:[self.enableGraphsSwitch isOn]]; } -- (void) graphOpacityStepperMoved { - assert(self.graphOpacityStepper.value >= 0 && self.graphOpacityStepper.value <= 100); - _graphOpacity = (int)self.graphOpacityStepper.value; - [self updateGraphOpacityText]; -} - -- (void) updateGraphOpacityText { - [self.enableGraphsLabel setText:[NSString stringWithFormat:NSLocalizedString(@"Performance Graphs - Opacity: %ld%%", @"Performance graphs opacity label"), _graphOpacity ]]; +- (void) graphOpacityStepperTapped:(UIStepper* )sender { + assert(self.graphOpacityStepper.value >= 0 && sender.value <= 100); + [self findDynamicLabelFromStack:_graphOpacityStack].text = [LocalizationHelper localizedStringForKey:@"%d%% opacity",(int)sender.value]; } - (void) saveSettings { @@ -2328,6 +2324,7 @@ BOOL isCustomResolution(int resolutionSelected) { BOOL enableHdr = self.hdrSwitch.isOn; BOOL unlockDisplayOrientation = [self.unlockDisplayOrientationSelector selectedSegmentIndex] == 1; BOOL enableGraphs = self.enableGraphsSwitch.isOn; + int graphOpacity = (int)self.graphOpacityStepper.value; NSInteger resolutionSelected = [self.resolutionSelector selectedSegmentIndex]; if (self.customResolutionSwitch.isOn) { resolutionSelected = RESOLUTION_TABLE_CUSTOM_INDEX; @@ -2375,7 +2372,7 @@ BOOL isCustomResolution(int resolutionSelected) { localMousePointerMode:localMousePointerMode frameQueueSize:_frameQueueSize enableGraphs:enableGraphs - graphOpacity:_graphOpacity + graphOpacity:graphOpacity renderingBackend:renderingBackend framePacingMode:framePacingMode backgroundSessionTimer:backgroundSessionTimer]; diff --git a/VoidLink/mul.lproj/iPhone.xcstrings b/VoidLink/mul.lproj/iPhone.xcstrings index 9f4fb8d9..daceb583 100644 --- a/VoidLink/mul.lproj/iPhone.xcstrings +++ b/VoidLink/mul.lproj/iPhone.xcstrings @@ -93,7 +93,7 @@ }, "3Ff-AF-K42.text" : { "comment" : "Class = \"UILabel\"; text = \"Displays frametime and buffer health metrics. Adjust the opacity if they obscure parts of the screen. Swipe up/down with two fingers to show or hide all stats.\"; ObjectID = \"3Ff-AF-K42\";", - "extractionState" : "extracted_with_value", + "extractionState" : "stale", "localizations" : { "en" : { "stringUnit" : { @@ -1886,31 +1886,31 @@ } }, "LVq-7c-3zg.text" : { - "comment" : "Class = \"UILabel\"; text = \"Performance Graphs - Opacity: 50%\"; ObjectID = \"LVq-7c-3zg\";", + "comment" : "Class = \"UILabel\"; text = \"Performance Graphs\"; ObjectID = \"LVq-7c-3zg\";", "extractionState" : "extracted_with_value", "localizations" : { "en" : { "stringUnit" : { "state" : "new", - "value" : "Performance Graphs - Opacity: 50%" + "value" : "Performance Graphs" } }, "zh-Hans" : { "stringUnit" : { "state" : "translated", - "value" : "性能图表 - 不透明度:50%" + "value" : "性能图表" } }, "zh-Hant" : { "stringUnit" : { "state" : "translated", - "value" : "效能圖表 - 不透明度:50%" + "value" : "效能圖表" } }, "zh-HK" : { "stringUnit" : { "state" : "translated", - "value" : "效能圖表 - 不透明度:50%" + "value" : "效能圖表" } } }