turnstates

This commit is contained in:
the me 2022-08-19 10:19:08 -07:00
parent 1a13781220
commit cd85677efd
57 changed files with 1813 additions and 104 deletions

View file

@ -0,0 +1,27 @@
function lb_auto(str, maxlength) {
var possible = true;
var j;
var lbcount = 0;
var specialchars = 0;
for (i=0; i<string_length(str); i++) {
while string_char_at(str, i) = "|" {
c_badpractice(str);
}
if string_char_at(str, i) == "#" lbcount = 0;
//if string_char_at(str, i) == "|" lbcount -= 2;
if lbcount >= maxlength {
for (j=0; j<lbcount; j++) {
if string_char_at(str, i-j) == " " && lbcount-j < maxlength {
str = string_insert("#", str, i-j);
str = string_delete(str, i-j+1, 1);
possible = true;
break;
}
possible = false;
}
lbcount = j;
}
lbcount++;
}
return str;
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "Scripts",
"path": "folders/Scripts.yy",
},
"resourceVersion": "1.0",
"name": "lb_auto",
"tags": [],
"resourceType": "GMScript",
}