- fixed issues with option menu items.
- fixed the octal parser in strbin. - remove 'new' token because it gets in the way.
This commit is contained in:
parent
4562695854
commit
03283de4e8
10 changed files with 26 additions and 22 deletions
|
|
@ -1332,6 +1332,14 @@ DEFINE_ACTION_FUNCTION(_Console, HideConsole)
|
|||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_Console, Printf)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
FString s = FStringFormat(param, defaultparam, numparam, ret, numret);
|
||||
Printf("%s\n", s.GetChars());
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool C_HandleKey (event_t *ev, FCommandBuffer &buffer)
|
||||
{
|
||||
int data1 = ev->data1;
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ DEFINE_ACTION_FUNCTION(_CVar, GetFloat)
|
|||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FBaseCVar);
|
||||
auto v = self->GetGenericRep(CVAR_Float);
|
||||
ACTION_RETURN_FLOAT(v.Int);
|
||||
ACTION_RETURN_FLOAT(v.Float);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_CVar, GetString)
|
||||
|
|
|
|||
|
|
@ -614,16 +614,16 @@ int strbin (char *str)
|
|||
case '6':
|
||||
case '7':
|
||||
c = 0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
c <<= 3;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
p++;
|
||||
if (*p >= '0' && *p <= '7')
|
||||
c += *p-'0';
|
||||
c = (c << 3) + *p - '0';
|
||||
else
|
||||
{
|
||||
p--;
|
||||
break;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
*str++ = c;
|
||||
break;
|
||||
|
|
@ -717,16 +717,16 @@ FString strbin1 (const char *start)
|
|||
case '6':
|
||||
case '7':
|
||||
c = 0;
|
||||
for (i = 0; i < 3; i++) {
|
||||
c <<= 3;
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
p++;
|
||||
if (*p >= '0' && *p <= '7')
|
||||
c += *p-'0';
|
||||
c = (c << 3) + *p - '0';
|
||||
else
|
||||
{
|
||||
p--;
|
||||
break;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
result << c;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1402,7 +1402,7 @@ bool DMenuItemBase::GetValue(int i, int *pvalue)
|
|||
{
|
||||
IFVIRTUAL(DMenuItemBase, GetValue)
|
||||
{
|
||||
VMValue params[] = { (DObject*)this };
|
||||
VMValue params[] = { (DObject*)this, i };
|
||||
int retval[2];
|
||||
VMReturn ret[2]; ret[0].IntAt(&retval[0]); ret[1].IntAt(&retval[1]);
|
||||
GlobalVMStack.Call(func, params, countof(params), ret, 2, nullptr);
|
||||
|
|
|
|||
|
|
@ -142,8 +142,6 @@ std2:
|
|||
'true' { RET(TK_True); }
|
||||
'false' { RET(TK_False); }
|
||||
'none' { RET(TK_None); }
|
||||
'new' { RET(TK_New); }
|
||||
'instanceof' { RET(TK_InstanceOf); }
|
||||
'auto' { RET(TK_Auto); }
|
||||
'exec' { RET(TK_Exec); }
|
||||
'property' { RET(TK_Property); }
|
||||
|
|
|
|||
|
|
@ -81,7 +81,6 @@ xx(TK_ForEach, "'foreach'")
|
|||
xx(TK_True, "'true'")
|
||||
xx(TK_False, "'false'")
|
||||
xx(TK_None, "'none'")
|
||||
xx(TK_New, "'new'")
|
||||
xx(TK_InstanceOf, "'instanceof'")
|
||||
xx(TK_Auto, "'auto'")
|
||||
xx(TK_Exec, "'exec'")
|
||||
|
|
|
|||
|
|
@ -1009,7 +1009,7 @@ DEFINE_ACTION_FUNCTION(FStringStruct, Replace)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static FString FStringFormat(VM_ARGS)
|
||||
FString FStringFormat(VM_ARGS)
|
||||
{
|
||||
assert(param[0].Type == REGT_STRING);
|
||||
FString fmtstring = param[0].s().GetChars();
|
||||
|
|
|
|||
|
|
@ -1213,6 +1213,6 @@ class PFunction;
|
|||
VMFunction *FindVMFunction(PClass *cls, const char *name);
|
||||
#define DECLARE_VMFUNC(cls, name) static VMFunction *name; if (name == nullptr) name = FindVMFunction(RUNTIME_CLASS(cls), #name);
|
||||
|
||||
|
||||
FString FStringFormat(VM_ARGS);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue