/// <summary> /// 通过配置文件绑定GridIndex,允许玩家在冲突时自定义GridIndex /// 在自定义ID之后执行 /// </summary> private static void GridIndexBind(ProtoType protoType, Proto proto) { if (proto is ItemProto || proto is RecipeProto) // 只有物品和配方有GridIndex { ConfigEntry <int> entry = null; if (proto is ItemProto) { var item = proto as ItemProto; entry = CustomGridIndex.Bind <int>(protoType.ToString(), item.ID.ToString(), item.GridIndex, $"Item Name = {item.Name}"); item.GridIndex = entry.Value; } else if (proto is RecipeProto) { var recipe = proto as RecipeProto; entry = CustomGridIndex.Bind <int>(protoType.ToString(), recipe.ID.ToString(), recipe.GridIndex, $"Recipe Name = {recipe.Name}"); recipe.GridIndex = entry.Value; } if (entry != null) { if (!GridIndexDict.ContainsKey(protoType)) { GridIndexDict.Add(protoType, new Dictionary <string, ConfigEntry <int> >()); } if (GridIndexDict[protoType].ContainsKey(proto.Name)) { Debug.LogError($"[LDBTool.CustomGridIndex]ID:{proto.ID} Name:{proto.Name} There is a conflict, please check."); Debug.LogError($"[LDBTool.CustomGridIndex]ID:{proto.ID} 姓名:{proto.Name} 存在冲突,请检查。"); } else { GridIndexDict[protoType].Add(proto.Name, entry); } } } }
/// <summary> /// 通过配置文件绑定ID,允许玩家在冲突时自定义ID /// </summary> private static void IdBind(ProtoType protoType, Proto proto) { var entry = CustomID.Bind <int>(protoType.ToString(), proto.Name, proto.ID); proto.ID = entry.Value; if (!IDDict.ContainsKey(protoType)) { IDDict.Add(protoType, new Dictionary <string, ConfigEntry <int> >()); } if (IDDict[protoType].ContainsKey(proto.Name)) { Debug.LogError($"[LDBTool.CustomID]ID:{proto.ID} Name:{proto.Name} There is a conflict, please check."); Debug.LogError($"[LDBTool.CustomID]ID:{proto.ID} 姓名:{proto.Name} 存在冲突,请检查。"); } else { IDDict[protoType].Add(proto.Name, entry); } }
/// <summary> /// 通过配置文件绑定ID,允许玩家在冲突时自定义ID /// </summary> /// <param name="protoType"></param> /// <param name="proto"></param> private static void IdBind(ProtoType protoType, Proto proto) { var entry = CustomConfig.Bind <int>(protoType.ToString(), proto.Name, proto.ID); proto.ID = entry.Value; if (!IDDict.ContainsKey(protoType)) { IDDict.Add(protoType, new Dictionary <string, ConfigEntry <int> >()); } if (IDDict[protoType].ContainsKey(proto.Name)) { Debug.LogError($"[LDBTool] Name {proto.Name} already exists.please check mod."); Debug.LogError($"[LDBTool] 姓名 {proto.Name} 已经存在.请检查Mod."); } else { IDDict[protoType].Add(proto.Name, entry); } }
/// <summary> /// 通过配置文件绑定翻译文件,允许玩家在翻译缺失或翻译不准确时自定义翻译 /// </summary> private static void StringBind(ProtoType protoType, Proto proto) { if (proto is StringProto) { var lang = proto as StringProto; ConfigEntry <string> zhcn, enus, frfr; zhcn = CustomStringZHCN.Bind <string>(protoType.ToString(), lang.ID.ToString(), lang.ZHCN, lang.Name); enus = CustomStringENUS.Bind <string>(protoType.ToString(), lang.ID.ToString(), lang.ENUS, lang.Name); frfr = CustomStringFRFR.Bind <string>(protoType.ToString(), lang.ID.ToString(), lang.FRFR, lang.Name); lang.ZHCN = zhcn.Value; lang.ENUS = enus.Value; lang.FRFR = frfr.Value; if (zhcn != null) { if (!ZHCNDict.ContainsKey(protoType)) { ZHCNDict.Add(protoType, new Dictionary <string, ConfigEntry <string> >()); } if (ZHCNDict[protoType].ContainsKey(proto.Name)) { Debug.LogError($"[LDBTool.CustomLocalization.ZHCN]ID:{proto.ID} Name:{proto.Name} There is a conflict, please check."); Debug.LogError($"[LDBTool.CustomLocalization.ZHCN]ID:{proto.ID} 姓名:{proto.Name} 存在冲突,请检查。"); } else { ZHCNDict[protoType].Add(proto.Name, zhcn); } } if (ENUSDict != null) { if (!ENUSDict.ContainsKey(protoType)) { ENUSDict.Add(protoType, new Dictionary <string, ConfigEntry <string> >()); } if (ENUSDict[protoType].ContainsKey(proto.Name)) { Debug.LogError($"[LDBTool.CustomLocalization.ENUS]ID:{proto.ID} Name:{proto.Name} There is a conflict, please check."); Debug.LogError($"[LDBTool.CustomLocalization.ENUS]ID:{proto.ID} 姓名:{proto.Name} 存在冲突,请检查。"); } else { ENUSDict[protoType].Add(proto.Name, enus); } } if (frfr != null) { if (!FRFRDict.ContainsKey(protoType)) { FRFRDict.Add(protoType, new Dictionary <string, ConfigEntry <string> >()); } if (FRFRDict[protoType].ContainsKey(proto.Name)) { Debug.LogError($"[LDBTool.CustomLocalization.FRFR]ID:{proto.ID} Name:{proto.Name} There is a conflict, please check."); Debug.LogError($"[LDBTool.CustomLocalization.FRFR]ID:{proto.ID} 姓名:{proto.Name} 存在冲突,请检查。"); } else { FRFRDict[protoType].Add(proto.Name, frfr); } } } }
/// <summary> /// Funzione per l'importazione di un documento i cui dati sono descritti /// all'interno di un oggetto DocumentRowData /// </summary> /// <param name="documentRowData">L'oggetto con i dati sul documento da creare</param> /// <param name="userInfo">Le informaizoni sull'utente che ha lanciato la procedura</param> /// <param name="role">Il ruolo con cui è stata lanciata la procedura</param> /// <param name="serverPath">L'indirizzo della WA</param> /// <param name="isProfilationRequired">True se è richiesta la profilazione</param> /// <param name="isRapidClassificationRequired">True se è richiesta la classificazione rapida</param> /// <param name="sharedDirectoryPath">L'indirizzo della cartella sherata in cui è possibile reperire l'immagine da associare al documento</param> /// <param name="isSmistamentoEnabled">True se è abilitato lo smistamento</param> /// <param name="protoType">Il tipo di documento da creare</param> /// <param name="resultsContainer"></param> /// <param name="acquireDelegate">Il delegate per l'acquisizione</param> /// <returns>Il risultato dell'importazione</returns> public static ImportResult ImportAndAcquireDocument( DocumentRowData documentRowData, InfoUtente userInfo, Ruolo role, string serverPath, bool isProfilationRequired, bool isRapidClassificationRequired, string ftpAddress, bool isSmistamentoEnabled, ProtoType protoType, ref ResultsContainer resultsContainer, String ftpUsername, String ftpPassword, bool isEnabledPregressi) { #region Dichiarazione variabili // L'oggetto da restituire ImportResult toReturn = null; #endregion switch (protoType) { case ProtoType.ATT: if (resultsContainer != null) { toReturn = new Attachment().ImportDocument( documentRowData, userInfo, role, ftpAddress, ref resultsContainer, ftpUsername, ftpPassword); } break; case ProtoType.A: case ProtoType.G: case ProtoType.I: case ProtoType.P: // Si recupera l'oggetto responsabile dell'import // e si esegue l'importazione toReturn = GetDocumentManager(protoType).ImportDocument( documentRowData, userInfo, role, serverPath, isProfilationRequired, isRapidClassificationRequired, ftpAddress, protoType == ProtoType.G, isSmistamentoEnabled, protoType.ToString(), ftpUsername, ftpPassword, isEnabledPregressi, AcquireFileFromModel, true); break; } // Restituzione del risultato return(toReturn); }