I'm looking to implement a somewhat competent Find/Replace feature into LGM. I'd like some input on what options you think would be good, how to lay it out, etc.
Fields: * There will be a text field for Find ** There will be an option for regex (anybody think wildcard would be necessary?) * There will be a text field for Replace ** This will accept regex backreferences if the Find is a regex. * There will be separate buttons for Find, Replace Once, and Replace All. * There will be options for search scope: ** The current script ** Another open script ** 1 All scripts ** 2 Resource names ** 3 All DND Action Arguments ** Any combination of 1, 2, and 3. (gui suggestions on how to present these options appreciated)
Functionality: Upon pressing Ctrl+F anywhere in LGM, this dialog will appear. If it was pressed from within a script, it will be scoped for that script by default. Otherwise, it will be a global search (some combination of 1, 2, and 3 - suggestions for a default scope appreciated) Initially, the Search textfield will have focus, and will be populated with the contents of the [clipboard | current cursor selection]. Pressing the tab key will switch focus to the Replace textfield immediately. Pressing enter while the search textfield is in focus, and no input was given to the replace textfield, will only perform a Find. Pressing enter with the replace textfield in focus and with text will perform a Replace Once. Holding down a certain (as of yet undetermined) key will perform a Replace All.
Ideas: Some sort of tree structure for displaying results of performing search on global scope. Maybe even flatten single-child parent nodes (e.g. only one sprite was found, so display Sprites/spr_name, compared to Sprites/ \n \t spr_name. This example use branch/leaf, but the same would be applied to branch/branch as well). Although it might be difficult to implement, a way to undo a full find/replace, in case it turns out badly.
Concerns: How would focus traversal work for options? Right now it goes: Find Text > Replace Text > Find Button > Replace Once > Replace All
Global Searching should also take into account Room Creation and Instance Creation Codes.
If anybody wants to draw up the way they think it should be laid out, that'd be awesome.
|