icewolfz / jiMUD

MUD client for ShadowMUD.com using electron
http://www.shadowmud.com
7 stars 0 forks source link

Code editor: Add code blocks to area designer #295

Open icewolfz opened 1 month ago

icewolfz commented 1 month ago

Allow adding custom code blocks to rooms,monsters, and objects

a simple name:code and you use (:NAME:) in places this would allow adding search/long/sort code before generating code and in theory can make going from code to gui easier in future

would need to create a code editor dialog not just a basic text editor make it use monaco editor in a dialog

icewolfz commented 1 month ago

a1115b2ecb192ac064514c6962f210dceeb732fa adds backend support for function and code generation, only lacks editor and gui sysems

icewolfz commented 1 month ago

The gui for this system would be nice to offer a half editor, basicly a code editor tab with out all the toolbar/menu bar but with a full context menu that uses the monaco editor to offer spellchecking, higlight, etc... thinking of a code editor dialog that has a place to select function type, function name, a vararg flag, and an argument list, maybe make argument list readonly with a button to open an editor to handle arguments as they require type/name/is array

icewolfz commented 1 month ago

Maybe use window.open and create a full window modal dialog to allow resizing and max/unmax but no min this would allow easier resize systems and maybe easier to create editor as will not be mixed up with the other editors, down size is dialog could load slower as it has to recreate the editor systems on load every time while using embedded dialog could use the already inited monaco systems

icewolfz commented 1 month ago

Add a way to generate functions from properties either by parsing (::) and it will auto create a function with correct return types and arguments, maybe update datagrid/property editor to have a button to do it but due to space and complexity may not be the best way, another option is a button in function/block editor that can "fill" in functions from a list and auto set the room/monster force with (::), another option is make a hybrid value editor that is between the textvalue editor/dropdown/codevalue editor and change the dropdown button to switch based on parsed value eg if (: :) create/edit function value but this is complex as functions are stored separate from the properties so may be hard to do as you do not know the parent object function only have access to the current info in many places overall i am leaning to a generate button in the function edit dialog to create functions but i may try and add an advanced/export button that replaces the drop down for all editors that send to codevalueeditor if (::) format, granted the (::) does not mean it is a function either it could be pure code as well and not always easy to translate closure code to fully editable code as closures are not multi line, will have to play and see what is possible based on the data