Beispiel #1
0
        public static string GetFileNameNoExt(string prefix, TES4Record record, bool includeFormID, StageIndexAndLogIndex?stageIndexAndLogIndex)
        {
            string?editorID            = record.TryGetEditorID();
            string editorID_formID     = (editorID != null ? editorID : "").ToLower() + (includeFormID ? "_" + (record.FormID + 0x01000000).ToString("x").PadLeft(8, '0') : "");
            string indexPlusFileNumber = stageIndexAndLogIndex != null ? "_" + stageIndexAndLogIndex.StageIndex.ToString() + "_" + stageIndexAndLogIndex.LogIndex.ToString() : "";

            return(prefix + editorID_formID + indexPlusFileNumber);
        }
        private Nullable <KeyValuePair <int, TES5BasicType> > GetTypeFromSCRO(TES4Record scriptTES4Record, StageIndexAndLogIndex?stageIndexAndLogIndex, string propertyName, bool throwException)
        {
            var types = GetTypesFromSCRO(scriptTES4Record, stageIndexAndLogIndex);
            KeyValuePair <int, TES5BasicType> type;

            if (types.TryGetValue(propertyName, out type))
            {
                return(type);
            }
            if (throwException)
            {
                throw new ConversionException("Form " + scriptTES4Record.TryGetEditorID() + " (" + scriptTES4Record.FormID.ToString() + ")" + (stageIndexAndLogIndex != null ? ", " + stageIndexAndLogIndex.ToString() : "") + " did not have a property named " + propertyName + ".");
            }
            return(null);
        }