I got it to work. Needed two solutions.
- Downloading the correct file. I thought Git would treat .toc as binary file, so I attempted to download it via Rightclick -> Save to disk from the Github page. That seemed to work, but the file contained the site's html code despite being still named .toc. That's why it shows gigantous 142KB on my screenshot above
- Replacing LF with CRLF was also necessary, as you suggested.
I think GitHub converts to Unix line endings instead of Windows.
The conversion is being done upon committing a change, but you can change that behaviour in the Github settings (Commit Unix-style Linebreaks vs Commit As-Is).
Also, I just noticed that I think the WC3 World Editor is corrupting a small part of my code when saving. I didn't noticed before because I was using an MPQ editor during development instead of the World Editor.
These 2 lines with a % are getting modified after saving in the World Editor. Maybe I need to escape the % character or something?
Yeah, Wc3 needs
%%
instead of
%
. Forgetting the second percent-char can even crash your World Editor upon saving your map. Also, it makes your code uninterpretable in other Lua-interpreters.
Better use
"\x25"
instead of
"%"
at all times.
Lua:
--This is the right way:
result = result .. string.format('<0x\x2502X>', self.Key)
shiftedKeys["5"] = "\x25"
Regarding your TextEditor, I really like it, good job with it!
I like the most that you cared so much for implementing all of those useful keyboard shortcuts. That goes a long way towards usability.
I also like that you made an explanatory video about it.
Not sure though if you had already seen my existing
Ingame Console after you were mentioning in your video that you use your application to execute code with it.
Combining this with @Eikonium's Debug Console would be the precursor to the ultimate testbed.
I looked into it, but I think this is not the right application for Debug Utils, because:
- can't paste text from outside the map (deal-breaker)
- no string processing (like
"\x30"
doesn't convert to "0"
and it doesn't process Wc3 color codes). This is not an issue in general, but a direct consequence of the whole frame being an edit box without a submitted part.
- at least for Debug Utils' console, I want the main window to not be editable, only the bottom line should be
That said, replacing the Wc3 chat input by a native Wc3 edit box might be an enhancement for the Debug Utils console. Might be worth a try to teach it arrow key behaviour (like using up-arrow to access the previous inputs).
Anyway, that's not OP's application's fault. It has its own use cases, some of which
@speige already mentioned in the video.
A few other random remarks:
- Wc3 chat doesn't support arrow keys, but it does support Home/End keys, so you can mark all text while holding the Shift-Key. It also supports copying the marked text and you can paste stuff from outside Wc3 (as long as is contains less than 128 chars).
- You can use a frame that keeps keyboard focus instead of locking the camera to prevent arrow key / Del / Insert input. This might also fix the unit control group issue, but I'm not sure. Which would actually be important to allow for special char input (anything that requires Shift+Number).
- Bug Report: Pressing ESC to close the text window down doesn't seem to work on my machine