Beispiel #1
0
        public static SelectionWindow createSelectionWindow()
        {
            var selectionWindow = new SelectionWindow();

            selectionWindow.Left  = Application.Current.MainWindow.Left + Application.Current.MainWindow.Width;
            selectionWindow.Top   = Application.Current.MainWindow.Top;
            selectionWindow.Owner = Application.Current.MainWindow;
            return(selectionWindow);
        }
Beispiel #2
0
        private Task <bool> preloadImages()
        {
            var tcs = new TaskCompletionSource <bool>();

            Task.Run(() => {
#if !HIDE_MAP_SCREENS
                LevelImagePanel.preload();
                MapScreen.preload(); //This takes a while
#endif
                InventoryScreen.preload();
                SelectionWindow.preload();
                ItemControl.preload();
                tcs.SetResult(true);
            });
            return(tcs.Task);
        }
        private void enchantmentImageButton_Click(object sender, RoutedEventArgs e)
        {
            if (!ImageUriHelper.gameContentLoaded)
            {
                return;
            }
            EventLogger.logEvent("enchantmentImageButton_Click", new Dictionary <string, object>()
            {
                { "enchantment", _enchantment?.Id ?? "null" }
            });
            var selectionWindow = new SelectionWindow();

            selectionWindow.Owner = Application.Current.MainWindow;
            selectionWindow.loadEnchantments(_enchantment?.Id);
            selectionWindow.onSelection = selectedEnchantmentId;
            selectionWindow.Show();
        }
        private void armorPropertyButton_Click(Armorproperty armorProperty)
        {
            if (!AppModel.gameContentLoaded)
            {
                return;
            }
            EventLogger.logEvent("armorPropertyButton_Click", new Dictionary <string, object>()
            {
                { "armorProperty", armorProperty.Id }
            });
            var selectionWindow = new SelectionWindow();

            selectionWindow.Owner = Application.Current.MainWindow;
            selectionWindow.loadArmorProperties(armorProperty.Id);
            selectionWindow.onSelection = newArmorPropertyId => {
                this.replaceArmorProperty(armorProperty.Id, newArmorPropertyId);
            };
            //selectionWindow.onSelection = selectedArmorPropertyId;
            selectionWindow.Show();
        }