Skip to content

Commit 1f46d28

Browse files
chore: formatting
1 parent 273982e commit 1f46d28

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

fission/src/ui/modals/DevtoolZoneModificationModal.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ const DevtoolZoneModificationModal: React.FC<DevtoolZoneModificationModalProps>
3131
setIsModifying(true)
3232
try {
3333
await onPermanentModification()
34-
globalAddToast?.(
35-
"info",
36-
"Zone Modified",
37-
`${zoneName} has been permanently modified in the field file.`
38-
)
34+
globalAddToast?.("info", "Zone Modified", `${zoneName} has been permanently modified in the field file.`)
3935
} catch (error) {
4036
globalAddToast?.(
4137
"error",
@@ -51,9 +47,7 @@ const DevtoolZoneModificationModal: React.FC<DevtoolZoneModificationModalProps>
5147

5248
return (
5349
<Dialog open={isOpen} onClose={onClose} maxWidth="sm" fullWidth>
54-
<DialogTitle>
55-
Modify {zoneType === "scoring" ? "Scoring" : "Protected"} Zone
56-
</DialogTitle>
50+
<DialogTitle>Modify {zoneType === "scoring" ? "Scoring" : "Protected"} Zone</DialogTitle>
5751
<DialogContent>
5852
<Stack spacing={2}>
5953
<Typography variant="body1">
@@ -64,10 +58,12 @@ const DevtoolZoneModificationModal: React.FC<DevtoolZoneModificationModalProps>
6458
</Typography>
6559
<Stack spacing={1}>
6660
<Typography variant="body2">
67-
<strong>Temporary modification:</strong> Save changes until next field reload. Original zone will reappear when you refresh the page.
61+
<strong>Temporary modification:</strong> Save changes until next field reload. Original zone
62+
will reappear when you refresh the page.
6863
</Typography>
6964
<Typography variant="body2">
70-
<strong>Permanent modification:</strong> Save changes to the local asset file. This will persist your modifications until you remove it from the cache.
65+
<strong>Permanent modification:</strong> Save changes to the local asset file. This will
66+
persist your modifications until you remove it from the cache.
7167
</Typography>
7268
</Stack>
7369
</Stack>

fission/src/util/DevtoolZoneUtils.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import FieldMiraEditor from "@/mirabuf/FieldMiraEditor"
22
import MirabufCachingService, { MiraType } from "@/mirabuf/MirabufLoader"
33
import PreferencesSystem from "@/systems/preferences/PreferencesSystem"
4-
import type { BaseZonePreferences, ProtectedZonePreferences, ScoringZonePreferences } from "@/systems/preferences/PreferenceTypes"
4+
import type {
5+
BaseZonePreferences,
6+
ProtectedZonePreferences,
7+
ScoringZonePreferences,
8+
} from "@/systems/preferences/PreferenceTypes"
59
import World from "@/systems/World"
610

711
export type ZoneType = "scoring" | "protected"
@@ -21,10 +25,7 @@ function zonesEqual(zone1: BaseZonePreferences, zone2: BaseZonePreferences): boo
2125
/**
2226
* Checks if a zone was originally defined in the field file by comparing it with the cached field data.
2327
*/
24-
export function isZoneFromDevtools(
25-
zone: BaseZonePreferences,
26-
zoneType: ZoneType
27-
): boolean {
28+
export function isZoneFromDevtools(zone: BaseZonePreferences, zoneType: ZoneType): boolean {
2829
const field = World.sceneRenderer.mirabufSceneObjects.getField()
2930
if (!field) return false
3031

@@ -36,7 +37,7 @@ export function isZoneFromDevtools(
3637
if (zoneType === "protected") {
3738
return false
3839
}
39-
40+
4041
const devtoolZones = editor.getUserData("devtool:scoring_zones") as ScoringZonePreferences[] | undefined
4142
if (!devtoolZones) return false
4243

@@ -57,11 +58,11 @@ export async function removeZoneFromDevtools(
5758
if (!parts) throw new Error("No field parts found")
5859

5960
const editor = new FieldMiraEditor(parts)
60-
61+
6162
if (zoneType === "protected") {
6263
throw new Error("Protected zone field file removal not yet implemented")
6364
}
64-
65+
6566
const devtoolZones = editor.getUserData("devtool:scoring_zones") as ScoringZonePreferences[] | undefined
6667
if (!devtoolZones) return
6768

@@ -103,11 +104,11 @@ export async function modifyZoneInDevtools(
103104
if (!parts) throw new Error("No field parts found")
104105

105106
const editor = new FieldMiraEditor(parts)
106-
107+
107108
if (zoneType === "protected") {
108109
throw new Error("Protected zone field file modification not yet implemented")
109110
}
110-
111+
111112
const devtoolZones = editor.getUserData("devtool:scoring_zones") as ScoringZonePreferences[] | undefined
112113
if (!devtoolZones) return
113114

0 commit comments

Comments
 (0)