Ejemplo n.º 1
0
    //Rect inventory_rect, equipment_rect;
    public void Show()
    {
        GUI.skin = skin;
        Rect inventory_toggle = new Rect(0, (Screen.height / 2) - 100, 20, 100),
             equipment_toggle = new Rect(0, (Screen.height / 2), 20, 100);

        InventoryWindow inventory_window = player.transform.GetComponent <InventoryWindow> ();
        EquipmentWindow equipment_window = player.transform.GetComponent <EquipmentWindow> ();

        if (inventory_window)
        {
            GUI.color = Color.green;
        }
        else
        {
            GUI.color = Color.red;
        }
        if (GUI.Button(inventory_toggle, "I"))
        {
            Toggle <InventoryWindow> ();
        }
        if (equipment_window)
        {
            GUI.color = Color.green;
        }
        else
        {
            GUI.color = Color.red;
        }
        if (GUI.Button(equipment_toggle, "E"))
        {
            Toggle <EquipmentWindow> ();
        }
    }
Ejemplo n.º 2
0
        private void test(object sender, MouseButtonEventArgs e)
        {
            if (sender is TreeViewItem)
            {
                if (!((TreeViewItem)sender).IsSelected)
                {
                    return;
                }
            }
            DependencyObject obj  = e.OriginalSource as DependencyObject;
            TreeViewItem     item = GetDependencyObjectFromVisualTree(obj, typeof(TreeViewItem)) as TreeViewItem;

            if (((item.Header).GetType().Equals(typeof(AssetNode))))
            {
                Int32 ID = ((AssetNode)(item.Header)).ID;

                EquipmentWindow EW = new EquipmentWindow(false, ID);
                EW.Owner = this;
                EW.ShowDialog();

//                ((AssetNode)(item.Header)).Label = "CSE-11-111";
            }
            else
            if (((item.Header).GetType().Equals(typeof(TreeCustomer))))
            {
                MessageBox.Show(((TreeCustomer)(item.Header)).Name.ToString());
            }
        }
Ejemplo n.º 3
0
        private void ButtonAddEquipment_Click(object sender, RoutedEventArgs e)
        {
            this.edit = false;
            EquipmentWindow equipmentWindow = new EquipmentWindow(edit, selRow);

            equipmentWindow.ShowDialog();

            clsEquipos obj_e = new clsEquipos();

            dt_equipos = obj_e.CargarEquipos();

            dt_equipos.Columns[0].ColumnName = "SERIAL NUMBER";
            dt_equipos.Columns[1].ColumnName = "DESCRIPTION";
            dt_equipos.Columns[2].ColumnName = "UNIT";
            dt_equipos.Columns[3].ColumnName = "VALUE";

            EquipmentDataGrid.ItemsSource = dt_equipos.DefaultView;
        }
Ejemplo n.º 4
0
    void Start()
    {
        Main.Instance.MoveItem = OnMoveItem;

        GridiaConstants.SoundPlayer.MuteSfx = GridiaConstants.SoundPlayer.MuteMusic = Application.isEditor;

        Locator.Provide(InputManager);

        Locator.Provide(this);
        Locator.Provide(GridiaConstants.SoundPlayer);
        ResizeCamera();

        TabbedGui = new TabbedUI(new Vector2(Int32.MaxValue, 0));
        Locator.Provide(TabbedGui);
        TabbedGui.ScaleXY = GridiaConstants.GuiScale;

        InvGui = new ContainerWindow(new Vector2(0, Int32.MaxValue));
        Locator.Provide(InvGui);
        InvGui.ScaleXY = GridiaConstants.GuiScale;

        EquipmentGui = new EquipmentWindow(new Vector2(0, 0));
        Locator.Provide(EquipmentGui);
        EquipmentGui.ScaleXY = GridiaConstants.GuiScale;

        ChatGui = new ChatWindow(new Vector2(Int32.MaxValue, Int32.MaxValue));
        Locator.Provide(ChatGui);
        ChatGui.ScaleXY = GridiaConstants.GuiScale;

        ItemUsePickWindow = new ItemUsePickWindow(new Vector2(0, 0));
        Locator.Provide(ItemUsePickWindow);
        ItemUsePickWindow.ScaleXY = GridiaConstants.GuiScale;

        var helpMenu = new HelpMenu(new Vector2(0, 0));

        Locator.Provide(helpMenu);
        helpMenu.ScaleXY = GridiaConstants.GuiScale;

        Locator.Provide(ContentManager = new ContentManager(GridiaConstants.WorldName));
        Locator.Provide(TextureManager = new TextureManager(GridiaConstants.WorldName));

        ActionWindow = new ActionWindow(new Vector2(Int32.MaxValue, Int32.MaxValue));
        Locator.Provide(ActionWindow);
        ActionWindow.ScaleXY = GridiaConstants.GuiScale;
    }
Ejemplo n.º 5
0
    private void Start()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else if (Instance != this)
        {
            Destroy(gameObject);
        }

        _playerEquipment = new Dictionary <Entity.EquipmentSlot, Item>(GameManager.Instance.Player.Equipped);
        _bodyPartButtons = new Dictionary <char, GameObject>();
        _parent          = transform;
        _keyMapLetter    = 'a';
        PopulateWindow();
        EventMediator.Instance.SubscribeToEvent(GlobalHelper.ItemEquippedEventName, this);
        EventMediator.Instance.SubscribeToEvent(GlobalHelper.ItemUnequippedEventName, this);
    }
Ejemplo n.º 6
0
        private void ButtonEditEquipment_Click(object sender, RoutedEventArgs e)
        {
            if (EquipmentDataGrid.SelectedItem != null)
            {
                edit   = true;
                selRow = EquipmentDataGrid.SelectedIndex;
                EquipmentWindow equipmentWindow = new EquipmentWindow(edit, selRow);
                equipmentWindow.ShowDialog();

                clsEquipos obj_e = new clsEquipos();
                dt_equipos = obj_e.CargarEquipos();

                dt_equipos.Columns[0].ColumnName = "SERIAL NUMBER";
                dt_equipos.Columns[1].ColumnName = "DESCRIPTION";
                dt_equipos.Columns[2].ColumnName = "UNIT";
                dt_equipos.Columns[3].ColumnName = "VALUE";

                EquipmentDataGrid.ItemsSource = dt_equipos.DefaultView;
            }
        }
Ejemplo n.º 7
0
        public ArmyWindow CreateArmyWindow(Army army)
        {
            var window   = new ArmyWindow(_guiServices);
            var hasData  = false;
            var infoText = "";

            window.NameText = army.Name;
            window.Image    = _armyWindowImages[army.Owner.Id - 1];

            window.ButtonOkText = _texts.Get("ok");
            if (army.Owner.IsUserControlled)
            {
                window.ButtonMoreText = _texts.Get("commands");
                hasData = true;
            }
            else
            {
                window.ButtonMoreText = _texts.Get("interview");
                if (army.DaysToGetInfo > 28 && army.DaysToGetInfo < 100)
                {
                    hasData  = false;
                    infoText = _texts.Get("noInformation");
                }
                else
                {
                    infoText = army.DaysToGetInfo > 1 ?
                               _texts.Get("informationsInXDays", army.DaysToGetInfo) :
                               _texts.Get("informationsInOneDay");
                    hasData = false;
                }
                if (army.DaysToGetInfo == 0 || army.DaysToGetInfo == 100)
                {
                    hasData = true;
                    window.ButtonMoreText = _texts.Get("trace");
                }
            }

            if (!hasData && !_legionConfig.GoDmOdE)
            {
                window.InfoText = infoText;
            }
            else
            {
                var count = army.Characters.Count;
                window.CountText = count == 1 ?
                                   _texts.Get("oneWarrior") :
                                   _texts.Get("xWarriors", count);

                int foodCount = army.Food / army.Characters.Count;
                if (foodCount > 1)
                {
                    window.FoodText = _texts.Get("foodForXDays", foodCount);
                }
                else if (foodCount == 1)
                {
                    window.FoodText = _texts.Get("foodForOneDay");
                }
                else
                {
                    window.FoodText = _texts.Get("noMoreFood");
                }

                window.StrengthText = _texts.Get("strength") + ": " + army.Strength;
                window.SpeedText    = _texts.Get("speed") + ": " + army.Speed;

                window.ActionText = "";
                switch (army.CurrentAction)
                {
                case ArmyActions.Camping:
                    window.ActionText = _texts.Get("camping");

                    /* TODO:
                     * If TEREN>69
                     *  RO$=RO$+" w "+MIASTA$(TEREN-70)
                     * End If
                     */
                    break;

                case ArmyActions.Move:
                case ArmyActions.FastMove:
                    window.ActionText = _texts.Get("moving");
                    break;

                case ArmyActions.Attack:
                    window.ActionText = _texts.Get("attackingX", army.Target.Name);

                    /* TODO:
                     * If CELY=0
                     *  R2$=ARMIA$(CELX,0)
                     * Else
                     *  R2$=MIASTA$(CELX)
                     * End If
                     * RO$="Atakujemy "+R2$
                     */
                    break;

                case ArmyActions.Hunting:
                    window.ActionText = _texts.Get("hunting");
                    break;
                }
            }

            if (army.Owner.IsUserControlled)
            {
                window.MoreClicked += args =>
                {
                    var ordersWindow = CreateArmyOrdersWindow(army);
                    _modalLayer.Window = ordersWindow;

                    // TODO: implement all actions handling
                    ordersWindow.MoveClicked     += moveArgs => HandleMoveClick(army, ArmyActions.Move);
                    ordersWindow.FastMoveClicked += moveArgs => HandleMoveClick(army, ArmyActions.FastMove);
                    ordersWindow.AttackClicked   += moveArgs =>
                    {
                        _mapRouteDrawer.StartRouteDrawingForMapObject(army, (source, target) =>
                        {
                            ((Army)source).CurrentAction = ArmyActions.Attack;
                            ((Army)source).Target        = target;
                        });
                    };
                    ordersWindow.HuntClicked      += moveArgs => army.CurrentAction = ArmyActions.Hunting;
                    ordersWindow.CampClicked      += moveArgs => army.CurrentAction = ArmyActions.Camping;
                    ordersWindow.EquipmentClicked += _args =>
                    {
                        var equipmentWindow = new EquipmentWindow(_guiServices, _texts)
                        {
                            Army = army
                        };
                        _modalLayer.Window = equipmentWindow;
                    };
                };
            }
            else if (army.DaysToGetInfo > 0 && army.DaysToGetInfo < 100)
            {
                window.MoreClicked += args =>
                {
                    _modalLayer.Window = _commonMapGuiFactory.CreateBuyInformationWindow(army);
                };
            }

            return(window);
        }
Ejemplo n.º 8
0
        public AdministratorMainWindow()
        {
            InitializeComponent();
            Title += " v" + Settings.version + ". Пользователь " + Auth.getInstance().Full_name + ". Режим администратора.";

            try
            {
                int updateTime = int.Parse(CRMSettingViewModel.instance().getByMashineName("bid_update_time").Setting_value) * 1000;
                if (updateTime != 0)
                {
                    Classes.UpdateTask.Start(Dispatcher,
                                             new Action(() => { BidViewModel.instance().reload(); }),
                                             updateTime,
                                             new Action(() => { updateNotification.Visibility = Visibility.Hidden; }),
                                             new Action(() => { updateNotification.Visibility = Visibility.Visible; }));
                }
            }
            catch {}

            menuOpenEquipmentWindow.Click += delegate
            {
                EquipmentWindow window = new EquipmentWindow();
                window.ShowDialog();
            };

            menuOpenComplectationItemWindow.Click += delegate
            {
                ComplectationItemWindow window = new ComplectationItemWindow();
                window.ShowDialog();
            };

            menuOpenBuyerWindow.Click += delegate
            {
                BuyerWindow window = new BuyerWindow();
                window.ShowDialog();
            };

            menuOpenSellerWindow.Click += delegate
            {
                SellerWindow window = new SellerWindow();
                window.ShowDialog();
            };

            menuOpenBidStatusWindow.Click += delegate
            {
                BidStatusWindow window = new BidStatusWindow();
                window.ShowDialog();
            };

            menuOpenPaymentStatusWindow.Click += delegate
            {
                PaymentStatusWindow window = new PaymentStatusWindow();
                window.ShowDialog();
            };

            menuOpenManagerWindow.Click += delegate
            {
                ManagerWindow window = new ManagerWindow();
                window.ShowDialog();
            };

            menuOpenTransportCompanyWindow.Click += delegate
            {
                TransportCompanyWindow window = new TransportCompanyWindow();
                window.ShowDialog();
            };

            menuOpenMessageTemplatesWindow.Click += delegate
            {
                MessageTemplatesWindow window = new MessageTemplatesWindow();
                window.ShowDialog();
            };

            tiCRMSetting.Content = new MainControlCRMSetting();
            tiBid.Content        = new MainControlBid();
        }
Ejemplo n.º 9
0
        //--- Equipments ---

        public void ShowEquipements()
        {
            _equipmentWindow = new EquipmentWindow();
            _equipmentWindow.Show();
            _ninjaListVM.CloseInventoryNinja();
        }