Beispiel #1
0
        public override void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "n": name = data.ToString(); break;

            case "u": _usage = data.ToInt(); break;

            case "e": data.Decode_Dictionary(out enm); break;

            case "c":  data.ToList(out _myCategories); break;
            }
        }
Beispiel #2
0
            public override void Decode(string key, CfgData data)
            {
                switch (key)
                {
                case "b": data.Decode(base.Decode); break;

                case "crn": _roundedCorners.DecodeFull(data); break;

                case "hov": valueWhenOver = data.ToFloat(); break;

                case "nrm": valueWhenOff = data.ToFloat(); break;
                }
            }
Beispiel #3
0
        public void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "bkSrv": books.DecodeFull(data); break;

            case "ptUI": showPlaytimeUI = data.ToBool(); break;

            case "us": data.ToList(out users.all); break;

            case "curUser": users.LoadUser(data.ToString()); break;
            }
        }
        public virtual void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "n": NameForPEGI = data.ToString(); break;

            case "s": data.ToList(out subCategories); break;

            case "i":  IndexForPEGI = data.ToInt(); break;

            case "in": _inspected = data.ToInt(); break;
            }
        }
        public void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "sc": targetSize = data.ToVector3(); break;

            case "pos": targetLocalPosition = data.ToVector3(); break;

            case "col": targetColor = data.ToColor(); break;

            case "tCol": targetTextColor = data.ToColor(); break;
            }
        }
Beispiel #6
0
        public override void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "b": data.Decode(base.Decode); break;    //data.Decode_Base(base.Decode, this); break;

            case "bg": visualStyleTag = data.ToString(); break;

            case "sub": data.ToList(out coreNodes); break;

            case "gn":  data.ToList(out gameNodes, GameNodeBase.all); break;
            }
        }
Beispiel #7
0
        public void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "pos": _positionLerp.TargetValue = data.ToVector3(); break;

            case "rot": _rotationLerp.TargetValue = data.ToQuaternion(); break;

            case "h": _heightLerp.TargetValue = data.ToFloat(); break;

            case "sp": speed = data.ToFloat(); break;
            }
        }
        public override void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "vrt": data.ToList(out meshPoints); break;

            case "tri": data.ToList(out triangles); break;

            case "n": meshName = data.ToString(); break;

            case "grM": data.ToInt(ref maxGroupIndex); break;

            case "sub": data.ToInt(ref subMeshCount); break;

            case "wei": gotBoneWeights = data.ToBool(); break;

            case "gcls": data.DecodeInto(out groupColors); break;

            case "bv": data.ToList(out baseVertex); break;

            case "biP": data.Decode_Array(out bindPoses); break;

            case "UV2dR": data.ToInt(ref uv2DistributeRow); break;

            case "UV2cur": data.ToInt(ref uv2DistributeCurrent); break;

            case "sctdUV":
                selectedUv = meshPoints[data.ToInt(0)].vertices[0]; break;

            case "sctdTris":
                selectedTriangle = triangles[data.ToInt(0)]; break;

            default:
                if (MeshToolBase.AllTools.IsNullOrEmpty())
                {
                    break;
                }

                foreach (var t in MeshToolBase.allToolsWithPerMeshData)
                {
                    var mt = t as MeshToolBase;
                    if (mt == null || !mt.StdTag.Equals(key))
                    {
                        continue;
                    }
                    mt.DecodeFull(data);
                    break;
                }
                break;
            }
        }
        public override void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "pl":
                data.ToList(out CameraModuleBase.modules, CameraModuleBase.all);
                CameraModuleBase.RefreshModules();
                break;

            case "mm": MeshManager.DecodeFull(data); break;

            case "rts": RenderTextureBuffersManager.renderBuffersSize = data.ToInt(0); break;
            }
        }
Beispiel #10
0
        public override void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "b": data.Decode(base.Decode); break;     //data.Decode_Base(base.Decode, this); break;

            case "t": type = (BookLinkType)data.ToInt(); break;

            case "lnk": linkedBookName = data.ToString(); break;

            case "au": linkedBookAuthor = data.ToString(); break;

            case "ep": bookEntryPoint = data.ToString(); break;
            }
        }
Beispiel #11
0
        public void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "fU": Down(data.ToVector2());  break;

            case "fP": Down(data.ToVector3());  break;

            case "tU": uvTo = data.ToVector2(); break;

            case "tP": posTo = data.ToVector3(); break;

            case "Up": MouseUpEvent = true; break;
            }
        }
Beispiel #12
0
        public virtual void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "t":     _type = (ConditionBranchType)data.ToInt(0); break;

            case "wb":    data.ToList(out _branches); break;

            case "v":     data.ToList(out _conditions); break;

            case "insB":  _browsedBranch = data.ToInt(0); break;

            case "ic":    _browsedCondition = data.ToInt(0); break;
            }
        }
        public override void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "ch": data.ToList(out _channel); break;

            case "c": _isColor = data.ToBool(); break;

            case "n": _name = data.ToString(); break;

            case "b": bumpStrength = data.ToFloat(); break;

            case "fc": fillColor = data.ToColor(); break;
            }
        }
Beispiel #14
0
        private void DecodeStroke(string tg, CfgData data)
        {
            switch (tg)
            {
            case "trg": currentlyDecodedPainter.UpdateOrSetTexTarget(data.Equals("C") ? TexTarget.Texture2D : TexTarget.RenderTexture); break;

            case "brush":
                GlobalBrush.DecodeFull(data);
                GlobalBrush.brush2DRadius *= parentMeta?.width ?? 256; break;

            case "s":
                currentlyDecodedPainter.stroke.DecodeFull(data);
                GlobalBrush.Paint(currentlyDecodedPainter.PaintCommand);
                break;
            }
        }
Beispiel #15
0
 private static void LoadLanguageInfo(CfgData cfgData, LanguageInfo languageInfo)
 {
     if (cfgData.TryGetValue(GameConstants.SystemLanguagesKey, out var value) && (value != null))
     {
         languageInfo.Languages.Clear();
         var languages = value.Split(',');
         foreach (var language in languages)
         {
             languageInfo.Languages.Add(language.Trim());
         }
     }
     if (cfgData.TryGetValue(GameConstants.CurrentLanguageKey, out value) && (value != null))
     {
         languageInfo.Current = value;
     }
 }
Beispiel #16
0
        public override void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "typeGPU": data.ToInt(ref _inGpuBrushType); break;

            case "typeCPU": data.ToInt(ref _inCpuBrushType); break;

            case "size2D": brush2DRadius = data.ToFloat(); break;

            case "size3D": brush3DRadius = data.ToFloat(); break;

            case "useMask": useMask = data.ToBool(); break;

            case "mask": mask = (ColorMask)data.ToInt(0); break;

            case "modeCPU":  data.ToInt(ref _inCpuBlitMode); break;

            case "modeGPU":  data.ToInt(ref _inGpuBlitMode); break;

            case "bc": Color = data.ToColor(); break;

            case "source":  data.ToInt(ref selectedSourceTexture); break;

            case "blur": blurAmount = data.ToFloat(); break;

            case "decA": decalAngle = data.ToFloat(); break;

            case "decNo":  data.ToInt(ref selectedDecal); break;

            case "Smask":  data.ToInt(ref selectedSourceMask); break;

            case "maskTil": maskTiling = data.ToFloat(); break;

            case "maskFlip": flipMaskAlpha = data.ToBool(); break;

            case "hard": hardness = data.ToFloat(); break;

            case "Speed": _dFlow.Value = data.ToFloat(); break;

            case "dSpeed": _dFlow.Decode(data); break;

            case "dyn": data.Decode(out brushDynamic, BrushDynamic.Base.all); break;

            case "maskOff": maskOffset = data.ToVector2(); break;
            }
        }
Beispiel #17
0
        public virtual void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "en": enabled = data.ToBool(); break;

            case "t": _targetIndex = data.ToInt(0); if (!enabled)
                {
                    InitVals();
                }
                break;

            case "vals": data.ToList(out links); sameSizeDataIndex = -1; break;

            case "sameSize": sameSizeDataIndex = data.ToInt(0); InitVals(); break;
            }
        }
        public void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "goto": nextOne = data.ToString(); break;

            case "cnd": data.Decode(out conditions); break;

            case "t": text.DecodeFull(data); break;

            case "ts2b": text2.DecodeFull(data); break;

            case "res": data.ToList(out results); break;

            case "ins": _inspectedItems = data.ToInt(); break;
            }
        }
        public override void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "gtuv": projectionUv = data.ToBool(); break;

            case "offset": offset = data.ToVector2(); break;

            case "tile": tiling = data.ToVector2(); break;

            case "nrmWrap": projectorNormalThreshold01 = data.ToFloat();  break;

            case "fr": projectFront = true; break;

            case "mp": meshProcessors = true; break;
            }
        }
Beispiel #20
0
        public void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "fov": fieldOfView = data.ToFloat(); break;

            case "p": position = data.ToVector3(); break;

            case "r": rotation = data.ToQuaternion();  break;

            case "n": nearPlane = data.ToFloat(); break;

            case "f": farPlane = data.ToFloat(); break;

            case "l": localTransform = true; break;
            }
        }
Beispiel #21
0
 public bool Save(CfgData data)
 {
     try
     {
         using var writer = File.CreateText(_fileName);
         foreach (var row in data)
         {
             writer.WriteLine(row.ToString());
         }
         writer.Flush();
         return(true);
     }
     catch (Exception e)
     {
         _logger.Error(e, $"Failed save file: {_fileName}");
         return(false);
     }
 }
Beispiel #22
0
        public virtual void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "name": name = data.ToString(); break;

            case "cond": conditions.DecodeFull(data); break;

            case "sub": data.ToList(out subBranches); break;

            case "el": data.ToList(out elements); break;

            case "ie": _inspectedElement = data.ToInt(); break;

            case "is": _inspectedItems = data.ToInt(); break;

            case "br": _inspectedBranch = data.ToInt(); break;
            }
        }
Beispiel #23
0
 public bool CreateProfile(string profileName, CfgData profileData)
 {
     _logger.Info($"Create profile: {profileName}");
     if (_profiles.ContainsKey(profileName))
     {
         _logger.Warn($"New profile name: {profileName} already exist");
         return(false);
     }
     if (CreateProfilesDirectory())
     {
         var profileFile = new CfgFile(GetProfilePath(profileName));
         if (profileFile.Save(profileData))
         {
             _profiles.Add(profileName, profileData);
             return(true);
         }
     }
     return(false);
 }
Beispiel #24
0
 public bool SaveProfile(string profileName, CfgData profileData)
 {
     _logger.Info($"Save profile: {profileName}");
     if (!_profiles.ContainsKey(profileName))
     {
         _logger.Error($"Save profile: {profileName} not found");
         return(false);
     }
     if (CreateProfilesDirectory())
     {
         var profileFile = new CfgFile(GetProfilePath(profileName));
         if (profileFile.Save(profileData))
         {
             _profiles[profileName] = profileData;
             return(true);
         }
     }
     return(false);
 }
Beispiel #25
0
        public void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "gSys2": data.Decode_Dictionary(out presentationSystemPerNodeConfigs); break;

            // DEPRECATED (TMP)
            case "gSys":
                Dictionary <string, CfgData> dicTmp;
                data.Decode_Dictionary(out dicTmp);
                foreach (var pair in dicTmp)
                {
                    var cfg = new PresentationSystemConfigurations();
                    pair.Value.DecodeInto(out cfg.perNodeConfigs);
                    presentationSystemPerNodeConfigs[pair.Key] = cfg;
                }
                break;
            }
        }
        public override void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "tf": data.ToList(out targetFields); break;

            case "af": data.ToList(out atlasFields); break;

            case "sf": data.ToList(out _srcFields); break;

            case "n": NameForPEGI = data.ToString(); break;

            case "rgb": _sRgb = data.ToBool(); break;

            case "s":  data.ToInt(ref _textureSize); break;

            case "as":  data.ToInt(ref _atlasSize); break;
            }
        }
Beispiel #27
0
        public async Task <bool> SaveAsync(CfgData data)
        {
            try
            {
                using var writer = File.CreateText(_fileName);
                foreach (var row in data)
                {
                    await writer.WriteLineAsync(row.ToString()).ConfigureAwait(false);
                }
                await writer.FlushAsync().ConfigureAwait(false);

                return(true);
            }
            catch (Exception e)
            {
                _logger.Error(e, $"Failed save file: {_fileName}");
                return(false);
            }
        }
Beispiel #28
0
 private static bool FixUserConfigLanguageInfo(CfgData cfgData, LanguageInfo languageInfo)
 {
     if (cfgData.Any())
     {
         var anyFieldFixed = cfgData.RemoveRow(GameConstants.SystemLanguagesKey) != null;
         if (cfgData.TryGetValue(GameConstants.CurrentLanguageKey, out var value) && (value != null))
         {
             if (languageInfo.Languages.Contains(value))
             {
                 languageInfo.Current = value;
             }
             else
             {
                 cfgData.RemoveRow(GameConstants.CurrentLanguageKey);
                 anyFieldFixed = true;
             }
         }
         return(anyFieldFixed);
     }
     return(false);
 }
        public void Decode(string key, CfgData data)
        {
            switch (key)
            {
            case "mdls":
                Modules.DecodeFull(data);
                break;

            case "invCast":
                invertRayCast = data.ToBool();
                break;

            case "m":
                SavedEditableMesh = data;
                break;

            case "prn":
                selectedMeshProfile = data.ToString();
                break;
            }
        }
        public void Decode(string tg, CfgData data)
        {
            switch (tg)
            {
            case "ref": referenceName = data.ToString(); break;

            case "Conds": data.Decode(out conditions); break;

            case "txts": texts.DecodeFull(data); break;

            case "opt": data.ToList(out choices); break;

            case "fin": data.ToList(out finalResults); break;

            case "is": _inspectedItems = data.ToInt(); break;

            case "bc": _inspectedChoice = data.ToInt(); break;

            case "ir": _inspectedResult = data.ToInt(); break;
            }
        }