Esempio n. 1
0
        protected override void Initalize(ControllerData data, UI_ImageCache cache, string themePath, JObject themeData)
        {
            base.Initalize(data, cache, themePath, themeData);
            this.data  = data;
            this.cache = cache;

            DisplayType = themeData["mode"]?.Value <string>();
            string ImageName = themeData["image"]?.Value <string>();

            ShadowLName = themeData["shadowl"]?.Value <string>();
            ShadowRName = themeData["shadowr"]?.Value <string>();
            ShadowUName = themeData["shadowu"]?.Value <string>();
            ShadowDName = themeData["shadowd"]?.Value <string>();

            if (!string.IsNullOrWhiteSpace(ImageName))
            {
                DisplayImage = cache.LoadImage(ImageName);
            }

            if (!string.IsNullOrWhiteSpace(ShadowLName))
            {
                ShadowL = cache.LoadImage(ShadowLName);
            }

            if (!string.IsNullOrWhiteSpace(ShadowRName))
            {
                ShadowR = cache.LoadImage(ShadowRName);
            }

            if (!string.IsNullOrWhiteSpace(ShadowUName))
            {
                ShadowU = cache.LoadImage(ShadowUName);
            }

            if (!string.IsNullOrWhiteSpace(ShadowDName))
            {
                ShadowD = cache.LoadImage(ShadowDName);
            }

            Width  = themeData["width"]?.Value <float>() ?? 0;
            Height = themeData["height"]?.Value <float>() ?? 0;

            TiltTranslateX = themeData["tilttranslatex"]?.Value <float>() ?? 0;
            TiltTranslateY = themeData["tilttranslatey"]?.Value <float>() ?? 0;
        }
Esempio n. 2
0
        protected override void Initalize(ControllerData data, UI_ImageCache cache, string themePath, JObject themeData)
        {
            base.Initalize(data, cache, themePath, themeData);

            Height         = themeData["height"]?.Value <float>() ?? 0;
            Width          = themeData["width"]?.Value <float>() ?? 0;
            DrawFromCenter = themeData["center"]?.Value <bool>() ?? false;

            string imageName = themeData["image"]?.Value <string>();

            if (!string.IsNullOrWhiteSpace(imageName))
            {
                DisplayImage = cache.LoadImage(imageName);
            }
        }
Esempio n. 3
0
        protected override void Initalize(ControllerData data, UI_ImageCache cache, string themePath, JObject themeData)
        {
            base.Initalize(data, cache, themePath, themeData);
            this.data = data;

            PadPosHistory = new List <PointF?>();

            InputName = themeData["inputName"]?.Value <string>();
            string imageName   = themeData["image"]?.Value <string>();
            int    TrailLength = themeData["length"]?.Value <int>() ?? 0;

            float Width  = themeData["width"]?.Value <float>() ?? 0;
            float Height = themeData["height"]?.Value <float>() ?? 0;

            if (!string.IsNullOrWhiteSpace(imageName) && TrailLength > 0)
            {
                Image  ImagePadDecayBase = cache.LoadImage(imageName);
                string SizeSuffix        = string.Empty;
                if (Width > 0 && Height > 0)
                {
                    ImagePadDecayBase = new Bitmap(ImagePadDecayBase, (int)Width, (int)Height);
                }
                //int scaledTrailLength = (int)(TrailLength * (MainForm.fpsLimit / 60.0f));
                ImagePadDecay = new Image[TrailLength];
                for (int x = 0; x < ImagePadDecay.Length; x++)
                {
                    float percent = ((x + 1) * 1.0f / ImagePadDecay.Length);

                    ImagePadDecay[x] = cache.GetImage($"{imageName}:{Width}:{Height}:{percent}", () => { return(UI_ImageCache.SetImageOpacity(ImagePadDecayBase, percent * 0.15f)); });
                }
            }
            else
            {
                ImagePadDecay = new Image[0];
            }
        }