// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // VersionCheck // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ /// <inheritdoc /> /// <summary> /// VersionConfigにセットされたバージョンとイベントコマンドの内容を確認し、 /// イベントコマンドの内容が設定バージョンに対応していないものであれば警告ログを出力する。 /// </summary> public override void OutputVersionWarningLogIfNeed() { if (VersionConfig.IsUnderVersion(WoditorVersion.Ver2_00)) { OutputVersionWarningLogIfNeed_UnderVer2_00(); } }
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // ReadMethod // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ private void ReadOneData(TIniTarget target) { var section = target.SectionName; var properties = GetAllPropertyInfo(); foreach (var propertyInfo in properties) { var iniTargetAttr = (IniTargetAttribute)propertyInfo.GetCustomAttribute(typeof(IniTargetAttribute), true); if (VersionConfig.IsUnderVersion(iniTargetAttr.SupportMinVersion)) { // サポート対象外の場合、ファイルからは取得できないため固定で空文字をセット propertyInfo.SetValue(target, string.Empty); continue; } var sb = new StringBuilder(256); IniFileHelper.GetPrivateProfileString(section ?? "", propertyInfo.Name, "", sb, sb.Capacity, FilePath); var result = sb.ToString(); Logger.Debug(FileIOMessage.SuccessRead(GetType(), $"プロパティ:{propertyInfo.Name}", result)); propertyInfo.SetValue(target, sb.ToString()); } }
/// <summary> /// VersionConfigにセットされたバージョンとイベントコマンドの内容を確認し、 /// イベントコマンドの内容が設定バージョンに対応していないものであれば警告ログを出力する。 /// </summary> public void OutputVersionWarningLogIfNeed() { if (SupportVersion is null) { return; } if (VersionConfig.IsUnderVersion(SupportVersion)) { Logger.Warning(VersionWarningMessage.NotUnderInSetting( $"{nameof(TilePathPermission)}.{nameof(Dependent)}", VersionConfig.GetConfigWoditorVersion(), SupportVersion)); } }
// _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // Private Static Method // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ /// <summary> /// バージョンによる定義チェックを行い、警告メッセージを出力する /// </summary> /// <param name="value">変数アドレス値</param> private static void VersionCheck(int value) { var infoCode = value % 10; if (VersionConfig.IsUnderVersion(WoditorVersion.Ver2_01)) { // 「イベントの座標」のうち、10の位が5または6のアドレスは // ウディタVer2.01未満では非対応 if (infoCode == 5 || infoCode == 6) { WodiLibLogger.GetInstance().Warning(VersionWarningMessage.NotUnderInVariableAddress( value, VersionConfig.GetConfigWoditorVersion(), WoditorVersion.Ver2_01)); } } if (infoCode == 7 || infoCode == 8) { WodiLibLogger.GetInstance().Warning(VersionWarningMessage.NotUsingVariableAddress(value)); } }