public AudioSource GetSource(WindowBase window, ClipType clipType, int id) {
			
			#if UNITY_EDITOR
			if (Application.isPlaying == false) {
				
				return null;
				
			}
			#endif
			
			var key = (window != null) ? (long)window.GetInstanceID() : (long)(((int)clipType << 16) | (id & 0xffff));
			
			AudioSource value;
			if (this.instances.TryGetValue(key, out value) == false) {
				
				value = this.source.Spawn();
				this.instances.Add(key, value);
				
			}

			
			List<AudioSource> valuesByType;
			if (this.instancesByType.TryGetValue(clipType, out valuesByType) == false) {

				this.instancesByType.Add(clipType, new List<AudioSource>() { value });

			} else {

				valuesByType.Add(value);

			}

			return value;
			
		}
		public static void Play(WindowBase window, Source sourceInfo, ClipType clipType, int id) {
			
			var source = sourceInfo.GetSource(window, clipType, id);
			if (source == null) return;

			if (id == 0) {

				// Stop
				Manager.Stop(window, sourceInfo, clipType, id);
				return;

			}

			var state = Manager.currentData.GetState(clipType, id);
			if (state == null) {
				
				Manager.Stop(window, sourceInfo, clipType, id);
				return;

			}

			Manager.Reset(source);

			if (clipType == ClipType.Music) {

				source.clip = state.clip;
				source.Play();

			} else if (clipType == ClipType.SFX) {
				
				source.PlayOneShot(state.clip);

			}

		}
        public static void OnMaterialsColorDragMouseDown(WindowBase sender, UIMouseEventArgs eventArgs)
        {
            try
            {
                CASCompositorController ths = CASCompositorController.sController;

                if ((ths.mCurrentDesignObject != null) && (ths.mMaterialSkewerSelectedPattern != -1))
                {
                    if (eventArgs.MouseKey == MouseKeys.kMouseRight)
                    {
                        bool random = ((eventArgs.Modifiers & (Modifiers.kModifierMaskShift | Modifiers.kModifierMaskControl)) != Modifiers.kModifierMaskNone);

                        ProcessAlterColor(random);

                        if (sender.Enabled)
                        {
                            eventArgs.Handled = true;
                        }
                        return;
                    }
                }

                ths.OnMaterialsColorDragMouseDown(sender, eventArgs);
            }
            catch (Exception e)
            {
                Common.Exception("OnMaterialsColorDragMouseDown", e);
            }
        }
Beispiel #4
0
            private static void OnAcceptHousehold(WindowBase sender, UIButtonClickEventArgs eventArgs)
            {
                try
                {
                    CASPuck ths = CASPuck.Instance;

                    Sims3.UI.Function f = null;
                    if (!ths.mUiBusy && !ths.mAttemptingToAddSim)
                    {
                        ths.mUiBusy = true;
                        if (f == null)
                        {
                            f = delegate
                            {
                                CASController.Singleton.SetCurrentState(CASState.Summary);
                                if (ths.ShowRequiredItemsDialogTask())
                                {
                                    ths.AcceptHouseholdCallback();
                                }
                                else
                                {
                                    ths.mUiBusy = false;
                                }
                            };
                        }
                        Simulator.AddObject(new Sims3.UI.OneShotFunctionTask(f));
                    }
                    eventArgs.Handled = true;
                }
                catch (Exception e)
                {
                    Common.Exception("OnAcceptHousehold", e);
                }
            }
        internal override void Setup(WindowBase window) {

            base.Setup(window);

            for (int i = 0; i < this.subComponents.Count; ++i) this.subComponents[i].Setup(window);

        }
		public long GetKey(WindowBase window, ClipType clipType, int id) {
			
			var key = (long)(((int)clipType << 16) | (id & 0xffff));

			return key;

		}
		public override void OnPlay(WindowBase window, object tag, TransitionInputParameters parameters, WindowComponentBase root, bool forward, System.Action callback) {

			var param = this.GetParams<Parameters>(parameters);
			if (param == null || root == null) {

				if (callback != null) callback();
				return;

			}

			var duration = this.GetDuration(parameters, forward);
			var result = param.GetResult(forward);

			if (TweenerGlobal.instance != null) {

				//TweenerGlobal.instance.removeTweens(tag);
				TweenerGlobal.instance.addTweenAlpha(root.canvas, duration, result).ease(ME.Ease.GetByType(forward == true ? param.inEase : param.outEase)).onComplete((obj) => { if (callback != null) callback(); }).onCancel((obj) => { if (callback != null) callback(); }).tag(tag);

			} else {

				if (root.canvas != null) root.canvas.alpha = result;
				if (callback != null) callback();

			}

		}
		public static void Play(WindowBase window, Source sourceInfo, ClipType clipType, int id, bool replaceOnEquals) {

			if (clipType == ClipType.Music) {

				var currentMusicId = sourceInfo.GetCurrentMusicId();
				if (currentMusicId > 0) {

					var equals = (currentMusicId == id);
					if (equals == false || replaceOnEquals == true) {

						// Stop
						Manager.Stop(window, sourceInfo, clipType, currentMusicId);

					} else if (equals == true) {

						// Don't play anything
						return;

					}

				}

			}

			var source = sourceInfo.GetSource(window, clipType, id);
			if (source == null) return;

			if (id == 0) {

				// Stop
				Manager.Stop(window, sourceInfo, clipType, id);
				return;

			}

			var state = Manager.currentData.GetState(clipType, id);
			if (state == null) {
				
				Manager.Stop(window, sourceInfo, clipType, id);
				return;

			}

			Manager.Reset(source);

			sourceInfo.ApplyVolume(clipType, source);

			if (clipType == ClipType.Music) {

				source.clip = state.clip;
				source.Play();

			} else if (clipType == ClipType.SFX) {
				
				source.PlayOneShot(state.clip);

			}

		}
Beispiel #9
0
        private static Tooltip CreateKnownInfoToolTip(Vector2 mousePosition, WindowBase parent, ref Vector2 tooltipPosition)
        {
            try
            {
                if (Sim.ActiveActor == null) return null;

                NotificationManager manager = NotificationManager.Instance;
                if (manager != null)
                {
                    if ((manager.mNotifications[manager.mCurrentCategory].Count > manager.mCurrentNotification) && (manager.mCurrentNotification >= 0x0))
                    {
                        StyledNotification notice = manager.mNotifications[manager.mCurrentCategory][manager.mCurrentNotification] as StyledNotification;
                        if (notice != null)
                        {
                            if (notice.mNotificationWindow != null)
                            {
                                Sim sim = null;

                                if (notice.mNotificationWindow.GetChildByID(0x5, true) == parent)
                                {
                                    if (notice.mIDOne != ObjectGuid.InvalidObjectGuid)
                                    {
                                        sim = GameObject.GetObject<Sim>(notice.mIDOne);
                                    }
                                }
                                else
                                {
                                    if (notice.mIDTwo != ObjectGuid.InvalidObjectGuid)
                                    {
                                        sim = GameObject.GetObject<Sim>(notice.mIDTwo);
                                    }
                                }

                                if (sim != null)
                                {
                                    IMiniSimDescription tag = sim.SimDescription;
                                    if (tag != null)
                                    {
                                        IHudModel hudModel = Sims3.Gameplay.UI.Responder.Instance.HudModel;

                                        Tooltip result = new KnownInfoTooltip(tag.FullName, hudModel.GetLTRRelationshipString(Sim.ActiveActor.SimDescription, tag), tag.HomeWorld, HudModelEx.GetKnownInfo(hudModel as HudModel, tag));

                                        tooltipPosition = (tooltipPosition - (mousePosition - parent.Position)) + new Vector2(-result.TooltipWindow.Area.Width, parent.Area.Height);

                                        return result;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception("CreateKnownInfoToolTip", e);
            }
            return null;
        }
Beispiel #10
0
    private void Awake()
    {
        if (Window == null)
            Window = transform.parent.GetComponent<WindowBase>();

        if (Window != null)
            GetComponent<Button>().onClick.AddListener(delegate ()
            { WindowManager.Instance.Close(Window); });
    }
		public void SetOutState(List<TransitionInputParameters> parameters, WindowBase window, WindowComponentBase root) {
			
			var i = 0;
			foreach (var transition in this.transitions) {
				
				transition.SetOutState(parameters[i++], window, root);
				
			}

		}
Beispiel #12
0
 public void PresentReplacement(WindowBase replacee, DockStyle dock)
 {
     replacee.Hide();
     Dock = dock;
     Attach(replacee.Parent as WindowBase);
     FormClosed += (s, e) =>
     {
         replacee.Show();
     };
 }
 public static void OnCASClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
 {
     try
     {
         Common.FunctionTask.Perform(GotoCASMode);
     }
     catch (Exception e)
     {
         Common.Exception("OnCASClick", e);
     }
 }
		public static FlowGameViewRenderWindow Show(WindowBase previewScreen) {

			var window = FlowGameViewRenderWindow.CreateInstance<FlowGameViewRenderWindow>();
			window.previewScreen = previewScreen;
			window.ShowPopup();

			window.SetRenderSize(Screen.width, Screen.height, Screen.dpi);

			return window;

		}
Beispiel #15
0
 protected static void OnClickGenealogy(WindowBase sender, UIButtonClickEventArgs eventArgs)
 {
     try
     {
         Common.FunctionTask.Perform(ShowFamilyTreeDialog);
     }
     catch (Exception e)
     {
         Common.Exception("OnClickGenealogy", e);
     }
 }
		private bool CheckMismatch(WindowBase window, List<TransitionInputParameters> parameters) {

			if (this.transitions.Count != parameters.Count) {
				
				Debug.LogError("Animation: Parameters mismatch Transition [Window " + window.gameObject.name + "] ", this);
				return false;
				
			}

			return true;

		}
Beispiel #17
0
        public static void OnSwitchToClick(WindowBase w, UIButtonClickEventArgs eventArgs)
        {
            try
            {
                eventArgs.Handled = true;

                Common.FunctionTask.Perform(SwitchToClick);
            }
            catch (Exception e)
            {
                Common.Exception("OnSwitchToClick", e);
            }
        }
Beispiel #18
0
        public void Attach(WindowBase parent)
        {
            ResizeRedraw = true;
            TopLevel = false;
            parent.Controls.Add(this);
            Parent = parent;
            PerformLayout();
            //Animate();

            (this as Control).Show();
            (this as Control).BringToFront();
            (this as Control).Parent.Invalidate(ShadeRect(Theme.ShadowSize), false);
        }
 public static void OnRandomizeNameClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
 {
     try
     {
         CASRequiredItemsDialog dialog = CASRequiredItemsDialog.sDialog;
         if (dialog != null)
         {
             dialog.OnRandomizeNameClick(sender, eventArgs);
         }
     }
     catch (Exception e)
     {
         Common.Exception("OnRandomizeNameClick", e);
     }
 }
		public void SetInState(List<TransitionInputParameters> parameters, WindowBase window, WindowComponentBase root) {
			
			if (this.CheckMismatch(window, parameters) == false) {

				return;
				
			}

			var i = 0;
			foreach (var transition in this.transitions) {
				
				transition.SetInState(parameters[i++], window, root);
				
			}

		}
 private void OnLotTypeClickEx(WindowBase sender, UIButtonClickEventArgs eventArgs)
 {
     try
     {
         eventArgs.Handled = true;
         PopulateComboBox(sender.ID == 2, bIsHouseboatLot);
     }
     catch (ResetException)
     {
         throw;
     }
     catch (Exception e)
     {
         Common.Exception("OnLotTypeClick", e);
     }
 }
Beispiel #22
0
        public static void OnCloseClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
        {
            try
            {
                CASPuck ths = CASPuck.gSingleton;
                if (ths == null) return;

                //Common.DebugNotify(delegate { return "UiBusy: " + ths.mUiBusy + Common.NewLine + "LeaveCAS: " + ths.mLeaveCAS; });

                //if (!ths.UiBusy && !ths.mLeaveCAS)
                {
                    ths.UiBusy = true;
                    Simulator.AddObject(new Sims3.UI.OneShotFunctionTask(delegate
                    {
                        string entryKey = (Responder.Instance.CASModel.CASMode == CASMode.Full) ? "Ui/Caption/CAS/ExitDialog:Prompt" : "Ui/Caption/CAS/ExitDialog:AlternatePrompt";
                        if (TwoButtonDialog.Show(Common.LocalizeEAString(entryKey), Common.LocalizeEAString("Ui/Caption/Global:Yes"), Common.LocalizeEAString("Ui/Caption/Global:No")))
                        {
                            CASController singleton = CASController.Singleton;
                            singleton.AllowCameraMovement(false);

                            ICASModel cASModel = Responder.Instance.CASModel;
                            while (cASModel.IsProcessing())
                            {
                                SpeedTrap.Sleep();
                            }

                            Sims.CASBase.sWasCanceled = true;

                            sender.Enabled = false;
                            cASModel.RequestClearChangeReport();
                            singleton.SetCurrentState(CASState.None);
                        }
                        else
                        {
                            ths.UiBusy = false;
                        }
                    }));
                    eventArgs.Handled = true;
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnCloseClick", e);
            }
        }
		public static void Change(WindowBase window, Source sourceInfo, ClipType clipType, int id, Audio.Window audioSettings) {

			var source = sourceInfo.GetSource(window, clipType, id);
			if (source == null) return;
			
			source.bypassEffects = audioSettings.bypassEffect;
			source.bypassListenerEffects = audioSettings.bypassListenerEffect;
			source.bypassReverbZones = audioSettings.bypassReverbEffect;
			source.loop = audioSettings.loop;
			
			source.priority = audioSettings.priority;
			source.volume = audioSettings.volume;
			source.pitch = audioSettings.pitch;
			source.panStereo = audioSettings.panStereo;
			source.spatialBlend = audioSettings.spatialBlend;
			source.reverbZoneMix = audioSettings.reverbZoneMix;

		}
Beispiel #24
0
        public static void OnOpacitySliderMouseUp(WindowBase sender, UIMouseEventArgs args)
        {
            try
            {
                CASMakeup ths = CASMakeup.gSingleton;
                if (ths == null) return;

                Slider slider = sender as Slider;
                if (slider != null)
                {
                    CASPart part = (CASPart)ths.mGridMakeupParts.SelectedTag;

                    ths.SetMakeupOpacity(part, ((float)slider.Value) / ((float)slider.MaxValue), true);
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnOpacitySliderMouseUp", e);
            }
        }
        public static void OnNameTextEditChange(WindowBase sender, UITextChangeEventArgs eventArgs)
        {
            try
            {
                CASRequiredItemsDialog dialog = CASRequiredItemsDialog.sDialog;
                if (dialog != null)
                {
                    dialog.OnNameTextEditChange(sender, eventArgs);
                }

                ICASModel cASModel = Responder.Instance.CASModel;
                if (cASModel != null)
                {
                    CASBase.ChangeName(cASModel.FirstName, cASModel.LastName);
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnNameTextEditChange", e);
            }
        }
		public List<AudioSource> GetSources(WindowBase window, ClipType clipType) {
			
			#if UNITY_EDITOR
			if (Application.isPlaying == false) {
				
				return null;
				
			}
			#endif

			List<AudioSource> valuesByType;
			if (this.instancesByType.TryGetValue(clipType, out valuesByType) == false) {
				
				return null;
				
			} else {
				
				return valuesByType;
				
			}

		}
        public static void OnMaterialsColorGridMouseUp(WindowBase sender, UIMouseEventArgs eventArgs)
        {
            try
            {
                CASCompositorController ths = CASCompositorController.sController;

                // Custom
                if ((eventArgs.MouseKey == MouseKeys.kMouseLeft) || (eventArgs.MouseKey == MouseKeys.kMouseRight))
                {
                    UIManager.ReleaseCapture(InputContext.kICMouse, sender);
                    ths.ClearClickEvent();
                }
                else if (sender.Enabled)
                {
                    eventArgs.Handled = true;
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnMaterialsColorGridMouseUp", e);
            }
        }
Beispiel #28
0
        public static void OnMenuButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
        {
            try
            {
                PlayFlowMenuPanel playFlow = PlayFlowMenuPanel.gSingleton;

                if (sender == playFlow.mCASButton)
                {
                    (playFlow.Model as PlayFlowModel).mSelectedBinContentId = ulong.MaxValue;

                    Sims.Advanced.EditInCAS.Perform((SimDescription)null, OnGetMode);
                }
                else
                {
                    playFlow.OnMenuButtonClick(sender, eventArgs);
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnMenuButtonClick", e);
            }
        }
        public static void OnOutfitButtonMouseDown(WindowBase sender, UIMouseEventArgs eventArgs)
        {
            try
            {
                CASDresserClothing dresser = CASDresserClothing.gSingleton;
                if (dresser == null) return;

                if (eventArgs.MouseKey == MouseKeys.kMouseRight)
                {
                    Task.Perform();
                }
                else
                {
                    dresser.OnOutfitButtonClick(sender, new UIButtonClickEventArgs());
                }

                eventArgs.Handled = true;
            }
            catch (Exception e)
            {
                Common.Exception("OnOutfitButtonMouseDown", e);
            }
        }
Beispiel #30
0
        public static void OnOptionsMouseUp(WindowBase sender, UIMouseEventArgs args)
        {
            try
            {
                CASPuck ths = CASPuck.gSingleton;
                if (ths == null) return;

                if (!ths.UiBusy)
                {
                    if (args.MouseKey == MouseKeys.kMouseRight)
                    {
                        MenuTask.Perform();
                    }
                    else
                    {
                        ths.ShowOptionsMenu();
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception("OnOptionsButtonMouseUp", e);
            }
        }
Beispiel #31
0
 private void OnOkayButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
 {
     this.mResult      = this.mSelectedSims;
     eventArgs.Handled = true;
     this.EndDialog(0u);
 }
Beispiel #32
0
    public void openWindow(string windowName, CallBack <WindowBase> onWindowAwake, bool isDialog, bool closeOld, bool hideOld)
    {
        WindowBase oldWindow = null;

        if (!isDialog && windowStack.Count > 0)
        {
            while (windowStack.Count > 0)
            {
                oldWindow = windowStack.Peek();
                if (oldWindow.IsDestoryed)
                {
                    windowStack.Pop();
                }
                else
                {
                    break;
                }
            }
        }

        //主窗口特别处理
        if (windowName == typeof(MainWindow).Name)
        {
            MainWindow mainWindow = null;
            foreach (WindowBase w in windowStack)
            {
                if (mainWindow == null && w is MainWindow && !w.IsDestoryed)
                {
                    mainWindow = w as MainWindow;
                }
                else if (!w.IsDestoryed)
                {
                    w.destoryWindow();
                }
            }
            windowStack.Clear();

            if (mainWindow != null)
            {
                windowStack.Push(mainWindow);
                mainWindow.restoreWindow();
                if (onWindowAwake != null)
                {
                    onWindowAwake(mainWindow as WindowBase);
                }
                return;
            }
        }


        string perfabName = windowName;

        perfabName = perfabName.Substring(0, 1).ToLower() + perfabName.Substring(1);

        if (ResourcesManager.Instance.allowLoadFromRes)
        {
            GameManager.Instance.StartCoroutine(Utils.DelayRun(
                                                    () =>
            {
                passObj tmp = MonoBase.CreateNGUIObj("UI/" + perfabName);
                OnWindowLoaded(windowName, tmp, onWindowAwake, isDialog);

                dealWithOldWindow(oldWindow, closeOld, hideOld);
            }, 0.1f));
        }
        else
        {
            ResourcesManager.Instance.cacheData("UI/" + perfabName, (List <ResourcesData> cacheList) =>
            {
                passObj tmp = MonoBase.CreateNGUIObj("UI/" + perfabName);
//				tmp.data.ResourcesBundle.Unload(false);
                OnWindowLoaded(windowName, tmp, onWindowAwake, isDialog);
                dealWithOldWindow(oldWindow, closeOld, hideOld);
            }, "ui");
        }
    }
Beispiel #33
0
            protected override bool OnPerform()
            {
                Common.StringBuilder msg = new Common.StringBuilder("EditTownCASTask" + Common.NewLine);

                try
                {
                    {
                        EditTownLibraryPanel panel = EditTownLibraryPanel.Instance;
                        if ((panel != null) && (panel.mCASButton != null))
                        {
                            panel.mCASButton.Click -= panel.OnCASClick;

                            panel.mCASButton.Click -= EditTownLibraryPanelEx.OnCASClick;
                            panel.mCASButton.Click += EditTownLibraryPanelEx.OnCASClick;
                        }
                    }

                    msg += "A";

                    {
                        PlayFlowMenuPanel playFlow = PlayFlowMenuPanel.gSingleton;
                        if ((playFlow != null) && (playFlow.mCASButton != null))
                        {
                            playFlow.mCASButton.Click -= playFlow.OnMenuButtonClick;

                            playFlow.mCASButton.Click -= PlayFlowMenuPanelEx.OnMenuButtonClick;
                            playFlow.mCASButton.Click += PlayFlowMenuPanelEx.OnMenuButtonClick;
                        }
                    }

                    msg += "C";

                    {
                        CASClothingCategory category = CASClothingCategory.gSingleton;
                        if (category != null)
                        {
                            category.mTopsButton.Click         -= category.OnCategoryButtonClick;
                            category.mBottomsButton.Click      -= category.OnCategoryButtonClick;
                            category.mShoesButton.Click        -= category.OnCategoryButtonClick;
                            category.mOutfitsButton.Click      -= category.OnCategoryButtonClick;
                            category.mAccessoriesButton.Click  -= category.OnCategoryButtonClick;
                            category.mHorseBridlesButton.Click -= category.OnCategoryButtonClick;
                            category.mHorseSaddleButton.Click  -= category.OnCategoryButtonClick;

                            category.mTopsButton.MouseDown         -= CASClothingCategoryEx.OnButtonMouseDown;
                            category.mTopsButton.MouseDown         += CASClothingCategoryEx.OnButtonMouseDown;
                            category.mBottomsButton.MouseDown      -= CASClothingCategoryEx.OnButtonMouseDown;
                            category.mBottomsButton.MouseDown      += CASClothingCategoryEx.OnButtonMouseDown;
                            category.mShoesButton.MouseDown        -= CASClothingCategoryEx.OnButtonMouseDown;
                            category.mShoesButton.MouseDown        += CASClothingCategoryEx.OnButtonMouseDown;
                            category.mOutfitsButton.MouseDown      -= CASClothingCategoryEx.OnButtonMouseDown;
                            category.mOutfitsButton.MouseDown      += CASClothingCategoryEx.OnButtonMouseDown;
                            category.mAccessoriesButton.MouseDown  -= CASClothingCategoryEx.OnButtonMouseDown;
                            category.mAccessoriesButton.MouseDown  += CASClothingCategoryEx.OnButtonMouseDown;
                            category.mHorseBridlesButton.MouseDown -= CASClothingCategoryEx.OnButtonMouseDown;
                            category.mHorseBridlesButton.MouseDown += CASClothingCategoryEx.OnButtonMouseDown;
                            category.mHorseSaddleButton.MouseDown  -= CASClothingCategoryEx.OnButtonMouseDown;
                            category.mHorseSaddleButton.MouseDown  += CASClothingCategoryEx.OnButtonMouseDown;
                        }
                    }

                    msg += "D";

                    CASPuck puck = CASPuck.gSingleton;
                    if (puck != null)
                    {
                        CASFamilyScreen familyScreen = CASFamilyScreen.gSingleton;
                        if (familyScreen != null)
                        {
                            Window topLevel = familyScreen.mFamilyTopLevelWin;

                            uint       index = 0;
                            WindowBase child = topLevel.GetChildByIndex(index);
                            while (child != null)
                            {
                                CAFThumb thumb = child as CAFThumb;
                                if (thumb != null)
                                {
                                    thumb.DragDrop -= familyScreen.OnCAFThumbDragDrop;
                                    thumb.DragDrop -= CASFamilyScreenEx.OnCAFThumbDragDrop;
                                    thumb.DragDrop += CASFamilyScreenEx.OnCAFThumbDragDrop;
                                }

                                index++;
                                child = topLevel.GetChildByIndex(index);
                            }
                        }

                        if (puck.mGeneticsButton != null)
                        {
                            puck.mGeneticsButton.Enabled = CASPuckEx.CanCreateChild();
                        }

                        ICASModel cASModel = Responder.Instance.CASModel;
                        if (cASModel != null)
                        {
                            if ((MasterController.Settings.mAllowOverStuffed) && (cASModel.NumInHousehold < CASPuck.kMaxPerHousehold))
                            {
                                if (puck.mCreateHorseButton != null)
                                {
                                    puck.mCreateHorseButton.Enabled = true;

                                    puck.mCreateHorseButton.Click -= puck.OnCreateSimClick;
                                    puck.mCreateHorseButton.Click -= CASPuckEx.OnCreateSimClick;
                                    puck.mCreateHorseButton.Click += CASPuckEx.OnCreateSimClick;
                                }

                                if (puck.mCreateDogButton != null)
                                {
                                    puck.mCreateDogButton.Enabled = true;

                                    puck.mCreateDogButton.Click -= puck.OnCreateSimClick;
                                    puck.mCreateDogButton.Click -= CASPuckEx.OnCreateSimClick;
                                    puck.mCreateDogButton.Click += CASPuckEx.OnCreateSimClick;
                                }

                                if (puck.mCreateCatButton != null)
                                {
                                    puck.mCreateCatButton.Enabled = true;

                                    puck.mCreateCatButton.Click -= puck.OnCreateSimClick;
                                    puck.mCreateCatButton.Click -= CASPuckEx.OnCreateSimClick;
                                    puck.mCreateCatButton.Click += CASPuckEx.OnCreateSimClick;
                                }

                                if (puck.mCreateSimButton != null)
                                {
                                    puck.mCreateSimButton.Enabled = true;

                                    puck.mCreateSimButton.Click -= puck.OnCreateSimClick;
                                    puck.mCreateSimButton.Click -= CASPuckEx.OnCreateSimClick;
                                    puck.mCreateSimButton.Click += CASPuckEx.OnCreateSimClick;
                                }
                            }

                            cASModel.OnSimUpdated -= puck.OnSimUpdated;
                            cASModel.OnSimUpdated -= CASPuckEx.OnSimUpdated;
                            cASModel.OnSimUpdated += CASPuckEx.OnSimUpdated;

                            cASModel.OnSimPreviewChange -= puck.OnSimPreviewChange;
                            cASModel.OnSimPreviewChange -= CASPuckEx.OnSimPreviewChange;
                            cASModel.OnSimPreviewChange += CASPuckEx.OnSimPreviewChange;
                        }
                    }

                    msg += "E";

                    CASCompositorController controller = CASCompositorController.sController;
                    if (controller != null)
                    {
                        if (controller.mColorsDragButton != null)
                        {
                            controller.mColorsDragButton.MouseDown -= controller.OnMaterialsColorDragMouseDown;
                            controller.mColorsDragButton.MouseDown -= CASCompositorControllerEx.OnMaterialsColorDragMouseDown;
                            controller.mColorsDragButton.MouseDown += CASCompositorControllerEx.OnMaterialsColorDragMouseDown;

                            controller.mColorsDragButton.MouseUp -= controller.OnMaterialsColorDragMouseUp;
                            controller.mColorsDragButton.MouseUp -= CASCompositorControllerEx.OnMaterialsColorDragMouseUp;
                            controller.mColorsDragButton.MouseUp += CASCompositorControllerEx.OnMaterialsColorDragMouseUp;

                            for (uint j = 0x0; j < 0x4; j++)
                            {
                                controller.mColorsPopupButton[j].MouseDown -= controller.OnMaterialsColorGridMouseDown;
                                controller.mColorsPopupButton[j].MouseDown -= CASCompositorControllerEx.OnMaterialsColorGridMouseDown;
                                controller.mColorsPopupButton[j].MouseDown += CASCompositorControllerEx.OnMaterialsColorGridMouseDown;

                                controller.mColorsPopupButton[j].MouseUp -= controller.OnMaterialsColorGridMouseUp;
                                controller.mColorsPopupButton[j].MouseUp -= CASCompositorControllerEx.OnMaterialsColorGridMouseUp;
                                controller.mColorsPopupButton[j].MouseUp += CASCompositorControllerEx.OnMaterialsColorGridMouseUp;
                            }
                        }

                        if (controller.mMaterialsSkewerPatternButton.Length == 4)
                        {
                            for (int i = 0; i < 4; i++)
                            {
                                if (controller.mMaterialsSkewerPatternButton[i] == null)
                                {
                                    continue;
                                }

                                controller.mMaterialsSkewerPatternButton[i].MouseDown -= controller.OnMaterialsSkewerGridMouseDown;

                                controller.mMaterialsSkewerPatternButton[i].MouseDown -= CASCompositorControllerEx.OnMaterialsSkewerGridMouseDown;
                                controller.mMaterialsSkewerPatternButton[i].MouseDown += CASCompositorControllerEx.OnMaterialsSkewerGridMouseDown;

                                controller.mMaterialsSkewerPatternButton[i].MouseUp -= controller.OnMaterialsSkewerGridMouseUp;

                                controller.mMaterialsSkewerPatternButton[i].MouseUp -= CASCompositorControllerEx.OnMaterialsSkewerGridMouseUp;
                                controller.mMaterialsSkewerPatternButton[i].MouseUp += CASCompositorControllerEx.OnMaterialsSkewerGridMouseUp;
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Common.Exception(msg, e);
                }
                return(true);
            }
Beispiel #34
0
        public void Play(ME.Tweener.MultiTag tag, WindowAnimationBase transitionBase, WindowBase window, TransitionInputParameters parameters, WindowComponentBase root, bool forward, System.Action callback)
        {
            var delay = this.GetDelay(parameters, forward);

            if (delay > 0f && TweenerGlobal.instance != null)
            {
                TweenerGlobal.instance.addTween(this, delay, 0f, 0f).tag(tag).onComplete(() => {
                    this.OnPlay(window, tag, parameters, root, forward, callback);
                }).onCancel((obj) => {
                    if (callback != null)
                    {
                        callback();
                    }
                });
            }
            else
            {
                this.OnPlay(window, tag, parameters, root, forward, callback);
            }
        }
Beispiel #35
0
 public virtual void OnRenderTransition(WindowBase window, RenderTexture source, RenderTexture destination)
 {
 }
 public void SetWindowOwner(WindowBase owner)
 {
     this.Owner = owner;
 }
Beispiel #37
0
 public Separator(WindowBase window, int width, int height, int padding) :
     base(window, 0, 0, width, height)
 {
     Padding = padding;
 }
 public void Initialize(List <FestivalWish> wishs, CallBack callback, WindowBase wb)
 {
     this.festivalWishs = wishs;
     this.wishUpdate    = callback;
     this.fatherwindow  = wb;
 }
Beispiel #39
0
 /* methods */
 /***/
 public void init(WindowBase fatherWindow, Mounts mounts)
 {
     this.fatherWindow = fatherWindow;
     this.mounts       = mounts;
     UpdateUI();
 }
 public static int ScreenWidth(this WindowBase window)
 {
     return(window.CurrentScreen().Bounds.Width);
 }
 public static int ScreenHeight(this WindowBase window)
 {
     return(window.CurrentScreen().Bounds.Height);
 }
 public void SetScreen(WindowBase screen)
 {
     this.screen = screen;
 }
Beispiel #43
0
 private void OnCloseButtonClick(WindowBase sender, UIButtonClickEventArgs eventArgs)
 {
     this.mResult      = null;
     eventArgs.Handled = true;
     this.EndDialog(0u);
 }
 private WindowLayoutRoot GetRoot(Parameters parameters, WindowBase window)
 {
     return((window as LayoutWindowType).layout.GetLayoutInstance().root);
 }
 public RecuperationInformationFacade(WindowBase windowBase)
     : base("RecuperationInformationWCF", "SystemManage", windowBase)
 {
 }
Beispiel #46
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="role">卡片</param>
 public void Initialize(WindowBase parent, Card role)
 {
     this.parent = parent;
     this.card   = role;
     loadShow();
 }
Beispiel #47
0
 public virtual bool IsValid(WindowBase window)
 {
     return(false);
 }
Beispiel #48
0
        private Panel BuildComposerPanel(WindowBase wndw)
        {
            var cPanel = new Panel()
            {
                CanScroll = false,
                Size      = wndw.ContentRegion.Size
            };
            var backButton = new BackButton(wndw)
            {
                Text     = "Musician",
                NavTitle = "Composer",
                Parent   = cPanel,
                Location = new Point(20, 20),
            };
            var composerPanel = new Panel()
            {
                Location  = new Point(MusicianModule.LEFT_MARGIN + 20, MusicianModule.BOTTOM_MARGIN + backButton.Bottom),
                Size      = new Point(cPanel.Size.X - 50 - MusicianModule.LEFT_MARGIN, cPanel.Size.Y - 50 - MusicianModule.BOTTOM_MARGIN),
                Parent    = cPanel,
                CanScroll = false
            };
            var titleTextBox = new TextBox
            {
                Size            = new Point(150, 20),
                Location        = new Point(0, 20),
                PlaceholderText = "Title",
                Parent          = composerPanel
            };
            var titleArtistLabel = new Label
            {
                Size     = new Point(20, 20),
                Location = new Point(titleTextBox.Left + titleTextBox.Width + 20, titleTextBox.Top),
                Text     = " - ",
                Parent   = composerPanel
            };
            var artistTextBox = new TextBox
            {
                Size            = new Point(150, 20),
                Location        = new Point(titleArtistLabel.Left + titleArtistLabel.Width + 20, titleArtistLabel.Top),
                PlaceholderText = "Artist",
                Parent          = composerPanel
            };
            var userLabel = new Label
            {
                Size     = new Point(150, 20),
                Location = new Point(0, titleTextBox.Top + 20 + MusicianModule.BOTTOM_MARGIN),
                Text     = "Created by",
                Parent   = composerPanel
            };

            var userTextBox = new TextBox
            {
                Size            = new Point(150, 20),
                Location        = new Point(titleArtistLabel.Left + titleArtistLabel.Width + 20, userLabel.Top),
                PlaceholderText = "User (Nekres.1038)",
                Parent          = composerPanel
            };
            var ddInstrumentSelection = new Dropdown()
            {
                Parent   = composerPanel,
                Location = new Point(0, userTextBox.Top + 20 + MusicianModule.BOTTOM_MARGIN),
                Width    = 150,
            };

            foreach (string item in Instruments)
            {
                ddInstrumentSelection.Items.Add(item);
            }
            var ddAlgorithmSelection = new Dropdown()
            {
                Parent   = composerPanel,
                Location = new Point(titleArtistLabel.Left + titleArtistLabel.Width + 20, ddInstrumentSelection.Top),
                Width    = 150,
            };

            ddAlgorithmSelection.Items.Add("Favor Notes");
            ddAlgorithmSelection.Items.Add("Favor Chords");
            var tempoLabel = new Label()
            {
                Parent   = composerPanel,
                Location = new Point(0, ddInstrumentSelection.Top + 22 + MusicianModule.BOTTOM_MARGIN),
                Size     = new Point(150, 20),
                Text     = "Beats per minute:"
            };
            var tempoCounterBox = new CounterBox()
            {
                Parent     = composerPanel,
                Location   = new Point(titleArtistLabel.Left + titleArtistLabel.Width + 20, tempoLabel.Top),
                ValueWidth = 50,
                MaxValue   = 200,
                MinValue   = 40,
                Numerator  = 5,
                Value      = 90
            };
            var meterLabel = new Label()
            {
                Parent   = composerPanel,
                Location = new Point(0, tempoLabel.Top + 22 + MusicianModule.BOTTOM_MARGIN),
                Size     = new Point(150, 20),
                Text     = "Notes per beat:"
            };
            var meterCounterBox = new CounterBox()
            {
                Parent      = composerPanel,
                Location    = new Point(titleArtistLabel.Left + titleArtistLabel.Width + 20, meterLabel.Top),
                ValueWidth  = 50,
                MaxValue    = 16,
                MinValue    = 1,
                Prefix      = @"1\",
                Exponential = true,
                Value       = 1
            };

            // TODO: Draw notation multilined.
            var notationTextBox = new Label
            {
                Size     = new Point(composerPanel.Width, composerPanel.Height - 300),
                Location = new Point(0, meterCounterBox.Top + 22 + MusicianModule.BOTTOM_MARGIN),
                Parent   = composerPanel
            };

            var saveBttn = new StandardButton()
            {
                Text     = "Save",
                Location = new Point(composerPanel.Width - 128 - MusicianModule.RIGHT_MARGIN, notationTextBox.Bottom + 5),
                Width    = 128,
                Height   = 26,
                Parent   = composerPanel
            };

            saveBttn.LeftMouseButtonReleased   += (sender, args) => {
                // TODO: Save the notation as XML locally.
            };
            backButton.LeftMouseButtonReleased += (object sender, MouseEventArgs e) => { wndw.NavigateHome(); };
            return(cPanel);
        }
Beispiel #49
0
 public virtual void OnPlay(WindowBase window, object tag, TransitionInputParameters parameters, WindowComponentBase root, bool forward, System.Action callback)
 {
 }
Beispiel #50
0
        private Panel BuildLibraryPanel(WindowBase wndw)
        {
            var lPanel = new Panel()
            {
                CanScroll = false,
                Size      = wndw.ContentRegion.Size
            };
            var backButton = new BackButton(wndw)
            {
                Text     = "Musician",
                NavTitle = "Library",
                Parent   = lPanel,
                Location = new Point(20, 20),
            };
            var melodyPanel = new Panel()
            {
                Location   = new Point(0, MusicianModule.BOTTOM_MARGIN + backButton.Bottom),
                Size       = new Point(lPanel.Width, lPanel.Size.Y - 50 - MusicianModule.BOTTOM_MARGIN),
                Parent     = lPanel,
                ShowTint   = true,
                ShowBorder = true,
                CanScroll  = true
            };

            // TODO: Load a list from online database.
            foreach (RawMusicSheet sheet in Sheets)
            {
                var melody = new SheetButton
                {
                    Parent     = melodyPanel,
                    Icon       = ContentsManager.GetTexture(@"instruments\" + sheet.Instrument.ToLowerInvariant() + ".png"),
                    IconSize   = DetailsIconSize.Small,
                    Artist     = sheet.Artist,
                    Title      = sheet.Title,
                    User       = sheet.User,
                    MusicSheet = sheet
                };
                displayedSheets.Add(melody);
                melody.LeftMouseButtonPressed += delegate
                {
                    if (melody.MouseOverPlay)
                    {
                        this.StopPlayback();
                        GameService.Overlay.BlishHudWindow.Hide();
                        MusicPlayer = MusicPlayerFactory.Create(
                            melody.MusicSheet,
                            InstrumentMode.Preview
                            );
                        MusicPlayer.Worker.Start();
                        Conveyor.Visible   = true;
                        StopButton.Visible = true;
                    }
                    if (melody.MouseOverEmulate)
                    {
                        this.StopPlayback();
                        GameService.Overlay.BlishHudWindow.Hide();
                        MusicPlayer = MusicPlayerFactory.Create(
                            melody.MusicSheet,
                            InstrumentMode.Emulate
                            );
                        MusicPlayer.Worker.Start();
                        StopButton.Visible = true;
                    }
                    if (melody.MouseOverPreview)
                    {
                        if (melody.IsPreviewing)
                        {
                            this.StopPlayback();
                        }
                        else
                        {
                            this.StopPlayback();
                            melody.IsPreviewing = true;
                            MusicPlayer         = MusicPlayerFactory.Create(
                                melody.MusicSheet,
                                InstrumentMode.Preview
                                );
                            MusicPlayer.Worker.Start();
                        }
                    }
                };
            }
            var ddSortMethod = new Dropdown()
            {
                Parent   = lPanel,
                Visible  = melodyPanel.Visible,
                Location = new Point(lPanel.Right - 150 - 10, 5),
                Width    = 150
            };

            ddSortMethod.Items.Add(DD_TITLE);
            ddSortMethod.Items.Add(DD_ARTIST);
            ddSortMethod.Items.Add(DD_USER);
            ddSortMethod.Items.Add("------------------");
            ddSortMethod.Items.Add(DD_HARP);
            ddSortMethod.Items.Add(DD_FLUTE);
            ddSortMethod.Items.Add(DD_LUTE);
            ddSortMethod.Items.Add(DD_HORN);
            ddSortMethod.Items.Add(DD_BASS);
            ddSortMethod.Items.Add(DD_BELL);
            ddSortMethod.Items.Add(DD_BELL2);
            ddSortMethod.ValueChanged += UpdateSort;
            ddSortMethod.SelectedItem  = DD_TITLE;

            UpdateSort(ddSortMethod, EventArgs.Empty);
            backButton.LeftMouseButtonReleased += (object sender, MouseEventArgs e) => { wndw.NavigateHome(); };

            return(lPanel);
        }
Beispiel #51
0
 public virtual void Set(WindowBase window, TransitionInputParameters parameters, WindowComponentBase root, bool forward, float value)
 {
 }
Beispiel #52
0
    public void initInfo(PvpOppInfo opp, WindowBase fawin)
    {
        if (playerName != null)
        {
            playerName.text = opp.name;
        }

        if (level != null)
        {
            level.text = "Lv." + EXPSampleManager.Instance.getLevel(EXPSampleManager.SID_USER_EXP, opp.exp, 0);
        }
        if (combat != null)
        {
            if (fawin.name == "PvpPlayerWindow")
            {
                combat.text = opp.combat.ToString();
                if (combatBg != null)
                {
                    combatBg.spriteName = "mainCombat";
                }
            }
            else if (fawin.name == "MassPlayerWindow")
            {
                combat.text = opp.allCombat.ToString();
                if (combatBg != null)
                {
                    combatBg.spriteName = "allCombat";
                }
            }
            else
            {
                combat.text = LanguageConfigManager.Instance.getLanguage("sl0369") + opp.combat.ToString();
                if (combatBg != null)
                {
                    combatBg.spriteName = "power";
                }
            }
        }
        if (opp.sdkInfo != null)
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(opp.sdkInfo.face, headIcon);
        }
        else
        {
            ResourcesManager.Instance.LoadAssetBundleTexture(UserManager.Instance.getIconPath(opp.headIcon), headIcon);
        }

        if (starLabel != null)
        {
            starLabel.text = HoroscopesManager.Instance.getStarByType(opp.star).getName();
        }
        if (starIco != null)
        {
            starIco.spriteName = HoroscopesManager.Instance.getStarByType(opp.star).getSpriteName();
        }

        if (StringKit.toInt(level.text.Split('.') [1]) == 0)
        {
            if (expbar != null)
            {
                expbar.updateValue(opp.exp, 0);
            }
            if (expLabel != null)
            {
                expLabel.text = "0/0";
            }
        }
        else
        {
            int  tempLevel = StringKit.toInt(level.text.Split('.') [1]);
            long expDown   = EXPSampleManager.Instance.getEXPDown(EXPSampleManager.SID_USER_EXP, tempLevel);
            long expUp     = EXPSampleManager.Instance.getEXPUp(EXPSampleManager.SID_USER_EXP, tempLevel);
            if (expLabel != null)
            {
                expLabel.text = (opp.exp - expDown) + "/" + (expUp - expDown);
            }
            if (expbar != null)
            {
                expbar.updateValue(opp.exp - expDown, expUp - expDown);
            }
        }
        if (vipIco != null)
        {
            if (opp.vipLv > 0)
            {
                vipIco.spriteName = "vip" + opp.vipLv;
                vipIco.gameObject.SetActive(true);
            }
            else
            {
                vipIco.gameObject.SetActive(false);
            }
        }

        if (opp.beastSid != 0)
        {
            CardSample cs = CardSampleManager.Instance.getRoleSampleBySid(opp.beastSid);
//			ResourcesManager.Instance.LoadAssetBundleTexture (ResourcesManager.NVSHENHEADPATH + cs.imageID + "_head", beast);
            if (noBeast != null)
            {
                noBeast.gameObject.SetActive(false);
            }
            beast.gameObject.SetActive(true);
            if (CommandConfigManager.Instance.getNvShenClothType() == 0)
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + cs.imageID + "c", beast);
            }
            else
            {
                ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.CARDIMAGEPATH + cs.imageID, beast);
            }
            if (beastLv != null)
            {
                beastLv.text = "Lv." + EXPSampleManager.Instance.getLevel(cs.levelId, opp.beastExp, 0).ToString();
            }
        }
        else
        {
            if (noBeast != null)
            {
                noBeast.gameObject.SetActive(true);
            }
            beast.gameObject.SetActive(false);
        }
    }
Beispiel #53
0
 public AboutPage()
 {
     _mainWindow   = WindowBase.GetCurrentFirst <MainWindow>();
     _configWindow = WindowBase.GetCurrentFirst <ConfigWindow>();
     InitializeComponent();
 }
Beispiel #54
0
    //网络重练后调用
    public void OnNetResume()
    {
        if (MissionManager.instance != null)
        {
            MissionManager.instance.OnNetResume();
        }
        GodsWarManagerment.Instance.getGodsWarStateInfo(() => { });
        if (godsWarGroupStageWindow != null && GodsWarManagerment.Instance.StateInfo != 1)
        {
            if (UiManager.Instance.godsBuyWind != null)
            {
                UiManager.Instance.godsBuyWind.destoryWindow();
            }
            if (UiManager.Instance.godsWarReplayWindow != null)
            {
                UiManager.Instance.godsWarReplayWindow.destoryWindow();
            }
            if (UiManager.Instance.godsWarUserInfoWindow != null)
            {
                UiManager.Instance.godsWarUserInfoWindow.destoryWindow();
            }
            if (UiManager.Instance.godsWarMySuportWindow != null)
            {
                UiManager.Instance.godsWarMySuportWindow.destoryWindow();
            }
            if (UiManager.Instance.godsWarProgramWindow != null)
            {
                UiManager.Instance.godsWarProgramWindow.destoryWindow();
            }
            UiManager.Instance.destoryWindowByName("MessageWindow");
            UiManager.Instance.BackToWindow <MainWindow>();
        }
        WindowBase win = windowStack.Peek();

        if (win != null && win.gameObject != null && win.gameObject.activeSelf)
        {
            win.OnNetResume();
        }
        if (UiManager.Instance != null && UiManager.Instance.pveUseWindow != null)
        {
            UiManager.Instance.pveUseWindow.getBaseData();
        }
        //if (Instance!=null&&Instance.godsWarSuportWindow!=null)
        //{
        //    UiManager.Instance.openMainWindow();
        //}
        if (Instance != null && Instance.laddersRankRewardWindow != null)
        {
            Instance.laddersRankRewardWindow.destoryWindow();
            laddersRankRewardWindow = null;
        }
        if (laddersChestsWindow != null)
        {
            laddersChestsWindow.destoryWindow();
            laddersChestsWindow = null;
        }
        if (levelupRewardWindow != null)
        {
            levelupRewardWindow.destoryWindow();
            levelupRewardWindow = null;
        }
    }
 /***/
 public void init(WindowBase fatherWindow, int tapIndex)
 {
     initButton(fatherWindow);
     this.currentTapIndex = tapIndex;
     UpdateUI();
 }
Beispiel #56
0
 protected ControlLayout(WindowBase window, int x, int y, int width, int height)
     : base(window, x, y, width, height)
 {
 }