Jun 13 2015, 10:39 am
|
|
Alright, I'll throw that on the list as a #define toggle. I've done that before, so it'd just be digging out the code from my experiments folder and cleaning it up.
|
Hmm. What about on-screen input/output? I think it might fit well with the keyboard stuff, and the new mouse and maptext features are probably going to cause interface outputs to become a bit obsolete due to scroll bars and such.
|
The more features you add to this, the more you should just be making separate hubs for each kind of thing.
|
Hmm. What about on-screen input/output? Yeah, not going to happen in a stdlib. I've got a mostly-working onscreen chatbox solution in my private experiments folder, but it requires hacks to function at the moment. I really don't think it's something that fits with stdlib. |
Quick update: I've got most everything done. I'm doing some research on code insertion in javascript, as I'd like the JS2DM/DM2JS bridge to be inserted into the browser at runtime.
EDIT: added missing trig functions as defines where speed was not a factor, and procs where speed could be a factor. #ifndef TILE_WIDTH |
Perhaps it would be prudent to get this into github, then we can code review future additions via pull requests? Can plonk it in the 'BYOND' github organisation, if you want.
|
Code has been updated. Special thanks go out to Kats and FKI for finding small bugs in several string searching functions.
|
findtext_all(str,search) When you mentioned a findtext_all() function over in my thread, this is what I wrote. After seeing yours, the only differences between our code is that mine just gets rid of a lot of unnecessary variables. :) Hope this helps. Also, now I'm in the habit of setting the . variable, like I probably should have been. So thanks for that, at least. |
Thanks! You actually helped clear up a misconception that I had about invalid index errors when supplying positions beyond the end of a string to findtext(). I'm sure I can apply that to a few of the other functions as well.
|
Uh, Ter, sweetie... You should probably change the search variable in my example to findstr to be congruent. You copied my variable over to it. Lol.
|
str_replace/str_replaceEx will double any replace string found in the original string. If you're looking for "no" and want to replace it with "lol", it will work. However any "lol" string found will be turned into "lollol"
|
str_replace/str_replaceEx will double any replace string found in the original string. If you're looking for "no" and want to replace it with "lol", it will work. However any "lol" string found will be turned into "lollol" This is a good report. I'm on it. |
And fixed. It was actually an issue with the logic control on the final search.
|
does anyone feel like fixing those copytexts in the boolean string functions to be findtexts
|
Should be fixed. Didn't have time to test. Also reduced some redundant instructions.
|
Pulling from a previous thread, a function for linear interpolation turns out to be a very useful function for many matrices.
proc/linearInterpolate(matrix/start, matrix/end, scale) |
In response to Kats
|
|
Fun fact: it's the same linear interpolation you'd use for numbers:
proc/lerp(a, b, c) . = a*(1-c) + b*c |