Skip to content
This repository was archived by the owner on May 30, 2026. It is now read-only.

Commit 4d2d6e0

Browse files
committed
fix pop
1 parent 7e4f1e6 commit 4d2d6e0

4 files changed

Lines changed: 5 additions & 17 deletions

File tree

Overlayer/Utils/DeletePopup.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,18 +128,12 @@ private void DrawWindow(int windowID) {
128128
GUILayout.FlexibleSpace();
129129

130130
if(Drawer.Button($"<size=18>{Main.Lang.Get("YES", "Yes")}</size>", GUILayout.Width(150), GUILayout.Height(52))) {
131-
132-
if(obj != null) {
133-
obj.Parent.ObjectManager.Destroy(obj);
134-
}
131+
obj?.Parent.ObjectManager.Destroy(obj);
135132

136133
if(profile != null) {
137134
ProfileManager.Destroy(profile);
138135
}
139136

140-
Main.GUI.Skip(frames: 2);
141-
Main.GUI.Pop();
142-
143137
Destroy(gameObject);
144138

145139
OnDelete?.Invoke();

Overlayer/Views/ImageConfigDrawer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ public override void Draw() {
151151
GUI.color = new Color(1f, 0.8f, 0.8f);
152152
if(Drawer.Button(Drawer.Icon_X, GUILayout.Width(46))) {
153153
image.Parent.ObjectManager.Destroy(image);
154-
Main.GUI.Skip(frames: 2);
155154
Main.GUI.Pop();
156155
return;
157156
}

Overlayer/Views/ProfileDrawer.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ public override void Draw() {
171171
}
172172
GUI.color = new Color(0.8f, 1f, 0.8f);
173173
if(Drawer.Button(Drawer.Icon_Copy, GUILayout.Width(46))) {
174-
175174
switch(obj.Config) {
176175
case TextConfig cfg:
177176
profile.ObjectManager.Create((TextConfig)cfg.Copy());
@@ -180,19 +179,16 @@ public override void Draw() {
180179
profile.ObjectManager.Create((ImageConfig)cfg.Copy());
181180
break;
182181
}
183-
184182
dragSoltNeedInit = true;
185183
}
186184
GUI.color = new Color(1f, 0.8f, 0.8f);
187185
if(Drawer.Button(Drawer.Icon_X, GUILayout.Width(46))) {
188186
if(Event.current.shift) {
189187
profile.ObjectManager.Destroy(obj);
190-
} else {
191-
if(UnityEngine.Object.FindAnyObjectByType<DeletePopup>() == null) {
192-
var popup = new GameObject().AddComponent<DeletePopup>();
193-
UnityEngine.Object.DontDestroyOnLoad(popup);
194-
popup.Initialize(obj, () => dragSoltNeedInit = true);
195-
}
188+
} else if(UnityEngine.Object.FindAnyObjectByType<DeletePopup>() == null) {
189+
var popup = new GameObject().AddComponent<DeletePopup>();
190+
UnityEngine.Object.DontDestroyOnLoad(popup);
191+
popup.Initialize(obj, () => dragSoltNeedInit = true);
196192
}
197193
return;
198194
}

Overlayer/Views/TextConfigDrawer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ public override void Draw() {
168168
GUI.color = new Color(1f, 0.8f, 0.8f);
169169
if(Drawer.Button(Drawer.Icon_X, GUILayout.Width(46))) {
170170
text.Parent.ObjectManager.Destroy(text);
171-
Main.GUI.Skip(frames: 2);
172171
Main.GUI.Pop();
173172
return;
174173
}

0 commit comments

Comments
 (0)