Forum Replies Created
- 
		AuthorPosts
 - 
		
			
				
Automatic reloading of files when saving with another external editor is now ready.
https://github.com/coconcode/ted2mod/blob/master/documentwatcher.monkey2Hi, thank for checking the project out.
I have mentioned some of information in the readme file, however my purpose is to make experimentation.
The best feature so far is the ability to configure the hotkeys with a JSON file.
https://github.com/coconcode/ted2mod/blob/master/hotkeyloader.monkey2Also I did a massive refactoring by redesigning the program (the commands of the IDE) by using a design pattern. I was very skeptic about this, although it makes the code more organized, it makes it over engineered. I am more of a Python-esque style fan, where you create lists at will and put whatever you like there, perhaps later with the reflection capabilities I will try to see this alternative.
https://github.com/coconcode/ted2mod/blob/master/idecommand.monkey2The ideal lambdas have the function purity concept (that no data modifications are allowed). I don’t know if Monkey uses that design indeed.
What I had more in mind was the C# concept of Action and Func that modify variables. Perhaps C++ as well by using the ampersand operator.
Nice idea for a logo.
“Ted” and “Monkey”: Action Team Adventure.Cool, perhaps setting the env variables should be noted on installation instructions, many users will notice this in the future.
Try to make a command line compilation and see if you can spot any errors related to the system or g++ compiler. I had tried this also myself:
http://monkey2.monkey-x.com/forums/topic/small-correction-to-the-mx2cc-documentation/P.S. The mx2cc is a user environment variable.
D:\Programs\monkey2\bin\mx2cc_windows.exeI used this version of MinGW:
123http://www.monkey-x.com/mak/devtools/i686-5.3.0-posix-dwarf-rt_v4-rev0.exe(noted here: https://github.com/blitz-research/monkey2)And extracted it here:
Monkey1234567D:\Programs\monkey2\devtools>dir /b.gitignoremingw-w64.batmingw-w64.urlmingw32uninstall.exeuninstall.iniAlso just for safety I created a user environment variable called PATH and added this line:
Monkey12D:\Programs\monkey2\devtools\mingw32\bin\g++.exeI don’t know if the PATH variable is needed for using Ted, but I remember when doing command line compilations it was needed.
I saw that TED has hardcoded keyconfigurations.
Perhaps it might be a good idea to introduce a shortcut manager so these configurations can be loaded from a JSON (or XML) file, parsed, and assigned during startup of the application.
Well, this is just a suggestion, nothing formal yet.
Monkey123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123#Import "<mojo>"Using std..Class ShortcutField Name:StringField Shortcut:StringField HotKey:String '< -- This is will be a Key not a StringField HotKeyModifier:String '<-- This is alsoMethod SetCommand(command:String)If CommandIsValid(command)Name = commandEndEndMethod SetShortcut(shortcut:String)Shortcut = shortcutFindHotKey()FindModifier()EndMethod CommandIsValid:Bool(command:String)If command = "Find" Return TrueIf command = "Debug" Return TrueIf command = "Test" Return TrueReturn FalseEndMethod FindHotKey()If Shortcut.Contains("+")Local s := Shortcut.Split("+")HotKey = s[s.Length - 1]ReturnEndHotKey = ShortcutEndMethod FindModifier()If Shortcut.Contains("Ctrl")HotKeyModifier = "Modifier.Control"EndIf Shortcut.Contains("Alt")Local hasPrev := ""If HotKeyModifier > 0 hasPrev = "|"HotKeyModifier += hasPrev + "Modifier.Alt"EndEndEndClass ShortcutManagerField ShortcutList:List<Shortcut>Method LoadFromFile()ShortcutList = New List<Shortcut>' file is opened and in each line a new shortcut is added to the listLocal s:Shortcut' e.g.s = New Shortcuts.SetCommand("Find")s.SetShortcut("Ctrl+F")ShortcutList.AddLast(s)s = New Shortcuts.SetCommand("Debug")s.SetShortcut("F5")ShortcutList.AddLast(s)s = New Shortcuts.SetCommand("Test")s.SetShortcut("Ctrl+Alt+Del")ShortcutList.AddLast(s)EndMethod GetHotKey:String(action:String)For Local s := Eachin ShortcutListIf s.Name = actionReturn s.HotKeyEndNextReturn ""EndMethod GetHotkeyModifier:String(action:String)For Local s := Eachin ShortcutListIf s.Name = actionReturn s.HotKeyModifierEndNextReturn ""EndEndFunction Main()' The shortcut manager is createdLocal shotcutManager := New ShortcutManagershotcutManager.LoadFromFile()' Testing the outputPrint("Testing Commands")Local commands := New String[] ("Find", "Debug", "Test")For Local c := Eachin commandsPrint(c)Print(shotcutManager.GetHotKey(c))Print(shotcutManager.GetHotkeyModifier(c))Print("")Next' Example of implementing this in Ted' at the moment of where the actions are declared'_editFind=New Action("Find")'_editFind.HotKey=shotcutManager.GetHotKey("Find")'_editFind.HotKeyModifiers=shotcutManager.GetHotkeyModifier("Find")'_editFind.Triggered=OnEditFindEndPerhaps it might be good to switch from “raw presentation” to “formal presentation” just as having two options. But consider this a todo task for sometime in future, no worries.
That’s good, perhaps a patch would be created to fix this if it’s considered as a bug by escaping the white spaces in Unix OSs’.
This is great news
That way it will be developed even more.
As I remember Macs have this console logger and might catch any errors.
https://support.omnigroup.com/console-osx/Also another case is that by building with terminal to see if everything goes well, because TED will not show any g++ or OS related errors.
D:\Programs\monkey2\scriptsRegarding the permissions: You will need to check the mx2cc application (My is D:\Programs\monkey2\bin\mx2cc_windows.exe), in which user group it belongs? Because this application is responsible for invoking a system process (the game you want to run), you will have to make sure that it has the appropriate permissions to so (perhaps other Mac users could validate this). Also I would be keep an eye if one folder on tree has restricted rights, thus applying restritions to the monkey2 folder as well.
Sorry for the guesswork, I hope that anything of these help.
Superb work, flawless victory!
~ One thing I haven’t seen other editors do is also highlight where about you are in the code (in the code description) as you move around.
I thought of this feature a few times, it would be nice to see it once in an IDE, thankfully now in TED it will be awesome.
Yes, I vote for that. A forum with snippets might be nice.
Hi thanks for the feedback. I did the changes and now it works.
Monkey123456789101112131415161718192021222324Function Main()Theme.Load()New AppInstanceNew MainWindowInstance()App.Run()End'...Method CreateGUI()_inputTextView = New TextView_outputTextView = New TextView_docker = New DockingView' I set the initial _docker view to _inputTextView (should fill the all of the screen)_docker.ContentView = _inputTextView' I create a new bottom split, by default is resizable_docker.AddView(_outputTextView, "bottom", 400)' The GUI element must be added to the WindowSelf.AddChild(_docker)End - 
		AuthorPosts