void C4ObjectInfoCore::CompileFunc(StdCompiler *pComp) { C4ValueNumbers numbers; pComp->Value(mkNamingAdapt(id, "id", C4ID::None)); pComp->Value(mkNamingAdapt(toC4CStr(Name), "Name", "Clonk")); pComp->Value(mkNamingAdapt(toC4CStr(DeathMessage), "DeathMessage", "")); pComp->Value(mkNamingAdapt(Rank, "Rank", 0)); pComp->Value(mkNamingAdapt(sRankName, "RankName", "Clonk")); pComp->Value(mkNamingAdapt(sNextRankName, "NextRankName", "")); pComp->Value(mkNamingAdapt(toC4CStr(TypeName), "TypeName", "Clonk")); pComp->Value(mkNamingAdapt(Participation, "Participation", 1)); pComp->Value(mkNamingAdapt(Experience, "Experience", 0)); pComp->Value(mkNamingAdapt(NextRankExp, "NextRankExp", 0)); pComp->Value(mkNamingAdapt(Rounds, "Rounds", 0)); pComp->Value(mkNamingAdapt(DeathCount, "DeathCount", 0)); pComp->Value(mkNamingAdapt(Birthday, "Birthday", 0)); pComp->Value(mkNamingAdapt(TotalPlayingTime, "TotalPlayingTime", 0)); pComp->Value(mkNamingAdapt(Age, "Age", 0)); pComp->Value(mkNamingAdapt(mkParAdapt(ExtraData, &numbers), "ExtraData", C4ValueMapData())); pComp->Value(mkNamingAdapt(numbers, "ExtraDataValues")); if (pComp->isCompiler()) { numbers.Denumerate(); ExtraData.Denumerate(&numbers); } }
void C4PlayerInfoCore::CompileFunc(StdCompiler *pComp) { pComp->Name("Player"); pComp->Value(mkNamingAdapt(toC4CStr(PrefName),"Name", "Neuling")); pComp->Value(mkNamingAdapt(toC4CStr(Comment), "Comment", "")); pComp->Value(mkNamingAdapt(Rank, "Rank", 0)); pComp->Value(mkNamingAdapt(toC4CStr(RankName),"RankName", /*pRanks ? pRanks->Name(Rank,false) :*/ LoadResStr("IDS_MSG_RANK"))); // TODO: check if this would be desirable pComp->Value(mkNamingAdapt(Score, "Score", 0)); pComp->Value(mkNamingAdapt(Rounds, "Rounds", 0)); pComp->Value(mkNamingAdapt(RoundsWon, "RoundsWon", 0)); pComp->Value(mkNamingAdapt(RoundsLost, "RoundsLost", 0)); pComp->Value(mkNamingAdapt(TotalPlayingTime, "TotalPlayingTime", 0)); pComp->Value(mkNamingAdapt(ExtraData, "ExtraData", C4ValueMapData())); pComp->Value(mkNamingAdapt(toC4CStr(LeagueName),"LeagueName", "")); pComp->NameEnd(); pComp->Name("Preferences"); pComp->Value(mkNamingAdapt(PrefColor, "Color", 0)); pComp->Value(mkNamingAdapt(PrefColorDw, "ColorDw", 0xffu)); pComp->Value(mkNamingAdapt(PrefColor2Dw, "AlternateColorDw", 0u)); pComp->Value(mkNamingAdapt(PrefControl, "Control", C4P_Control_Keyboard2)); pComp->Value(mkNamingAdapt(PrefControlStyle, "AutoStopControl", 0)); pComp->Value(mkNamingAdapt(PrefAutoContextMenu, "AutoContextMenu", -1)); // compiling default is -1 (if this is detected, AutoContextMenus will be defaulted by control style) pComp->Value(mkNamingAdapt(PrefPosition, "Position", 0)); pComp->Value(mkNamingAdapt(PrefMouse, "Mouse", 1)); pComp->NameEnd(); pComp->Value(mkNamingAdapt(LastRound, "LastRound" )); }
void C4UpdatePackageCore::CompileFunc(StdCompiler *pComp) { pComp->Value(mkNamingAdapt(toC4CArr(RequireVersion), "RequireVersion")); pComp->Value(mkNamingAdapt(toC4CStr(Name), "Name", "")); pComp->Value(mkNamingAdapt(toC4CStr(DestPath), "DestPath", "")); pComp->Value(mkNamingAdapt(GrpUpdate, "GrpUpdate", 0)); pComp->Value(mkNamingAdapt(UpGrpCnt, "TargetCount", 0)); pComp->Value(mkNamingAdapt(toC4CArrU(GrpChks1), "GrpChks1")); pComp->Value(mkNamingAdapt(GrpChks2, "GrpChks2", 0u)); }
void C4PlayerInfoCore::CompileFunc(StdCompiler *pComp) { C4ValueNumbers numbers; pComp->Name("Player"); pComp->Value(mkNamingAdapt(toC4CStr(PrefName),"Name", "Neuling")); pComp->Value(mkNamingAdapt(toC4CStr(Comment), "Comment", "")); pComp->Value(mkNamingAdapt(Rank, "Rank", 0)); pComp->Value(mkNamingAdapt(toC4CStr(RankName),"RankName", LoadResStr("IDS_MSG_RANK"))); // TODO: check if this would be desirable pComp->Value(mkNamingAdapt(TotalScore, "Score", 0)); pComp->Value(mkNamingAdapt(Rounds, "Rounds", 0)); pComp->Value(mkNamingAdapt(RoundsWon, "RoundsWon", 0)); pComp->Value(mkNamingAdapt(RoundsLost, "RoundsLost", 0)); pComp->Value(mkNamingAdapt(TotalPlayingTime, "TotalPlayingTime", 0)); pComp->Value(mkNamingAdapt(mkParAdapt(ExtraData, &numbers), "ExtraData", C4ValueMapData())); pComp->Value(mkNamingAdapt(numbers, "ExtraDataValues")); if (pComp->isCompiler()) { numbers.Denumerate(); ExtraData.Denumerate(&numbers); } pComp->Value(mkNamingAdapt(toC4CStr(LeagueName),"LeagueName", "")); pComp->NameEnd(); pComp->Name("Preferences"); pComp->Value(mkNamingAdapt(PrefColor, "Color", 0)); pComp->Value(mkNamingAdapt(PrefColorDw, "ColorDw", 0xffu)); pComp->Value(mkNamingAdapt(PrefColor2Dw, "AlternateColorDw", 0u)); pComp->Value(mkNamingAdapt(PrefPosition, "Position", 0)); pComp->Value(mkNamingAdapt(PrefMouse, "Mouse", 1)); pComp->Value(mkNamingAdapt(OldPrefControl, "Control", 1)); pComp->Value(mkNamingAdapt(OldPrefControlStyle, "AutoStopControl", 0)); pComp->Value(mkNamingAdapt(OldPrefAutoContextMenu, "AutoContextMenu", -1)); // compiling default is -1 (if this is detected, AutoContextMenus will be defaulted by control style) pComp->Value(mkNamingAdapt(PrefControl, "ControlSet", StdStrBuf())); pComp->Value(mkNamingAdapt(PrefClonkSkin, "ClonkSkin", 0)); pComp->NameEnd(); pComp->Value(mkNamingAdapt(LastRound, "LastRound")); pComp->Value(mkNamingAdapt(Achievements, "Achievements")); }
void C4ObjectInfoCore::CompileFunc(StdCompiler *pComp) { pComp->Value(mkNamingAdapt(mkC4IDAdapt(id), "id", C4ID_None)); pComp->Value(mkNamingAdapt(toC4CStr(Name), "Name", "Clonk")); pComp->Value(mkNamingAdapt(toC4CStr(DeathMessage), "DeathMessage", "")); pComp->Value(mkNamingAdapt(toC4CStr(PortraitFile), "PortraitFile", "")); pComp->Value(mkNamingAdapt(Rank, "Rank", 0)); pComp->Value(mkNamingAdapt(sRankName, "RankName", "Clonk")); pComp->Value(mkNamingAdapt(sNextRankName, "NextRankName", "")); pComp->Value(mkNamingAdapt(toC4CStr(TypeName), "TypeName", "Clonk")); pComp->Value(mkNamingAdapt(Participation, "Participation", 1)); pComp->Value(mkNamingAdapt(Experience, "Experience", 0)); pComp->Value(mkNamingAdapt(NextRankExp, "NextRankExp", 0)); pComp->Value(mkNamingAdapt(Rounds, "Rounds", 0)); pComp->Value(mkNamingAdapt(DeathCount, "DeathCount", 0)); pComp->Value(mkNamingAdapt(Birthday, "Birthday", 0)); pComp->Value(mkNamingAdapt(TotalPlayingTime, "TotalPlayingTime", 0)); pComp->Value(mkNamingAdapt(Age, "Age", 0)); pComp->Value(mkNamingAdapt(ExtraData, "ExtraData", C4ValueMapData())); pComp->FollowName("Physical"); pComp->Value(Physical); }
void C4MaterialCore::CompileFunc(StdCompiler *pComp) { assert(pComp->hasNaming()); if (pComp->isCompiler()) Clear(); pComp->Name("Material"); pComp->Value(mkNamingAdapt(toC4CStr(Name), "Name", "")); const StdEnumEntry<C4MaterialCoreShape> Shapes[] = { { "Flat", C4M_Flat }, { "TopFlat", C4M_TopFlat }, { "Smooth", C4M_Smooth }, { "Rough", C4M_Rough }, { "Octagon", C4M_Octagon }, { "Smoother", C4M_Smoother }, { NULL, C4M_Flat } }; pComp->Value(mkNamingAdapt(mkEnumAdaptT<uint8_t>(MapChunkType, Shapes), "Shape", C4M_Flat)); pComp->Value(mkNamingAdapt(Density, "Density", 0)); pComp->Value(mkNamingAdapt(Friction, "Friction", 0)); pComp->Value(mkNamingAdapt(DigFree, "DigFree", 0)); pComp->Value(mkNamingAdapt(BlastFree, "BlastFree", 0)); pComp->Value(mkNamingAdapt(Blast2Object, "Blast2Object", C4ID::None)); pComp->Value(mkNamingAdapt(Dig2Object, "Dig2Object", C4ID::None)); pComp->Value(mkNamingAdapt(Dig2ObjectRatio, "Dig2ObjectRatio", 0)); pComp->Value(mkNamingAdapt(Dig2ObjectCollect, "Dig2ObjectCollect", 0)); pComp->Value(mkNamingAdapt(Blast2ObjectRatio, "Blast2ObjectRatio", 0)); pComp->Value(mkNamingAdapt(Blast2PXSRatio, "Blast2PXSRatio", 0)); pComp->Value(mkNamingAdapt(Instable, "Instable", 0)); pComp->Value(mkNamingAdapt(MaxAirSpeed, "MaxAirSpeed", 0)); pComp->Value(mkNamingAdapt(MaxSlide, "MaxSlide", 0)); pComp->Value(mkNamingAdapt(WindDrift, "WindDrift", 0)); pComp->Value(mkNamingAdapt(Inflammable, "Inflammable", 0)); if (pComp->isCompiler()) { // The value used to have a wrong spelling ("Incindiary"). If there's // no "Incendiary" value, use the wrong spelling instead try { pComp->Value(mkNamingAdapt(Incendiary, "Incendiary")); } catch (StdCompiler::NotFoundException *ex) { delete ex; pComp->Value(mkNamingAdapt(Incendiary, "Incindiary", 0)); } } else { // When serializing, write both spellings because some script might be // calling GetMaterialVal with the wrong one pComp->Value(mkNamingAdapt(Incendiary, "Incendiary")); pComp->Value(mkNamingAdapt(Incendiary, "Incindiary")); } pComp->Value(mkNamingAdapt(Corrode, "Corrode", 0)); pComp->Value(mkNamingAdapt(Corrosive, "Corrosive", 0)); pComp->Value(mkNamingAdapt(Extinguisher, "Extinguisher", 0)); pComp->Value(mkNamingAdapt(Soil, "Soil", 0)); pComp->Value(mkNamingAdapt(Placement, "Placement", 0)); pComp->Value(mkNamingAdapt(Light, "Light", 0)); pComp->Value(mkNamingAdapt(mkParAdapt(sTextureOverlay, StdCompiler::RCT_IdtfAllowEmpty), "TextureOverlay", "")); pComp->Value(mkNamingAdapt(OverlayType, "OverlayType", 0)); pComp->Value(mkNamingAdapt(mkParAdapt(sPXSGfx, StdCompiler::RCT_IdtfAllowEmpty), "PXSGfx", "")); pComp->Value(mkNamingAdapt(PXSGfxRt, "PXSGfxRt", TargetRect0)); pComp->Value(mkNamingAdapt(PXSGfxSize, "PXSGfxSize", PXSGfxRt.Wdt)); pComp->Value(mkNamingAdapt(TempConvStrength, "TempConvStrength", 0)); pComp->Value(mkNamingAdapt(mkParAdapt(sBlastShiftTo, StdCompiler::RCT_IdtfAllowEmpty), "BlastShiftTo", "")); pComp->Value(mkNamingAdapt(mkParAdapt(sInMatConvert, StdCompiler::RCT_IdtfAllowEmpty), "InMatConvert", "")); pComp->Value(mkNamingAdapt(mkParAdapt(sInMatConvertTo, StdCompiler::RCT_IdtfAllowEmpty), "InMatConvertTo", "")); pComp->Value(mkNamingAdapt(InMatConvertDepth, "InMatConvertDepth", 0)); pComp->Value(mkNamingAdapt(AboveTempConvert, "AboveTempConvert", 0)); pComp->Value(mkNamingAdapt(AboveTempConvertDir, "AboveTempConvertDir", 0)); pComp->Value(mkNamingAdapt(mkParAdapt(sAboveTempConvertTo, StdCompiler::RCT_IdtfAllowEmpty), "AboveTempConvertTo", "")); pComp->Value(mkNamingAdapt(BelowTempConvert, "BelowTempConvert", 0)); pComp->Value(mkNamingAdapt(BelowTempConvertDir, "BelowTempConvertDir", 0)); pComp->Value(mkNamingAdapt(mkParAdapt(sBelowTempConvertTo, StdCompiler::RCT_IdtfAllowEmpty), "BelowTempConvertTo", "")); pComp->Value(mkNamingAdapt(MinHeightCount, "MinHeightCount", 0)); pComp->Value(mkNamingAdapt(SplashRate, "SplashRate", 10)); pComp->Value(mkNamingAdapt(KeepSinglePixels, "KeepSinglePixels", false)); pComp->Value(mkNamingAdapt(AnimationSpeed, "AnimationSpeed", 100)); pComp->Value(mkNamingAdapt(LightAngle, "LightAngle", 255)); pComp->Value(mkNamingAdapt(mkArrayAdaptDM(LightEmit, 0), "LightEmit")); pComp->Value(mkNamingAdapt(mkArrayAdaptDM(LightSpot, 16),"LightSpot")); pComp->Value(mkNamingAdapt(MinShapeOverlap, "MinShapeOverlap", 25)); pComp->NameEnd(); // material reactions pComp->Value(mkNamingAdapt(mkSTLContainerAdapt(CustomReactionList), "Reaction", std::vector<C4MaterialReaction>())); }