Example #1
0
 protected override bool OnOpen(params object[] args)
 {
     if (IsOpen)
     {
         return(true);
     }
     if (args != null && args.Length > 8)
     {
         WindowsManager.CloseWindow <ItemWindow>();
         var par = (selectionType : (ItemSelectionType)args[0], container : (ISlotContainer)args[1], handler : (IInventoryHandler)args[2], confirm : args[3] as Action <List <ItemWithAmount> >,
                    title : args[4] as string, confirmDialog : args[5] as string, typeLimit : (int)args[6], amountLimit : (int)args[7], selectCondition : args[8] as Predicate <ItemSlotBase>, cancel : args[9] as Action);
         SelectionType    = par.selectionType;
         SourceContainer  = par.container;
         SourceHandler    = par.handler;
         windowTitle.text = par.title;
         dialog           = par.confirmDialog;
         typeLimit        = par.typeLimit;
         amountLimit      = par.amountLimit;
         if (par.selectCondition != null)
         {
             canSelect = par.selectCondition;
         }
         else
         {
             canSelect = (a) => { return(true); }
         };
         SourceContainer.DarkIf(x => !canSelect(x));
         onConfirm = par.confirm;
         onCancel  = par.cancel;
         confirm   = false;
         RegisterNotify();
         return(true);
     }
     return(false);
 }
Example #2
0
 public void TakeItem(ItemSlotData info, bool all = false)
 {
     if (!lootAgent || info == null || !info.item)
     {
         return;
     }
     WindowsManager.CloseWindow <ItemWindow>();
     if (!all)
     {
         if (info.amount == 1)
         {
             OnTake(info, 1);
         }
         else
         {
             AmountWindow.StartInput(delegate(long amount)
             {
                 OnTake(info, (int)amount);
             }, info.amount, "拾取数量", ZetanUtility.ScreenCenter, Vector2.zero);
         }
     }
     else
     {
         OnTake(info, info.amount);
     }
 }
Example #3
0
        private void FileDrop(object sender, DragEventArgs e)
        {
            DragAndDropWindow window = WindowsManager.FindModalWindow <DragAndDropWindow>();

            WindowsManager.OtherModalWindows.Remove(window);
            window?.Close(TypeData.File);
        }
Example #4
0
 protected override bool OnClose(params object[] args)
 {
     if (!IsOpen)
     {
         return(true);
     }
     foreach (var kvp in copySlots)
     {
         caches.Put(kvp.Value);
     }
     copySlots.Clear();
     selectedItems.Clear();
     SourceContainer.DarkIf(null);
     SourceContainer.MarkIf(null);
     SourceContainer = null;
     SourceHandler   = null;
     ZetanUtility.SetActive(tips, true);
     dialog        = string.Empty;
     SelectionType = ItemSelectionType.SelectNum;
     canSelect     = null;
     onConfirm     = null;
     if (!confirm)
     {
         onCancel?.Invoke();
     }
     onCancel = null;
     WindowsManager.CloseWindow <ItemWindow>();
     return(true);
 }
Example #5
0
        public async void Initialize()
        {
            if (_isInitialized)
            {
                return;
            }

            _isInitialized = true;

            var hasNoErrors = true;

            SetProperty(() => IsInitializing, ref _isInitializing, true);
            try
            {
                await InitializeInternal();
            }
            catch (Exception e)
            {
                hasNoErrors = false;
                WindowsManager.ReportError("Initialization error", e);
            }
            finally
            {
                SetProperty(() => IsInitializing, ref _isInitializing, false);
                if (hasNoErrors)
                {
                    OnInitialized();
                }
            }
        }
Example #6
0
 // Use this for initialization
 void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
        private void Finish()
        {
            if (countAnswerTrue == wordTrue.Length)
            {
                myWords[currentWord].TrueAnswer++;
                trueAnswer++;
            }

            if (++currentWord >= myWords.Count)
            {
                if (isTrening)
                {
                    VisibilityElements();
                    textBlockWord.Text = "Всего: " + myWords.Count.ToString();
                    FinishAnimation();
                    buttonNext.Content = "Завершить";
                    buttonNext.Click  -= buttonNext_Click;
                    buttonNext.Click  += Close;
                }
                else
                {
                    WindowsManager.CreateWindowBreyShtorm_4(myWords, false);
                    this.Close();
                }
                return;
            }
            ;
            currentLitter = 0;
            RemoveButtons();
            imageWord.Visibility  = Visibility.Hidden;
            textblockexample.Text = "";
            countAnswerTrue       = 0;
            Init();
        }
Example #8
0
 protected override void OnLoaded()
 {
     base.OnLoaded();
     WindowsManager.BringToFront(this.Window);
     Panel.SetZIndex(this.backgroundControl, this.Window.CurrentZIndex - 1);
     Menu.CloseAll();
 }
Example #9
0
    public void OnPointerClick(PointerEventData eventData)
    {
        if (eventData.button == PointerEventData.InputButton.Left)
        {
#if UNITY_STANDALONE
            if (holder)
            {
                holder.OnMouseClick?.Invoke();
            }
#elif UNITY_ANDROID
            if (holder)
            {
                holder.OnFingerClick?.Invoke();
            }
            if (!string.IsNullOrEmpty(TextToDisplay))
            {
                tips = WindowsManager.OpenWindowBy <FloatTipsPanel>(transform.position, TextToDisplay, 2, false);
                if (tips)
                {
                    tips.onClose += () => tips = null;
                }
            }
#endif
        }
        if (eventData.button == PointerEventData.InputButton.Right)
        {
            OnRightClick();
        }
    }
Example #10
0
 public void HideQuestDescription()
 {
     currentQuest                     = null;
     descriptionWindow.alpha          = 0;
     descriptionWindow.blocksRaycasts = false;
     WindowsManager.CloseWindow <ItemWindow>();
 }
Example #11
0
 private void StartPhotobooth()
 {
     ProcessHelper.KillAll(Settings.Default.PhotoBoothProcessName);
     _photoBooth  = ProcessHelper.Start(Settings.Default.PhotoBoothExecPath);
     _mainWindows = new WindowsManager(_photoBooth);
     _mainWindows.Hide();
 }
Example #12
0
 /// <summary>
 /// 关闭窗口
 /// </summary>
 /// <param name="args">变长参数</param>
 /// <returns>是否成功关闭</returns>
 public bool Close(params object[] args)
 {
     args ??= new object[0];
     if (OnClose(args))
     {
         WindowsManager.Remove(this);
         NotifyCenter.PostNotify(WindowStateChanged, GetType().Name, WindowStates.Closed);
         IsOpen = false;
         onClose?.Invoke();
         onClose = null;
         openBy  = null;
         if (animated)
         {
             content.blocksRaycasts = false;
             IFadeAble <Window> .FadeTo(this, 0, duration);
         }
         else
         {
             content.alpha          = 0;
             content.blocksRaycasts = false;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SeriesSource"/> class.
        /// </summary>
        /// <param name="windowsManager">The windows manager.</param>
        /// <param name="chart">The chart.</param>
        protected SeriesSource(WindowsManager windowsManager, Chart chart)
        {
            this.chart          = chart;
            this.windowsManager = windowsManager;

            UIFactory.ChartSetup(chart);
        }
Example #14
0
    public static ItemSelectionWindow OpenSelectionWindow <T>(ItemSelectionType selectionType, Action <List <ItemWithAmount> > confirm, string title = null, string confirmDialog = null,
                                                              int?typeLimit = null, int?amountLimit = null, Predicate <ItemSlotBase> selectCondition = null, Action cancel = null, params object[] args) where T : InventoryWindow
    {
        var window = WindowsManager.FindWindow <T>();

        if (window)
        {
            bool openBef = window.IsOpen, hiddenBef = window.IsHidden;
            if (window.IsHidden)
            {
                WindowsManager.HideWindow <T>(false);
            }
            if (!window.IsOpen)
            {
                window.Open(args);
            }
            var selection = ItemSelectionWindow.StartSelection(selectionType, window.grid as ISlotContainer, window.Handler, confirm, title, confirmDialog, typeLimit, amountLimit, selectCondition, cancel);
            selection.onClose += () =>
            {
                if (!openBef)
                {
                    window.Close(typeof(ItemSelectionWindow));
                }
                else if (hiddenBef)
                {
                    WindowsManager.HideWindow <T>(true);
                }
            };
            return(selection);
        }
        return(null);
    }
Example #15
0
 /// <summary>
 /// 打开窗口
 /// </summary>
 /// <param name="args">变长参数</param>
 /// <returns>是否成功打开</returns>
 public bool Open(params object[] args)
 {
     args ??= new object[0];
     if (OnOpen(args))
     {
         WindowsManager.Push(this);
         NotifyCenter.PostNotify(WindowStateChanged, GetType().Name, WindowStates.Open);
         IsOpen  = true;
         closeBy = null;
         if (animated)
         {
             IFadeAble <Window> .FadeTo(this, 1, duration, () => content.blocksRaycasts = true);
         }
         else
         {
             content.alpha          = 1;
             content.blocksRaycasts = true;
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #16
0
        public DataProvider(AppMode appMode)
        {
            XmlRepository  = new XmlRepository(this);
            CommonSettings = XmlRepository.LoadCommonSettings();
            if (CommonSettings == null)
            {
                CommonSettings = new CommonSettings {
                    IsSet = false
                }
            }
            ;
            else
            {
                CommonSettings.IsSet = true;
            }
            VariablesRepository = new VariablesRepository(this);
            ObjectsRepository   = new ObjectsRepository(this);

            CommonSettings.AppMode         = appMode;
            CommonSettings.AppModeChanged += delegate { ObjectsRepository.SwitchAppMode(); };

            ProjectRepository = new ProjectRepository(this);
            DialogsManager    = new DialogsManager(this);
            TabsRepository    = new TabsRepository(this);
            WindowsManager    = new WindowsManager(this);
        }
Example #17
0
        private async void Enter()
        {
            Request.IsEntered = false;
            Browser           = CustomBrowser.Create();
            try
            {
                var locale = await Browser.RequestAsync(Request);

                Response.Headers    = locale.Headers;
                Response.Response   = locale.Response;
                Response.StatusCode = locale.StatusCode;
                Request.IsEntered   = true;
            }
            catch (ArgumentNullException ex)
            {
                WindowsManager.Message("ApiDog", ex.Message);
            }
            catch (Exception ex)
            {
                WindowsManager.Message("ApiDog", ex.Message);
            }
            finally
            {
                Browser.Abort();
            }
        }
Example #18
0
 /// <summary>
 /// 由建筑自身的各类功能窗口调用,如<see cref="WarehouseWindow.OnClose(object[])"/>中对<see cref="WarehouseWindow.warehouse"/>的操作
 /// </summary>
 public virtual void EndManagement()
 {
     if (Info.Manageable)
     {
         WindowsManager.HideWindow <StructureManageWindow>(false, this);
     }
 }
Example #19
0
        public void RetourAccueil()
        {
            WindowsManager windowManager = new WindowsManager();

            windowManager.OpenExisting(Enum.WindowsEnum.LoginView);
            windowManager.Close(Enum.WindowsEnum.LoyaltyView);
        }
Example #20
0
 protected override void OnEnter()
 {
     base.OnEnter();
     Character.SetSubState(CharacterBusyStates.UI);
     NotifyCenter.AddListener(MakingManager.MakingCanceled, OnMakingCanceled, this);
     making = WindowsManager.FindWindow <MakingWindow>();
 }
Example #21
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (eventData.button == PointerEventData.InputButton.Left)
     {
         WindowsManager.OpenWindowBy <QuestWindow>(this);
     }
 }
Example #22
0
        public MainWindow()
        {
            try
            {
                _windowsManager = new WindowsManager();
                _model = new MainModel(this, FimClientFactory.CreateClient(), _windowsManager, new XmlExporter());
                _referenceColumnDetector = new ReferenceColumnDetector();

                InitializeComponent();

                this.DataContext = _model;
                _model.Initialize();
            }
            catch (Exception exc)
            {
                MessageBox.Show(@"There was an error during application startup. Verify that your configuration file points to a valid FIM service instance.
            Application will now close.

            Exception details:

            " + exc, "Predica.FimExplorer Initialization error", MessageBoxButton.OK, MessageBoxImage.Error);

                Application.Current.Shutdown();
            }
        }
Example #23
0
        public void Close()
        {
            About window = WindowsManager.FindModalWindow <About>();

            WindowsManager.OtherModalWindows.Remove(window);

            window.Close();
        }
Example #24
0
 public void OnRightClick()
 {
     if (!DragableManager.Instance.IsDraging)
     {
         rightClickAction?.Invoke(this);
         WindowsManager.CloseWindow <ItemWindow>();
     }
 }
Example #25
0
        //public LongRunningJob(Action<T> action, string title)
        //{
        //    _action = action;
        //    _progressWindowModelView = new ProgressWindowModelView(null);
        //    //_progressWindowModelView.Title = title;

        //    _progressWindow = WindowsManager.GetInstance().ShowDialog<ProgressWindow>(_progressWindowModelView);
        //    //_progressWindow.DataContext = _progressWindowModelView;
        //}

        public LongRunningJob(Action <ProgressCounter, T> action, ProgressCounter progressCounter)
        {
            _action = action;
            _progressWindowModelView = new ProgressWindowModelView(progressCounter);

            _progressWindow = WindowsManager.GetInstance().ShowDialog <ProgressWindow>(_progressWindowModelView);
            //_progressWindow.DataContext = _progressWindowModelView;
        }
Example #26
0
 private void FinishLocation()
 {
     ZetanUtility.SetActive(backButton, false);
     CameraMovement2D.Instance.Stop();
     WindowsManager.HideAll(false);
     IsLocating        = false;
     LocatingStructure = null;
 }
Example #27
0
        private void CloseWindow()
        {
            SettingsWindow foundSettings = WindowsManager.FindModalWindow <SettingsWindow>();

            foundSettings?.Close();

            WindowsManager.OtherModalWindows.Remove(foundSettings);
        }
Example #28
0
        private void buttonBack_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            int           count = App.dataVariable.CountWordRepetition;
            List <MyWord> lists = BdTools.GetRandomListMyWord(count);

            WindowsManager.CreateWindowRepetition(lists);
        }
Example #29
0
 public static AmountWindow StartInput(Action <long> confirmAction, Action cancelAction, long min, long max, string title = "", Vector2?position = null, Vector2?offset = null)
 {
     if (min < 0 || max < 1)
     {
         return(null);
     }
     return(WindowsManager.OpenWindow <AmountWindow>(confirmAction, cancelAction, min, max, title, position, offset));
 }
 protected override void WndProc(ref Message m)
 {
     if (WindowsManager != null)
     {
         WindowsManager.DispatchMessage(ref m);
     }
     base.WndProc(ref m);
 }
Example #31
0
    public static void InitGame(params Type[] exceptions)
    {
        Screen.sleepTimeout = SleepTimeout.NeverSleep;
        ActionStack.Clear();
        Crops.Clear();
        foreach (var enemykvp in Enemies)
        {
            enemykvp.Value.RemoveAll(x => !x || !x.gameObject);
        }

        EnemyInfos.Clear();
        var enemies = Resources.LoadAll <EnemyInformation>("Configuration");

        foreach (var e in enemies)
        {
            EnemyInfos.Add(e.ID, e);
        }

        Items.Clear();
        var items = Resources.LoadAll <ItemBase>("Configuration");

        foreach (var i in items)
        {
            Items.Add(i.ID, i);
        }

        TalkerInfos.Clear();
        var talkers = Resources.LoadAll <TalkerInformation>("Configuration");

        foreach (var t in talkers)
        {
            TalkerInfos.Add(t.ID, t);
        }

        if (exceptions == null || !exceptions.Contains(typeof(TriggerHolder)))
        {
            foreach (var tholder in FindObjectsOfType <TriggerHolder>())
            {
                tholder.Init();
            }
        }
        PlayerManager.Instance.Init();
        DialogueManager.Instance.Init();
        if (!UIManager.Instance || !UIManager.Instance.gameObject)
        {
            Instantiate(Instance.UIPrefab);
        }
        UIManager.Instance.Init();
        FieldManager.Instance.Init();
        QuestManager.Instance.Init();
        MessageManager.Instance.Init();
        MapManager.Instance.Init();
        MapManager.Instance.SetPlayer(PlayerManager.Instance.PlayerTransform);
        MapManager.Instance.RemakeCamera();
        GatherManager.Instance.Init();
        WindowsManager.Clear();
    }
Example #32
0
        public ObjectDetailsModel(RmResource resource, IFimClient fimClient, WindowsManager windowsManager)
        {
            _fimClient = fimClient;
            _windowsManager = windowsManager;

            Resource = resource;

            Attributes = resource.Attributes
                .Select(x => new FlattenedAttribute(x))
                .ToList();
        }
Example #33
0
        public MainModel(MainWindow parent, IFimClient fimClient, WindowsManager windowsManager, IXmlExporter xmlExporter)
        {
            _parent = parent;
            _fimClient = fimClient;
            _windowsManager = windowsManager;
            _xmlExporter = xmlExporter;

            ObjectTypes = new ObservableCollection<RmObjectTypeDescription>();
            CurrentAttributes = new ObservableCollection<SelectableAttribute>();
        }
 public ImportedObjectsModel(Stream inputStream, IXmlImporter xmlImporter, WindowsManager windowsManager)
 {
     _inputStream = inputStream;
     _xmlImporter = xmlImporter;
     _windowsManager = windowsManager;
 }