guiProfile.border has specific usage cases for -2, so use the full negative range

clarify a bit what fieldindex is being asigned
This commit is contained in:
AzaezelX 2025-03-18 01:23:33 -05:00
parent ffe83b1d2d
commit 55ac453ab9
3 changed files with 4 additions and 5 deletions

View file

@ -646,14 +646,13 @@ void ConsoleObject::addProtectedFieldV(const char* in_pFieldname,
f.offset = in_fieldOffset;
f.elementCount = in_elementCount;
f.validator = v;
f.validator->fieldIndex = sg_tempFieldList.size();
f.flag = flags;
f.setDataFn = in_setDataFn;
f.getDataFn = in_getDataFn;
f.writeDataFn = in_writeDataFn;
f.networkMask = 0;
v->fieldIndex = sg_tempFieldList.size();
sg_tempFieldList.push_back(f);
}
@ -723,8 +722,8 @@ void ConsoleObject::addFieldV(const char* in_pFieldname,
f.writeDataFn = &defaultProtectedWriteFn;
f.elementCount = in_elementCount;
f.validator = v;
f.validator->fieldIndex = sg_tempFieldList.size();
f.networkMask = 0;
v->fieldIndex = sg_tempFieldList.size();
sg_tempFieldList.push_back(f);
}

View file

@ -66,7 +66,7 @@ DefineConsoleType( TypeBoolVector, Vector<bool>)
DefineConsoleType( TypeS8, S8 )
DefineConsoleType( TypeS16, S16)
DefineConsoleType( TypeS32, S32 )
DefineConsoleType(TypeRangedS32, S32)
DefineConsoleType( TypeRangedS32, S32)
DefineConsoleType( TypeS32Vector, Vector<S32> )
DefineConsoleType( TypeF64, F64 )
DefineConsoleType( TypeF32, F32 )

View file

@ -371,7 +371,7 @@ void GuiControlProfile::initPersistFields()
addField("fillColorNA", TypeColorI, Offset(mFillColorNA, GuiControlProfile));
addField("fillColorERR", TypeColorI, Offset(mFillColorERR, GuiControlProfile));
addField("fillColorSEL", TypeColorI, Offset(mFillColorSEL, GuiControlProfile));
addFieldV("border", TypeRangedS32, Offset(mBorder, GuiControlProfile), &CommonValidators::PositiveInt,
addFieldV("border", TypeRangedS32, Offset(mBorder, GuiControlProfile), &CommonValidators::S32Range,
"Border type (0=no border)." );
addFieldV("borderThickness", TypeRangedS32, Offset(mBorderThickness, GuiControlProfile), &CommonValidators::PositiveInt,
"Thickness of border in pixels." );