Skip to content

Commit df87e3f

Browse files
committed
feat: hide ai restyle & rewrite during story creation
1 parent a082479 commit df87e3f

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

‎src/Features/General/HideMetaAI.xm‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@
250250
entryPoint:(long long)arg15
251251
canTapAuthor:(_Bool)arg16
252252
{
253-
BOOL hideAiRestyle = [SCIUtils getBoolPref:@"hide_meta_ai"];
253+
BOOL showAiRestyle = [SCIUtils getBoolPref:@"hide_meta_ai"] ? false : arg6;
254254

255-
return %orig(arg1, arg2, arg3, arg4, arg5, !hideAiRestyle, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
255+
return %orig(arg1, arg2, arg3, arg4, arg5, showAiRestyle, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16);
256256
}
257257
%end
258258

@@ -400,6 +400,22 @@
400400
}
401401
%end
402402

403+
// Text rewrite in text entry
404+
%hook IGStoryTextMentionLocationPickerView
405+
- (id)initWithIsTextRewriteEnabled:(_Bool)arg1
406+
isImageRewriteEnabled:(_Bool)arg2
407+
isStackedToolSelectorEnabled:(_Bool)arg3
408+
isMentionLocationVisible:(_Bool)arg4
409+
isEnabledForFeedCaption:(_Bool)arg5
410+
isFeedEntryPoint:(_Bool)arg6
411+
{
412+
_Bool isTextRewriteEnabled = [SCIUtils getBoolPref:@"hide_meta_ai"] ? false : arg1;
413+
_Bool isImageRewriteEnabled = [SCIUtils getBoolPref:@"hide_meta_ai"] ? false : arg2;
414+
415+
return %orig(isTextRewriteEnabled, isImageRewriteEnabled, arg3, arg4, arg5, arg6);
416+
}
417+
%end
418+
403419
// "Imagine background" in story editor vertical action bar
404420
%hook _TtC17IGCreationOSSwift19IGCreationHeaderBar
405421
- (void)setButtons:(id)buttons maxItems:(NSInteger)max {

0 commit comments

Comments
 (0)