Add skin property image.frames
and image.index
.
This commit is contained in:
@@ -60,6 +60,24 @@ namespace Cryville.Crtr {
|
||||
_cb(GetOperand(0).AsString());
|
||||
}
|
||||
}
|
||||
public class StringArray : PropOp {
|
||||
readonly Action<string[]> _cb;
|
||||
public StringArray(Action<string[]> cb) { _cb = cb; }
|
||||
protected unsafe override void Execute() {
|
||||
var op = GetOperand(0);
|
||||
int arrtype; int len;
|
||||
op.GetArraySuffix(out arrtype, out len);
|
||||
if (arrtype != PdtInternalType.String) throw new InvalidCastException("Not an array of strings");
|
||||
var result = new string[len];
|
||||
int o = 0;
|
||||
for (int i = 0; i < len; i++) {
|
||||
string v = op.AsString(o);
|
||||
o += v.Length * sizeof(char) + sizeof(int);
|
||||
result[i] = v;
|
||||
}
|
||||
_cb(result);
|
||||
}
|
||||
}
|
||||
public class TargetString : PropOp {
|
||||
readonly Func<RTargetString> _cb;
|
||||
public TargetString(Func<RTargetString> cb) { _cb = cb; }
|
||||
|
Reference in New Issue
Block a user