void Awake()
    {
        Application.targetFrameRate = 30;
        skinLoader = transform.root.GetComponent <SkinLoader>();

        filePathFieldRect = new Rect(buffer, buffer, Screen.width - 2 * buffer, 20);
        guiElements.Add(filePathFieldRect);
        filePathGhostTextRect = new Rect(buffer + 5, filePathFieldRect.y, filePathFieldRect.width, filePathFieldRect.height);
        guiElements.Add(filePathGhostTextRect);

        rotationSensitivityLabelRect = new Rect(buffer, guiElements.Last().yMax, 100, 20);
        guiElements.Add(rotationSensitivityLabelRect);
        rotationSensitivityRect = new Rect(rotationSensitivityLabelRect.xMax + buffer, rotationSensitivityLabelRect.yMin + 5, 150, 20);
        guiElements.Add(rotationSensitivityRect);

        alexToggleRect = new Rect(buffer, guiElements.Last().yMax - 5, 120, 15);
        guiElements.Add(alexToggleRect);

        helpRect  = new Rect(Screen.width - helpSize - buffer, Screen.height - helpSize - buffer, helpSize, helpSize);
        helpStyle = new GUIStyle()
        {
            imagePosition = ImagePosition.ImageOnly
        };
        guiElements.Add(helpRect);

        statusMeassageRect = new Rect(buffer, Screen.height - statusMeassageRectHeight - buffer, helpRect.xMin - 2 * buffer, statusMeassageRectHeight);
    }
示例#2
0
        public WindowBorderSkin(string skinName, string colorSchemeName)
        {
            if (!Directory.Exists(skinName))
            {
                throw new Exception("Skin selected doesn't exsits.\nMake sure that you didn't remove the skin folder.");
            }

            _skinLoader = new SkinIniLoader(skinName);

            ColorScheme = SkinLoader.GetColorScheme(colorSchemeName);

            MaximizedTopFrame = SkinLoader.GetSkinElement(SkinIDs.MaximizedTop);
            TopFrame          = SkinLoader.GetSkinElement(SkinIDs.Top);
            LeftFrame         = SkinLoader.GetSkinElement(SkinIDs.Left);
            RightFrame        = SkinLoader.GetSkinElement(SkinIDs.Right);
            BottomFrame       = SkinLoader.GetSkinElement(SkinIDs.Bottom);
            ReflectionImage   = SkinLoader.GetSkinElement(SkinIDs.Reflection);

            MinimizeButton  = SkinLoader.GetSkinElement(SkinIDs.MinButton);
            MaximizeButton  = SkinLoader.GetSkinElement(SkinIDs.MaxButton);
            RestoreButton   = SkinLoader.GetSkinElement(SkinIDs.ResButton);
            HelpButton      = SkinLoader.GetSkinElement(SkinIDs.HelpButton);
            TitleBackground = SkinLoader.GetSkinElement(SkinIDs.CaptionBackground);
            CloseButton     = SkinLoader.GetSkinElement(SkinIDs.CloseButton);
            Close2Button    = SkinLoader.Exists(SkinIDs.Close2Button) ? SkinLoader.GetSkinElement(SkinIDs.Close2Button) : CloseButton;

            Caption = SkinLoader.GetSkinElement(SkinIDs.Caption);
            Icon    = SkinLoader.GetSkinElement(SkinIDs.Icon);

            SizingPadding      = SkinLoader.GetRect(SkinIDs.General, SkinKeys.Sizing);
            InActiveReflection = (byte)SkinLoader.GetCustomIntegerProperty(SkinIDs.General, SkinKeys.ReflectionInActive, 255);
        }
示例#3
0
        public ExplorerSkin(string SkinPath, string ColorScheme) : base(SkinPath, ColorScheme)
        {
            NavigateBackButton     = SkinLoader.GetSkinElement(ExplorerSkinIDs.NavigateBackButton);
            NavigateForewardButton = SkinLoader.GetSkinElement(ExplorerSkinIDs.NavigateForewardButton);
            SearchButton           = SkinLoader.GetSkinElement(ExplorerSkinIDs.SearchButton);
            RefreshButton          = SkinLoader.GetSkinElement(ExplorerSkinIDs.RefreshButton);
            DownArrowButton        = SkinLoader.GetSkinElement(ExplorerSkinIDs.DownArrowButton);
            BreadCrumbButton       = SkinLoader.GetSkinElement(ExplorerSkinIDs.BreadCrumbButton);
            HistoryButton          = SkinLoader.GetSkinElement(ExplorerSkinIDs.HistoryButton);
            AddressBarButton       = SkinLoader.GetSkinElement(ExplorerSkinIDs.AddressBarBackground);

            PopupBox     = SkinLoader.GetSkinElement(ExplorerSkinIDs.Box);
            PopupboxItem = SkinLoader.GetSkinElement(ExplorerSkinIDs.BoxButton);
            RecentIcons  = SkinLoader.GetSkinElement(ExplorerSkinIDs.RecentIcons);

            Box = new LayeredPopupMenu();
            Box.BackgroundImage    = PopupBox.Frames[0];
            Box.ContentMargin      = PopupBox.ContentPadding;
            Box.StretchMargin      = PopupBox.StretchPadding;
            Box.ScrollbarAlighnemt = PopupBox.ElementAlign;

            Box.ItemBackgroundImage              = PopupboxItem.Frames[0];
            Box.ItemHoveredBackgroundImage       = PopupboxItem.Frames[1];
            Box.ItemBackgroundImageStretchMargin = PopupboxItem.StretchPadding;
            Box.ItemContent      = PopupboxItem.ContentPadding;
            Box.ItemIconLocation = new Point(PopupboxItem.NormalEdges.Left, PopupboxItem.NormalEdges.Top);

            Box.Font           = PopupboxItem.Font;
            Box.ForeColorBrush = PopupboxItem.NormalTextBrush;

            BoxButton = PopupboxItem;

            DefaultSearchText = SkinLoader.GetCustomStringProperty(SkinIDs.General, SkinKeys.DefaultSearchText, "Search");
            RightArrowWidth   = SkinLoader.GetCustomIntegerProperty(SkinIDs.General, SkinKeys.RightArrowWidth, 0);
        }
示例#4
0
        void PerformLoading()
        {
            try
            {
                SetLoadingString("Loading Languages...");

                var language = LoadLanguages();

                SetLoadingString("Initializing base forms...");

                Program.Context.SplashForm.Invoke((Action)(() =>
                {
                    Editor.MainForm.FinishedLoadingLanguages();
                    Editor.MainForm.Initialize(language);
                }));

                if (GlobalSettings.AutoUpdate)
                {
                    SetLoadingString("Checking for updates...");

                    if (Program.Context.Updater.CheckForUpdates())
                    {
                        Program.Context.SplashForm.Invoke((Action)(() =>
                        {
                            Editor.ShowUpdateDialog(Program.Context.SplashForm);
                        }));
                    }
                }

                SetLoadingString("Loading swatches...");

                SwatchLoader.LoadSwatches();
                Program.Context.SplashForm.Invoke((Action)SwatchLoader.FinishedLoadingSwatches);

                SetLoadingString("Loading models...");

                ModelLoader.LoadModels();
                Program.Context.SplashForm.Invoke((Action)Editor.MainForm.FinishedLoadingModels);

                SetLoadingString("Loading skins...");

                SkinLoader.LoadSkins();

                Program.Context.SplashForm.Invoke((Action)Program.Context.DoneLoadingSplash);
                Program.Context.Form.Invoke((Action)(() =>
                {
                    Program.Context.SplashForm.Close();
                    GC.Collect();
                }
                                                     ));
            }
            catch (Exception ex)
            {
                Program.RaiseException(new Exception("Failed to initialize program during \"" + label1.Text + "\"", ex));
                Application.Exit();
            }
        }
示例#5
0
        void PerformLoading()
        {
            ErrorHandlerWrap(() =>
            {
                SetLoadingString("Loading Languages...");

                var language = LoadLanguages();

                SetLoadingString("Initializing base forms...");

                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(() =>
                {
                    Editor.MainForm.FinishedLoadingLanguages();
                    Editor.MainForm.Initialize(language);
                }));

                if (GlobalSettings.AutoUpdate)
                {
                    SetLoadingString("Checking for updates...");

                    if (Program.Context.Updater.CheckForUpdates())
                    {
                        Program.Context.SplashForm.Invoke(ErrorHandlerWrap(() =>
                        {
                            Editor.ShowUpdateDialog(Program.Context.SplashForm);
                        }));
                    }
                }

                SetLoadingString("Loading swatches...");

                SwatchLoader.LoadSwatches();
                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(SwatchLoader.FinishedLoadingSwatches));

                SetLoadingString("Loading models...");

                ModelLoader.LoadModels();
                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(Editor.MainForm.FinishedLoadingModels));

                SetLoadingString("Loading skins...");

                SkinLoader.LoadSkins();

                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(Program.Context.DoneLoadingSplash));

                Program.Context.Form.Invoke(ErrorHandlerWrap(() =>
                {
                    Program.Context.SplashForm.Close();
                    GC.Collect();
                }));
            })();
        }
示例#6
0
        protected override void LoadContent()
        {
            LogHelper.Log("Game Root: Load Content..");

            _spriteBatch = new SpriteBatch(GraphicsDevice);

            try
            {
                _usedSkin = SkinLoader.Load(Content, GraphicsDevice, _settings.Skin);
            }
            catch (Exception e)
            {
                LogHelper.Log($"GameRoot: Error while opening Skin, using Default skin instead: {e}");
                _usedSkin      = SkinLoader.Load(Content, GraphicsDevice, "Default");
                _settings.Skin = "Default";
            }

            _skinAssetManager = new SkinAssetManager(GraphicsDevice, _settings);
            _skinAssetManager.Load <Texture2D>("Button.png");

            Services.AddService(_usedSkin);
            Services.AddService(_skinAssetManager);



            _screenComponent = new ScreenGameComponent(this);
            Components.Add(_screenComponent);
            PlaySongSelectScreen playSongSelectScreen = new PlaySongSelectScreen(this);

            _screenComponent.Register(playSongSelectScreen);
            GameplayScreen gameplayScreen = new GameplayScreen(this);

            _screenComponent.Register(gameplayScreen);
            PauseScreen ps = new PauseScreen(this);

            _screenComponent.Register(ps);

            _graphCanvas.Font = _usedSkin.Font;

            base.LoadContent();

            LogHelper.Log("Game Root: End Load Content");
        }
示例#7
0
 public StartUp(SkinLoader skinLoader)
 {
     _skinLoader = skinLoader;
 }
示例#8
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     SkinLoader.Load(this.Resources);
 }
 public SkinPoolViewModel(SkinLoader skinLoader)
 {
     Items.AddRange(skinLoader.LoadSkins().Select(x => new SkinDetailsViewModel {
         Name = x.Name, Duration = x.Duration, OffsetMonth = x.StartOffset.Month, OffsetDay = x.StartOffset.Day, OffsetHour = x.StartOffset.Hour
     }));
 }
 // Start is called before the first frame update
 void Start()
 {
     skinLoader = transform.root.GetComponent <SkinLoader>();
 }