Пример #1
0
    public RectTransform screenRect;          //螢幕區域

    //---------------------------------------------------------------------------------------------------------------------------------------------

    void Awake()
    {
        if (_instance == null)
        {
            _instance = this;                    //設定單例模式
        }
    }
Пример #2
0
 private void m_strip_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (!e.Handled && this.Strip.IsEnabled)
     {
         if (this.Strip.CanSetPriority)
         {
             StartMenuManager startMenuManager = this.StartMenu.StartMenuManager;
             int num = 2;
             foreach (IMenuStrip current in startMenuManager.Strips)
             {
                 if (current.CanSetPriority)
                 {
                     if (current == this.Strip)
                     {
                         current.Priority = 1;
                     }
                     else
                     {
                         current.Priority = num;
                         num++;
                     }
                 }
             }
             this.StartMenu.UpdateStrips();
         }
         e.Handled = true;
     }
     base.ReleaseMouseCapture();
 }
Пример #3
0
    // Start is called before the first frame update
    void Start()
    {
        //Setup shaking
        lowPassFilterFactor      = accelerometerUpdateInterval / lowPassKernelWidthInSeconds;
        shakeDetectionThreshold *= shakeDetectionThreshold;
        lowPassValue             = Input.acceleration;

        manager = GetComponent <StartMenuManager>();
    }
Пример #4
0
 public VmcStudioApp()
 {
     this.Documents = new ObservableCollection <VmcDocument>();
     this.Documents.CollectionChanged += new NotifyCollectionChangedEventHandler(this.Documents_CollectionChanged);
     this.ThemeManager = new ThemeManager(Path.Combine(VmcStudioUtil.ApplicationDataPath, "Themes"));
     using (MediaCenterLibraryCache centerLibraryCache = new MediaCenterLibraryCache(MediaCenterUtil.MediaCenterPath))
         this.StartMenuManager = StartMenuManager.Create((IResourceLibraryCache)centerLibraryCache);
     Application.Current.Resources.Add((object)"StartMenuManager", (object)this.StartMenuManager);
     this.StartMenuManager.CustomCategory = VmcStudioUtil.ApplicationName;
     this.CommonResources = new CommonResourceManager(this);
 }
Пример #5
0
        private void m_moveDownButton_Click(object sender, RoutedEventArgs e)
        {
            StartMenuManager startMenuManager = this.StartMenu.StartMenuManager;

            if (startMenuManager != null)
            {
                int num = startMenuManager.Strips.IndexOf(this.Strip);
                if (this.CanMoveDown)
                {
                    startMenuManager.Strips.Move(num, num + 1);
                }
            }
        }
Пример #6
0
 public Windows7MenuStrip(StartMenuManager manager, XmlDocument doc, XmlElement startMenuElement, XmlElement startMenuTargetElement, string resourceName)
     : base(manager, doc, startMenuElement, resourceName)
 {
     this.BeginInit();
     this.targetElement = startMenuTargetElement;
     this.QuickLinks.CollectionChanged += new NotifyCollectionChangedEventHandler(this.QuickLinks_CollectionChanged);
     this.UpdateEnabled();
     XmlElement menuCategoryElement = this.GetStartMenuCategoryElement();
     if (menuCategoryElement != null)
     {
         string attribute = menuCategoryElement.GetAttribute("Priority");
         int result;
         if (attribute != null && int.TryParse(attribute, out result))
             this.Priority = result;
     }
     this.EndInit();
 }
Пример #7
0
 // Methods
 static StartMenu()
 {
     StartMenuManagerProperty = DependencyProperty.Register("StartMenuManager", typeof(StartMenuManager), typeof(Advent.VmcStudio.StartMenu.StartMenu), new PropertyMetadata(delegate(DependencyObject sender, DependencyPropertyChangedEventArgs args)
     {
         Advent.VmcStudio.StartMenu.StartMenu menu = (Advent.VmcStudio.StartMenu.StartMenu)sender;
         if (args.OldValue != null)
         {
             StartMenuManager newValue          = (StartMenuManager)args.NewValue;
             newValue.Strips.CollectionChanged -= new NotifyCollectionChangedEventHandler(menu.Strips_CollectionChanged);
         }
         if (args.NewValue != null)
         {
             StartMenuManager manager2          = (StartMenuManager)args.NewValue;
             manager2.Strips.CollectionChanged += new NotifyCollectionChangedEventHandler(menu.Strips_CollectionChanged);
         }
         menu.UpdateStrips();
     }));
 }
Пример #8
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            Services.AddService(typeof(GraphicsDeviceManager), _graphics);

            GameplayManager    gameplayManager    = new GameplayManager(this);
            LevelEditorManager levelEditorManager = new LevelEditorManager(this);
            StartMenuManager   startMenuManager   = new StartMenuManager(this);

            Components.Add(gameplayManager);
            Components.Add(levelEditorManager);
            Components.Add(startMenuManager);

            _managers.Add(GameState.Gameplay, gameplayManager);
            _managers.Add(GameState.LevelEditor, levelEditorManager);
            _managers.Add(GameState.StartMenu, startMenuManager);

            base.Initialize();
        }
Пример #9
0
        public Windows7MenuStrip(StartMenuManager manager, XmlDocument doc, XmlElement startMenuElement, XmlElement startMenuTargetElement, string resourceName)
            : base(manager, doc, startMenuElement, resourceName)
        {
            this.BeginInit();
            this.targetElement = startMenuTargetElement;
            this.QuickLinks.CollectionChanged += new NotifyCollectionChangedEventHandler(this.QuickLinks_CollectionChanged);
            this.UpdateEnabled();
            XmlElement menuCategoryElement = this.GetStartMenuCategoryElement();

            if (menuCategoryElement != null)
            {
                string attribute = menuCategoryElement.GetAttribute("Priority");
                int    result;
                if (attribute != null && int.TryParse(attribute, out result))
                {
                    this.Priority = result;
                }
            }
            this.EndInit();
        }
Пример #10
0
    private void InitMenu(int menu)
    {
        switch (menu)
        {
        case (int)Menu.Start:
            StartMenuManager startManager = menus[menu].GetComponent <StartMenuManager>();
            startManager.ActivateStartScreen();

            PauseObjects();
            break;

        case (int)Menu.Resolution:
            ResolutionMenuManager resolutionManager = menus[menu].GetComponent <ResolutionMenuManager>();
            resolutionManager.ActivateResolutionScreen();

            PauseGame();
            break;

        case (int)Menu.Death:
            DeathMenuManager deathManager = menus[menu].GetComponent <DeathMenuManager>();
            deathManager.ActivateDeathScreen();

            PauseGame();
            break;

        case (int)Menu.Hud:
            OverlayHudManager hudManager = menus[menu].GetComponent <OverlayHudManager>();
            hudManager.ActivateHud();

            ResumeGame();
            break;

        default:
            break;
        }
    }
Пример #11
0
 public FijiPartnerQuickLink(StartMenuManager manager, XmlElement element)
     : this(manager, element, false)
 {
 }
Пример #12
0
 public Windows7PartnerQuickLink(StartMenuManager manager, XmlElement element)
     : base(manager, element)
 {
 }
Пример #13
0
 protected XmlQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm)
 {
     this.XmlElement = element;
 }
Пример #14
0
 public FijiPartnerQuickLink(StartMenuManager manager, XmlElement element, bool removeIfEmpty)
     : base(manager, element)
 {
     this.removeIfEmpty = removeIfEmpty;
 }
Пример #15
0
    // run when scence loaded
    private void OnSceneLoaded(Scene scence, LoadSceneMode mod)
    {
        Timer.Instance.ClearAllTask();
        ShowLine.ClearTheLine();
        ShowLine.ClearTheBlackLine();
        ShowLine.ClearTheChooseLine();

        if (scence.name == "StartMenuScene")
        {
            startMenuManager = GetComponent <StartMenuManager>();
            keyController    = GetComponent <KeyController>();

            InitGame();
            return;
        }
        if (scence.name == "PrologueScene")
        {
            prologueScript = GetComponent <PrologueScript>();
            prologueScript.InitScene();
            return;
        }
        if (scence.name == "Chapter101")
        {
            RewriteDataList("Chapter101", "");
            c101Script = GetComponent <C101Script>();
            c101Script.InitScene();
            return;
        }
        if (scence.name == "Chapter102")
        {
            RewriteDataList("Chapter102", "");
            c102Script = GetComponent <C102Script>();
            c102Script.InitScene();
            return;
        }
        if (scence.name == "Chapter103")
        {
            // get pre data
            UserChooseV1 userChooseV1 = GetCurUserChoosesObj();

            // override data
            if (C102Script.chooseC102_1 != -1)
            {
                userChooseV1.c102_1 = C102Script.chooseC102_1;
            }
            if (C102Script.chooseC102_2 != -1)
            {
                userChooseV1.c102_2 = C102Script.chooseC102_2;
            }

            // save data
            RewriteDataList("Chapter103", JsonUtility.ToJson(userChooseV1));

            c103Script = GetComponent <C103Script>();
            c103Script.InitScene();
            return;
        }
        if (scence.name == "Chapter104")
        {
            // get pre data
            UserChooseV1 userChooseV1 = GetCurUserChoosesObj();

            // override data
            if (C103Script.chooseC103_1 != -1)
            {
                userChooseV1.c103_1 = C103Script.chooseC103_1;
            }
            if (C103Script.chooseC103_2 != -1)
            {
                userChooseV1.c103_2 = C103Script.chooseC103_2;
            }
            if (C103Script.chooseC103_3 != -1)
            {
                userChooseV1.c103_3 = C103Script.chooseC103_3;
            }
            if (C103Script.triggerHideEd != -1)
            {
                userChooseV1.c1_trigger_ed = C103Script.triggerHideEd;
            }

            // save data
            RewriteDataList("Chapter104", JsonUtility.ToJson(userChooseV1));

            c104Script = GetComponent <C104Script>();
            c104Script.InitScene();
            return;
        }
        if (scence.name == "Chapter201")
        {
            // get pre data
            UserChooseV1 userChooseV1 = GetCurUserChoosesObj();

            // override data
            if (C104Script.chooseC104_1 != -1)
            {
                userChooseV1.c104_1 = C104Script.chooseC104_1;
            }
            if (C104Script.chooseC104_2_1 != -1)
            {
                userChooseV1.c104_2_1 = C104Script.chooseC104_2_1;
            }
            if (C104Script.chooseC104_2_2 != -1)
            {
                userChooseV1.c104_2_2 = C104Script.chooseC104_2_2;
            }
            if (C104Script.chooseC104_3 != -1)
            {
                userChooseV1.c104_3 = C104Script.chooseC104_3;
            }

            // save data
            RewriteDataList("Chapter201", JsonUtility.ToJson(userChooseV1));

            AudioManager.instance.FadeStopAudioSource();

            c201Script = GetComponent <C201Script>();
            c201Script.InitScene();
            return;
        }
    }
Пример #16
0
 public Windows7PartnerQuickLink(StartMenuManager manager, XmlElement element)
     : base(manager, element)
 {
 }
Пример #17
0
 public FijiMenuStrip(StartMenuManager manager, XmlDocument doc, XmlElement startMenuElement, string resourceName)
     : base(manager, doc, startMenuElement, resourceName)
 {
     this.QuickLinks.CollectionChanged += new NotifyCollectionChangedEventHandler(this.QuickLinks_CollectionChanged);
     this.UpdateEnabled();
 }
Пример #18
0
 public DefaultMenuStrip(StartMenuManager manager, XmlDocument doc, XmlElement startMenuElement, string resourceName)
     : base(manager, doc, startMenuElement, resourceName)
 {
 }
Пример #19
0
 public FijiMenuStrip(StartMenuManager manager, XmlDocument doc, XmlElement startMenuElement, string resourceName)
     : base(manager, doc, startMenuElement, resourceName)
 {
     this.QuickLinks.CollectionChanged += new NotifyCollectionChangedEventHandler(this.QuickLinks_CollectionChanged);
     this.UpdateEnabled();
 }
Пример #20
0
 public PackageQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
 }
Пример #21
0
 public FavouritePartnerQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
     this.SetValue(XmlQuickLink.ImageProperty, (object)Imaging.CreateBitmapSourceFromHBitmap(Resources.Favourites.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()));
 }
Пример #22
0
 public DefaultPackageQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
 }
Пример #23
0
 public FavouritePartnerQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
     this.SetValue(XmlQuickLink.ImageProperty, (object)Imaging.CreateBitmapSourceFromHBitmap(Resources.Favourites.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()));
 }
Пример #24
0
 public Windows7QuickLinkBase(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
 }
Пример #25
0
 public FijiPartnerQuickLink(StartMenuManager manager, XmlElement element, bool removeIfEmpty)
     : base(manager, element)
 {
     this.removeIfEmpty = removeIfEmpty;
 }
Пример #26
0
 public FijiQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
 }
Пример #27
0
 protected void ApplyThemes(ProgressEnabledOperation operation, bool preserveMenu)
 {
     this.OnApplyingThemes(new ApplyThemesEventArgs(operation));
     try
     {
         MediaCenterLibraryCache readCache          = new MediaCenterLibraryCache(VmcStudioUtil.BackupsPath, UnmanagedLibraryAccess.Read);
         MediaCenterLibraryCache writeCache         = new MediaCenterLibraryCache(MediaCenterUtil.MediaCenterPath, UnmanagedLibraryAccess.Write);
         MemoryLibraryCache      memoryLibraryCache = (MemoryLibraryCache)null;
         if (preserveMenu)
         {
             memoryLibraryCache = new MemoryLibraryCache((ushort)1033);
             using (MediaCenterLibraryCache centerLibraryCache = new MediaCenterLibraryCache())
                 StartMenuManager.Create((IResourceLibraryCache)centerLibraryCache).Save((IResourceLibraryCache)memoryLibraryCache, true);
         }
         readCache.LibraryLoading  += (EventHandler <LibraryLoadEventArgs>)((sender, e) => VmcStudioUtil.BackupFile(Path.Combine(MediaCenterUtil.MediaCenterPath, e.FileName)));
         writeCache.LibraryLoading += (EventHandler <LibraryLoadEventArgs>)((sender, e) =>
         {
             string local_0 = VmcStudioUtil.BackupFile(Path.Combine(MediaCenterUtil.MediaCenterPath, e.FileName));
             string local_1 = Path.Combine(writeCache.SearchPath, e.FileName);
             VmcStudioUtil.TakeOwnership(local_1);
             File.Copy(local_0, local_1, true);
             VmcStudioUtil.TakeOwnership(local_1);
         });
         if (Directory.Exists(VmcStudioUtil.BackupsPath))
         {
             foreach (string path in Directory.GetFiles(VmcStudioUtil.BackupsPath))
             {
                 writeCache.LoadLibrary(Path.GetFileName(path));
             }
         }
         int       num = 0;
         int       operationCompleted  = 0;
         Exception applyException      = (Exception)null;
         List <MediaCenterTheme> list1 = Enumerable.ToList <MediaCenterTheme>(Enumerable.Select <ThemeSummary, MediaCenterTheme>((IEnumerable <ThemeSummary>) this.AppliedThemes, (Func <ThemeSummary, MediaCenterTheme>)(o => o.OpenTheme())));
         try
         {
             List <IDelayedProgressOperation> list2 = new List <IDelayedProgressOperation>();
             foreach (MediaCenterTheme mediaCenterTheme in list1)
             {
                 IDelayedProgressOperation applyOperation = mediaCenterTheme.CreateApplyOperation(readCache, writeCache);
                 num += applyOperation.Count;
                 applyOperation.Progress  += (EventHandler <ProgressEventArgs>)((sender, args) => operation.OnProgress(args.Message, args.CurrentIndex + operationCompleted));
                 applyOperation.Abandoned += (EventHandler <ExceptionEventArgs>)((sender, args) => applyException = args.Exception);
                 list2.Add(applyOperation);
             }
             operation.Count = num;
             using (readCache)
             {
                 using (writeCache)
                 {
                     foreach (IDelayedProgressOperation progressOperation in list2)
                     {
                         operation.Description = progressOperation.Description;
                         progressOperation.Start();
                         progressOperation.WaitForCompletion();
                         if (applyException != null)
                         {
                             throw applyException;
                         }
                         operationCompleted += progressOperation.Count;
                     }
                     if (this.AppliedThemes.Count > 0)
                     {
                         IResource resource = writeCache["ehres.dll"].GetResource("VmcStudio.Themes.xml", (object)23);
                         using (MemoryStream memoryStream = new MemoryStream())
                         {
                             new XmlSerializer(typeof(ThemeManager.AppliedThemesDocument)).Serialize((Stream)memoryStream, (object)new ThemeManager.AppliedThemesDocument()
                             {
                                 AppliedThemes = Enumerable.ToArray <ThemeSummary>((IEnumerable <ThemeSummary>) this.AppliedThemes)
                             });
                             memoryStream.Flush();
                             ResourceExtensions.Update(resource, memoryStream.GetBuffer());
                         }
                     }
                     if (memoryLibraryCache != null)
                     {
                         memoryLibraryCache.ApplyTo((IResourceLibraryCache)writeCache);
                     }
                 }
             }
             this.IsDirty = false;
         }
         finally
         {
             foreach (MediaCenterTheme mediaCenterTheme in list1)
             {
                 mediaCenterTheme.Dispose();
             }
         }
     }
     catch (Exception ex)
     {
         Trace.TraceError(((object)ex).ToString());
         operation.OnAbandoned(ex);
         throw;
     }
     operation.OnCompleted();
 }
Пример #28
0
 public BroadbandPromoQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
     this.SetValue(XmlQuickLink.ImageProperty, (object)BroadbandPromoQuickLink.image);
 }
Пример #29
0
 public void Initialize(StartMenuManager startMenuManager)
 {
     this.startMenuManager = startMenuManager;
 }
Пример #30
0
 public DefaultPartnerQuickLink(StartMenuManager manager, XmlElement element)
     : base(manager, element)
 {
 }
Пример #31
0
 public PartnerQuickLinkBase(StartMenuManager manager, XmlElement element)
     : base(manager, element)
 {
 }
Пример #32
0
    void Start()
    {
        manager = GetComponent<UIManager> ();
        startMenu = GetComponent<StartMenuManager> ();
        worldSelect = GetComponent<WorldSelectManager>();
        levelSelect = GetComponent<LevelSelectManager>();
        inGameUI = GetComponent<InGameUIManager> ();
        pauseMenu = GetComponent<PauseMenuManager> ();
        levelFail = GetComponent<LevelFailManager> ();
        levelSuccess = GetComponent<LevelSuccessManager> ();
        creditMenu = GetComponent<CreditsMenuManager> ();

        SetUIState(UIState.StartMenu);
    }
Пример #33
0
 internal BaseXmlMenuStrip(StartMenuManager smm, XmlElement startMenuElement)
     : base(smm)
 {
     this.startMenuElement = startMenuElement;
 }
Пример #34
0
 public NowPlayingQuickLink(StartMenuManager smm)
 {
     this.startMenuManager = smm;
 }
Пример #35
0
 public FijiPartnerQuickLink(StartMenuManager manager, XmlElement element)
     : this(manager, element, false)
 {
 }
Пример #36
0
 public Windows7PackageQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
 }
Пример #37
0
 public DefaultPartnerQuickLink(StartMenuManager manager, XmlElement element)
     : base(manager, element)
 {
 }
Пример #38
0
 protected MediaCenterAddInInstaller(StartMenuManager startMenuManager)
 {
     this.StartMenuManager = startMenuManager;
 }
Пример #39
0
 // Start is called before the first frame update
 void Start()
 {
     instance = this;
 }
Пример #40
0
 public void SetUpButton(string s, StartMenuManager smm)
 {
     buttonString = s;
     text.text    = buttonString;
     smManager    = smm;
 }
Пример #41
0
 protected MediaCenterAddInInstaller(StartMenuManager startMenuManager)
 {
     this.StartMenuManager = startMenuManager;
 }
Пример #42
0
 public DefaultMenuStrip(StartMenuManager manager, XmlDocument doc, XmlElement startMenuElement, string resourceName)
     : base(manager, doc, startMenuElement, resourceName)
 {
 }
Пример #43
0
 public DefaultQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
 }
Пример #44
0
 public BroadbandPromoQuickLink(StartMenuManager smm, XmlElement element)
     : base(smm, element)
 {
     this.SetValue(XmlQuickLink.ImageProperty, (object)BroadbandPromoQuickLink.image);
 }