My Setting class extended correctly as wiki direction but setting not save/load in next open game.
namespace FactionAndBlade.Settings
{
internal sealed partial class Setting
{
private const string Strings = "strings";
private const string Text_ModName = "{=FactionAndBlade_TextModName}Faction And Blade",
Text_General_Setting = "General Settings",
Text_General_EnableDebugMode_Name = "{=FactionAndBlade_General_EnableDebugModeName}Enable debug output",
Text_General_EnableDebugMode_Hint = "{=FactionAndBlade_General_EnableDebugModeHint}Enable SubModule debug output",
Text_Faction_Setting = "Faction Settings",
Text_Faction_Characterstic_EnableCharacterstic_Name = "{=FactionAndBlade_Faction_EnableCharactersticName}Enable faction characteristic",
Text_Faction_Characterstic_EnableCharacterstic_Hint = "{=FactionAndBlade_Faction_EnableCharactersticHint}Enable faction members can appply faction specialities",
Text_Faction_Relationship_Setting = "Faction Settings/Relationship Settings",
Text_Faction_Relationship_EnableRelationship_Name = "{=FactionAndBlade_Faction_Relationship_EnableRelationshipName}Enable faction relationship",
Text_Faction_Relationship_EnableRelationship_Hint = "{=FactionAndBlade_Faction_Relationship_EnableRelationshipHint}Enable fation members can apply relationship",
Text_Faction_Relationship_ValueQuitFaction_Name = "{=FactionAndBlade_Faction_Relationship_ValueQuitFactionName}Value quit faction",
Text_Faction_Relationship_ValueQuitFaction_Hint = "{=FactionAndBlade_Faction_Relationship_ValueQuitFactionHint}Set the value for relation change between leaving member and faction members",
Text_Faction_Relationship_ValueJoinFaction_Name = "{=FactionAndBlade_Faction_Relationship_ValueJoinFactionName}Value join faction",
Text_Faction_Relationship_ValueJoinFaction_Hint = "{=FactionAndBlade_Faction_Relationship_ValueJoinFactionHint}Set the value for relation change between new join member and faction members",
Text_Faction_Characterstic_Setting = "Faction Settings/Characteristic Settings",
Text_Faction_Characterstic_DemagogueTroop_Setting = "Faction Settings/Characteristic Settings/DemagogueTroops",
Text_Faction_Characterstic_DemagogueTroop_EnableDemagogueTroop_Name = "{=FactionAndBlade_Faction_Characteristic_DemagogueTroop_EnableDemagogueTroopName}Enable DemagogueTroop",
Text_Faction_Characterstic_DemagogueTroop_EnableDemagogueTroop_Hint = "{=FactionAndBlade_Faction_Characteristic_DemagogueTroop_EnableDemagogueTroopHint}Enable faction characteristic of DemagogueTroop",
CharacDemagogueTroopDescr = "={FactionAndBlade_DamagogueTroopDescr}The troops of the faction are under the banner of saving the lives;" +
"The troops of faction can accept all the refugeee troops;Increase troop maximum size (TroopLeaderFatorCharmLevel * CharmFactor)",
Text_Faction_Characterstic_CharacDamagogueTroop_FactorCharmName_Name = "{=FactionAndBlade_Faction_Characteristic_DemagogueTroop_FactorCharmName}Factor charm skill",
Text_Faction_Characterstic_CharacDamagogueTroop_FactorCharmName_Hint = "{=FactionAndBlade_Faction_Characteristic_DemagogueTroop_FactorCharmHint}Set the value of troop leader's skill 'Charm', (Value * SkillLevel) effects the maxiumum troop number",
Text_RevoltModel_Setting = "RevoltModel Settings",
Text_RevoltModel_EnableRevoltModel_Name = "{=FactionAndBlade_General_EnableRevolModelName}Enable revolt model",
Text_RevoltModel_EnableRevoltModel_Hint = "{=FactionAndBlade_General_EnableRevolModelHint}Enable model NPCs will revol governor",
Text_RevoltModel_FactorRevolChance_Name = "{=FactionAndBlade_RevolModel_FactorChanceName}Factor basic revolt chance",
Text_RevoltModel_FactorRevolChance_Hint = "{=FactionAndBlade_RevolModel_FactorChanceHint}Set the value for basic chance for hero revol",
Text_RevoltModel_Spouse_Setting = "RevoltModel Settings/Spouses",
Text_RevoltModel_SpouseAgeSetting_ValueSpouseAge_Name = "{=FactionAndBlade_RevoltModel_Spouses_ValueUnmarriedAgeName}Value unmarried age",
Text_RevoltModel_SpouseAgeSetting_ValueSpouseAge_Hint = "{=FactionAndBlade_RevoltModel_Spouses_ValueUnmarriedAgeHint}Set the value of hero spouse age line",
Text_RevoltModel_Factor_Setting = "RevoltModel Settings/Factor Settings",
Text_RevoltModel_Factor_EnableFactorSetting_Name = "{=FactionAndBlade_RevoltModel_Factor_EnableFactorSettingName}Enable factor setting",
Text_RevoltModel_Factor_EnableFactorSetting_Hint = "{=FactionAndBlade_RevoltModel_Factor_EnableFactorSettingHint}Enable factor setting effects the chance of hero revolt",
Text_RevoltModel_Factor_FactorPositiveChance_Name = "{=FactionAndBlade_RevoltModel_Factor_FactorPositiveChanceName}Factor positive chance",
Text_RevoltModel_Factor_FactorPositiveChance_Hint = "{=FactionAndBlade_RevoltModel_Factor_FactorPositiveChanceHint}Factor Positive chance",
Text_RevoltModel_Factor_FactorNegativeChance_Name = "{=FactionAndBlade_RevoltModel_Factor_FactorNegativeChanceName}Factor negative chance",
Text_RevoltModel_Factor_FactorNegativeChance_Hint = "{=FactionAndBlade_RevoltModel_Factor_FactorNegativeChanceHint}Positive chance",
Text_RevoltModel_Factor_TraitsSetting = "RevoltModel Settings/Factor Settings/Traits",
Text_RevoltModel_Factor_Traits_FactorMercy_Name = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorMercyName}Factor mercy",
Text_RevoltModel_Factor_Traits_FactorMercy_Hint = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorMercyHint}Set the value of factor for Mercy",
Text_RevoltModel_Factor_Traits_FactorValor_Name = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorValorName}Factor valor",
Text_RevoltModel_Factor_Traits_FactorValor_Hint = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorValorHint}Set the value of factor for Valor",
Text_RevoltModel_Factor_Traits_FactorHonor_Name = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorHonorName}Factor honor",
Text_RevoltModel_Factor_Traits_FactorHonor_Hint = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorHonorHint}Set the value of factor for Honor",
Text_RevoltModel_Factor_Traits_FactorGenerosity_Name = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorGenerosityName}Factor generosity",
Text_RevoltModel_Factor_Traits_FactorGenerosity_Hint = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorGenerosityHint}Set the value of factor for Generosity",
Text_RevoltModel_Factor_Traits_FactorCaculation_Name = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorCaculationName}Factor caculation",
Text_RevoltModel_Factor_Traits_FactorCaculation_Hint = "{=FactionAndBlade_RevoltModel_Factor_Traits_FactorCaculationHint}Set the value of factor for Caculation",
Text_RevoltModel_Factor_RelationshipsSetting = "RevoltModel Settings/Factor Settings/Relationships",
Text_RevoltModel_Factor_Relationships_FactorRelation_Name = "{=FactionAndBlade_RevoltModel_Factor_Relationships_FactorRelationName}Factor relation",
Text_RevoltModel_Factor_Relationships_FactorRelation_Hint = "{=FactionAndBlade_RevoltModel_Factor_Relationships_FactorRelationHint}Set the value of factor for relation effects revol chance between Govornor and Hero",
Text_RevoltModel_Factor_Relationships_FactorInform_Name = "{=FactionAndBlade_RevoltModel_Factor_Relationships_FactorInformName}Factor inform",
Text_RevoltModel_Factor_Relationships_FactorInform_Hint = "{=FactionAndBlade_RevoltModel_Factor_Relationships_FactorInformHint}Set the value of factor for relation change when hero inform revol faction to governor",
Text_RevoltModel_Factor_Spouses_Setting = "RevoltModel Settings/Factor Settings/Spouses",
Text_RevoltModel_Factor_Spouses_FactorMarried_Name = "{=FactionAndBlade_RevoltModel_Factor_Spouses_FactorMarriedName}Factor married",
Text_RevoltModel_Factor_Spouses_FactorMarried_Hint = "{=FactionAndBlade_RevoltModel_Factor_Spouses_FactorMarriedHinnt}Set the value of factor effects chance of revol",
Text_RevoltModel_Factor_Spouses_FactorSingleOverAge_Name = "{=FactionAndBlade_RevoltModel_Factor_Spouses_FactorSingleOverAgeName}Factor single over age",
Text_RevoltModel_Factor_Spouses_FactorSingleOverAge_Hint = "{=FactionAndBlade_RevoltModel_Factor_Spouses_FactorSingleOverAgeHint}Set the value of factor for age effects the caucalation",
Text_RevoltModel_Factor_Spouses_FactorSingleUnderAge_Name = "{=FactionAndBlade_RevoltModel_Factor_Spouses_FactorSingleUnderAgeName}Factor single under age",
Text_RevoltModel_Factor_Spouses_FactorSingleUnderAge_Hint = "{=FactionAndBlade_RevoltModel_Factor_Spouses_FactorSingleUnderAgerHint}Set the value of factor effects chance of revol",
Text_RevoltModel_Factor_Others_Setting = "RevoltModel Settings/Factor Settings/Others",
Text_RevoltModel_Factor_Others_FactorRenown_Name = "{=FactionAndBlade_RevoltModel_Factor_Others_FactorRenownName}Factor renown",
Text_RevoltModel_Factor_Others_FactorRenown_Hint = "{=FactionAndBlade_RevoltModel_Factor_Others_FactorRenownHint}Set the value of factor effects renown",
Text_RevoltModel_Factor_Others_FactorAmbition_Name = "{=FactionAndBlade_RevoltModel_Factor_Others_FactorAmbitionName}Factor ambition",
Text_RevoltModel_Factor_Others_FactorAmbition_Hint = "{=FactionAndBlade_RevoltModel_Factor_Others_FactorAmbitionHint}Set the value of factor effects ambition";
//private static readonly TextObject ModNameTextObject = new TextObject(Text_ModName);
}
}
using MBOptionScreen.Attributes;
using MBOptionScreen.Attributes.v2;
using MBOptionScreen.Settings;
using System.Xml;
using System.Xml.Serialization;
namespace FactionAndBlade.Settings
{
internal sealed partial class Setting : AttributeSettings<Setting>
{
public override string ModuleFolderName => SubModuel.ModuleFolderName;
public override string ModName => $"{SubModuel.Info.Name} {SubModuel.Info.Version}";
public override string Id { get; set; } = "FactionAndBladeSetting_v2";
public override string Format => "xml";
#region ModelSetting
[XmlElement]
[SettingPropertyBool(Text_General_EnableDebugMode_Name, HintText = Text_General_EnableDebugMode_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_General_Setting)]
public bool EnableDebugMode { get; set; } = false;
#region Faction
#region Characteristic
[XmlElement]
[SettingPropertyBool(Text_Faction_Characterstic_EnableCharacterstic_Name, HintText = Text_Faction_Characterstic_EnableCharacterstic_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_Faction_Characterstic_Setting, IsMainToggle = true)]
public bool EnableCharacterstic { get; set; } = true;
#region DemagogueTroopFactor
[XmlElement]
[SettingPropertyFloatingInteger(Text_Faction_Characterstic_DemagogueTroop_EnableDemagogueTroop_Name, 0f, 3f, HintText = Text_Faction_Characterstic_DemagogueTroop_EnableDemagogueTroop_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_Faction_Characterstic_DemagogueTroop_Setting,IsMainToggle = true)]
public bool EnableDemagogueTroop { get; set; } = true;
[XmlElement]
[SettingPropertyFloatingInteger(Text_Faction_Characterstic_CharacDamagogueTroop_FactorCharmName_Name, 0f, 3f, HintText = Text_Faction_Characterstic_CharacDamagogueTroop_FactorCharmName_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_Faction_Characterstic_DemagogueTroop_Setting)]
public float FactorCharm { get; set; } = 0.31F;
#endregion
#endregion
#region Relationship Setting
[XmlElement]
[SettingPropertyBool(Text_Faction_Relationship_EnableRelationship_Name, HintText = Text_Faction_Relationship_EnableRelationship_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_Faction_Relationship_Setting,IsMainToggle = true)]
public bool EnableRelation { get; set; } = true;
[XmlElement]
[SettingPropertyIntegerAttribute(Text_Faction_Relationship_ValueQuitFaction_Name, 0, 100, HintText = Text_Faction_Relationship_ValueQuitFaction_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_Faction_Relationship_Setting)]
public int ValueQuitFaction { get; set; } = 15;
[XmlElement]
[SettingPropertyIntegerAttribute(Text_Faction_Relationship_ValueJoinFaction_Name, 0, 100, HintText = Text_Faction_Relationship_ValueJoinFaction_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_Faction_Relationship_Setting)]
public int ValueFactionRelationJoin { get; set; } = 15;
#endregion
#endregion
#region RevolModel
[XmlElement]
[SettingPropertyBool(Text_RevoltModel_EnableRevoltModel_Name, HintText = Text_RevoltModel_EnableRevoltModel_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Setting, IsMainToggle = true)]
public bool EnableRevoltModel { get; set; } = true;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_FactorRevolChance_Name, 0f, 1f, HintText = Text_RevoltModel_FactorRevolChance_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Setting)]
public float FactorRevolChance { get; set; } = 0.01F;
#region AgeSetting
[XmlElement]
[SettingPropertyIntegerAttribute(Text_RevoltModel_SpouseAgeSetting_ValueSpouseAge_Name, 0, 100, HintText = Text_RevoltModel_SpouseAgeSetting_ValueSpouseAge_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Spouse_Setting)]
public int ValueSpouseAge { get; set; } = 30;
#endregion
#region FactorSetting
[XmlElement]
[SettingPropertyBool(Text_RevoltModel_Factor_EnableFactorSetting_Name, HintText = Text_RevoltModel_Factor_EnableFactorSetting_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Setting, IsMainToggle = true)]
public bool EnableFactorSetting { get; set; } = true;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_FactorPositiveChance_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_FactorPositiveChance_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Setting)]
public float FactorChanceNegative { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_FactorNegativeChance_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_FactorNegativeChance_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Setting)]
public float FactorChancePositive { get; set; } = 0.31F;
#region TraitFactor
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Traits_FactorMercy_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Traits_FactorMercy_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_TraitsSetting)]
public float FactorMercy { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Traits_FactorValor_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Traits_FactorValor_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_TraitsSetting)]
public float FactorValor { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Traits_FactorHonor_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Traits_FactorHonor_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_TraitsSetting)]
public float FactorHonor { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Traits_FactorGenerosity_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Traits_FactorGenerosity_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_TraitsSetting)]
public float FactorGenerosity { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Traits_FactorCaculation_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Traits_FactorCaculation_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_TraitsSetting)]
public float FactorCaulation { get; set; } = 0.31F;
#endregion
#region RelationFactor
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Relationships_FactorRelation_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Relationships_FactorRelation_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_RelationshipsSetting)]
public float FactorRelation { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Relationships_FactorInform_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Relationships_FactorInform_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_RelationshipsSetting)]
public float FactorInforom { get; set; } = 0.31F;
#endregion
#region SpouseFactor
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Spouses_FactorSingleOverAge_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Spouses_FactorSingleOverAge_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Spouses_Setting)]
public float FactorSingleOverAge { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Spouses_FactorMarried_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Spouses_FactorMarried_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Spouses_Setting)]
public float FactorMarried { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Spouses_FactorSingleUnderAge_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Spouses_FactorSingleUnderAge_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Spouses_Setting)]
public float FactorSingleUnderAge { get; set; } = 0.31F;
#endregion
#region OthersFactor
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Others_FactorRenown_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Others_FactorRenown_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Others_Setting)]
public float FactorRenown { get; set; } = 0.31F;
[XmlElement]
[SettingPropertyFloatingInteger(Text_RevoltModel_Factor_Others_FactorAmbition_Name, 0f, 3f, HintText = Text_RevoltModel_Factor_Others_FactorAmbition_Hint, RequireRestart = false)]
[SettingPropertyGroup(Text_RevoltModel_Factor_Others_Setting)]
public float FactorAmbition { get; set; } = 0.31F;
#endregion
#endregion
#endregion
#endregion
}
}