Skip to content

Comments

Nm presets#70

Open
prodbyichigo wants to merge 10 commits intomainfrom
nm_presets
Open

Nm presets#70
prodbyichigo wants to merge 10 commits intomainfrom
nm_presets

Conversation

@prodbyichigo
Copy link
Member

nm_preset stuff

prodbyichigo and others added 6 commits November 19, 2025 21:45
only a few thingss left for me to do
- Filedrop (unless ninju wants to do that)
- Adding some more stuff to make imports easier and more diagnostic
-  GUI Finalisation
- Finding a place in misc for the gui button
- RC commands to export and load presets.
Copy link
Member

@Noobyguy775 Noobyguy775 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO:

  • adjust the config option for every setting, just using configTypes
  • change status to use UpdateInt and the corresponding ImportPreset() function as a SendMessage

mmm other things that im forgetting

@@ -1,4 +1,4 @@
/*
/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

usually not a good sign that either the encoding or eol has changed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved in my commit (vscode did it automatically, i assume it was likely eol sequence)


nm_importConfig() {
global
global config := Map()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's going to be a global might as well have it in a lib file tbh. (or with the rest of the super-globals)

}

PackAll(presetname) {
global
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you're using assume-global (which you shouldn't be in functions like this!), you need to mark the variables in these functions as locals, such as fileData, existingFiles, filepath, fs

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do this at the start of the function but it's probably easier to do it while defining the functions, e.g.

local fileData := Map()

return fileData
}

SavePreset(presetname, presetContent) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rewrote this function as we dont really need to know all of the preset files just to save one of them

}
}

SavePreset(presetname, JSON.stringify(settings))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read the comment above from my changes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Im gonna let you do the rest of the work, but it should be as easy as iterating through nm_ReadIni and doing Map.Delete() for any blacklisted names"

PresetCont := FileRead("settings\presets\" preset ".nm")
try parsed := JSON.parse(PresetCont)
catch as e {
msgbox e.Message
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isnt how we would want to handle it in the release but i think u know that

}

UnpackAll(preset) {
global
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt need to be a global function at all

@prodbyichigo
Copy link
Member Author

  • change status to use UpdateInt and the corresponding ImportPreset() function as a SendMessage

when you say use update int, do you mean to update it and check it in ImportPreset in the main file to avoid using wparam?

@Noobyguy775
Copy link
Member

  • change status to use UpdateInt and the corresponding ImportPreset() function as a SendMessage

when you say use update int, do you mean to update it and check it in ImportPreset in the main file to avoid using wparam?

Sorry, I think i overlooked the code. An UpdateInt wouldn't work here (we want it to be a sendmessage for now, since you'll need to call a function) But a more elegant way is to use Loop Files to get a list of all the presets, then to enumerate them using A_Index (since we do the same in the preset gui), then to pass that number as as param for sendMessage instead of doing the whole file age thing

changed approach to use a_index instead of file pos in dir (way fuckin smarter jesuss)

also just rewrote every command and left a todo command for later if thats wanted
@prodbyichigo prodbyichigo requested a review from a team February 7, 2026 23:13
I want to switch branches rn, but i cant overwrite my stash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants