示例#1
0
 private void SupplyForm_VisibleChanged(object sender, EventArgs e)
 {
     if (Visible && supplyID == -1)
     {
         SupplyGrid.ClearSelection();
     }
 }
示例#2
0
    protected override void updateCurPos(SupplyGrid grid)
    {
        grid.curPos += (int)grid.moveDirection;

        // Broadcast event of selected SupplyUIObject to listeners to update window info
        if (onSelection != null) 
			onSelection(grid.itemArray[grid.curPos]);

        MainMenuController.instance.menuState = lastState;
    }
示例#3
0
    protected override void updateCurPos(SupplyGrid grid)
    {
        grid.curPos += (int)grid.moveDirection;

        // Broadcast event of selected SupplyUIObject to listeners to update window info
        if (onSelection != null)
        {
            onSelection(grid.itemArray[grid.curPos]);
        }

        MainMenuController.instance.menuState = lastState;
    }
示例#4
0
    protected void gridCantMove(float tweenX, MainMenuController.MenuState state)
    {
        MainMenuController.instance.menuIsInTransition();
        lastState = state;

        SupplyGrid active = getActiveGrid();

        active.moveDirection = SupplyGrid._moveDirection.None;

        //Debug.Log(MainMenuController.instance.menuState);
        iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                           "from", windowPanel.clipRange.x,
                           "to", windowPanel.clipRange.x + tweenX,
                           "time", 0.2f,
                           "onupdatetarget", gameObject,
                           "onupdate", "moveCenter",
                           "easetype", iTween.EaseType.easeOutExpo
                           )
                       );
        iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                           "from", windowPanel.transform.localPosition.x,
                           "to", windowPanel.transform.localPosition.x - tweenX,
                           "time", 0.2f,
                           "onupdatetarget", gameObject,
                           "onupdate", "movePosition",
                           "easetype", iTween.EaseType.easeOutExpo
                           )
                       );
        iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                           "from", windowPanel.clipRange.x + tweenX,
                           "to", windowPanel.clipRange.x,
                           "time", 0.2f,
                           "delay", 0.2f,
                           "onupdatetarget", gameObject,
                           "onupdate", "moveCenter",
                           "easetype", iTween.EaseType.easeInExpo
                           )
                       );
        iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                           "from", windowPanel.transform.localPosition.x - tweenX,
                           "to", windowPanel.transform.localPosition.x,
                           "time", 0.2f,
                           "delay", 0.2f,
                           "onupdatetarget", gameObject,
                           "onupdate", "movePosition",
                           "oncompletetarget", gameObject,
                           "oncomplete", "updateCurPos",
                           "oncompleteparams", active,
                           "easetype", iTween.EaseType.easeInExpo
                           )
                       );
    }
示例#5
0
        private void CancelButton_Click(object sender, EventArgs e)
        {
            SupplyErrorProvider.Clear();

            if (supplyID > 0)
            {
                ViewSupplyDetailTab(supplyID, false);
            }
            else
            {
                ViewSupplyListingTab();

                supplyID = -1;

                SupplyGrid.ClearSelection();
            }
        }
示例#6
0
        private void FilterButton_Click(object sender, EventArgs e)
        {
            var filter = new SupplyFilter
            {
                ID                = FilterIDTextBox.Text.AsInt(),
                SupplierName      = FilterSupplierNameTextBox.Text,
                ComponentID       = (FilterComponentDropDown.SelectedValue.AsInt() == 0) ? null : FilterComponentDropDown.SelectedValue.AsInt(),
                DeliveredFrom     = (FilterDeliveredFromDatePicker.Format == DateTimePickerFormat.Custom) ? null : FilterDeliveredFromDatePicker.Value.Date.AsDateTime(),
                DeliveredTo       = (FilterDeliveredToDatePicker.Format == DateTimePickerFormat.Custom) ? null : FilterDeliveredToDatePicker.Value.Date.AsDateTime(),
                IsNotApprovedOnly = FilterIsNotApprovedOnlyCheckBox.Checked
            };

            using (var repository = new SupplyRepository())
            {
                SupplyGrid.DataSource = repository.GetSupplies(filter);
            }

            SupplyGrid.ClearSelection();
        }
示例#7
0
    protected override void updateCurPos(SupplyGrid grid)
    {
        grid.curPos += (int)grid.moveDirection;

        // Broadcast event of selected SupplyUIObject to listeners to update window info
        if (onSelection != null) 
            onSelection(grid.itemArray[grid.curPos]);
		
		/** Broadcast event of selected GunUIObject to StoreController to update Ammo SupplyGrid
		 *  ( StoreController.grids[1] ) */
		if (onStashSelection != null )
		{
			if( grids[0].isActive )
				onStashSelection((GunUIObject)grid.itemArray[grid.curPos], -1);
		}

        MainMenuController.instance.menuState = lastState;
		
		onGridMove();
    }
示例#8
0
    protected void moveGridRight(MainMenuController.MenuState state)
    {
        SupplyGrid active = getActiveGrid();

        active.moveDirection = SupplyGrid._moveDirection.Right;

        if (active.curPos + 1 <= active.itemArray.Count - 1 && MainMenuController.instance.menuState == MainMenuController.MenuState.Store)
        {
            MainMenuController.instance.menuIsInTransition();
            lastState = state;

            //Debug.Log(MainMenuController.instance.menuState);
            iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                               "from", windowPanel.clipRange.x,
                               "to", active.itemArray[active.curPos + 1].transform.localPosition.x,
                               "time", 0.4f,
                               "onupdatetarget", gameObject,
                               "onupdate", "moveCenter",
                               "easetype", iTween.EaseType.easeOutExpo
                               )
                           );
            iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                               "from", windowPanel.transform.localPosition.x,
                               "to", windowPanel.transform.localPosition.x - active.cellWidth,
                               "time", 0.4f,
                               "onupdatetarget", gameObject,
                               "onupdate", "movePosition",
                               "oncompletetarget", gameObject,
                               "oncomplete", "updateCurPos",
                               "oncompleteparams", active,
                               "easetype", iTween.EaseType.easeOutExpo
                               )
                           );
        }
        else if (MainMenuController.instance.menuState == MainMenuController.MenuState.Store)
        {
            gridCantMove(20f, state);
        }
    }
示例#9
0
    protected void moveGridTo(int index, MainMenuController.MenuState state)
    {
        SupplyGrid active = getActiveGrid();

        active.moveDirection = SupplyGrid._moveDirection.Left;

        if (MainMenuController.instance.menuState == MainMenuController.MenuState.Store)
        {
            MainMenuController.instance.menuIsInTransition();
            lastState = state;

            //Debug.Log(MainMenuController.instance.menuState);
            iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                               "from", windowPanel.clipRange.x,
                               "to", active.itemArray[index].transform.localPosition.x,
                               "time", 0.4f,
                               "onupdatetarget", gameObject,
                               "onupdate", "moveCenter",
                               "easetype", iTween.EaseType.easeOutExpo
                               )
                           );
            iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                               "from", windowPanel.transform.localPosition.x,
                               "to", panelPosCache.x - (active.cellWidth * (float)index),
                               "time", 0.4f,
                               "onupdatetarget", gameObject,
                               "onupdate", "movePosition",
                               "oncompletetarget", gameObject,
                               "oncomplete", "updateCurPosMoveTo",
                               "oncompleteparams", index,
                               "easetype", iTween.EaseType.easeOutExpo
                               )
                           );
        }
        else if (MainMenuController.instance.menuState == MainMenuController.MenuState.Store)
        {
            gridCantMove(-20f, state);
        }
    }
示例#10
0
    protected override void updateCurPos(SupplyGrid grid)
    {
        grid.curPos += (int)grid.moveDirection;

        // Broadcast event of selected SupplyUIObject to listeners to update window info
        if (onSelection != null)
        {
            onSelection(grid.itemArray[grid.curPos]);
        }

        /** Broadcast event of selected GunUIObject to StoreController to update Ammo SupplyGrid
         *  ( StoreController.grids[1] ) */
        if (onStashSelection != null)
        {
            if (grids[0].isActive)
            {
                onStashSelection((GunUIObject)grid.itemArray[grid.curPos], -1);
            }
        }

        MainMenuController.instance.menuState = lastState;

        onGridMove();
    }
示例#11
0
    public void updateAmmo(GunUIObject selected, int ammoIndex)
    {
        if (itemLocale == SuppliesUIObject._ItemLocale.StashBottom)
        {
            switch (gameObject.name)
            {
            case "Ammo Type 1":
                ammo = selected.gunObj.compatibleAmmo[1];
                mWidget.spriteName = ammo.spriteName;
                mWidget.alpha      = (ammo.amountOwned > 0 && ammo.isPurchased) ? 1f : 0.5f;
                break;

            case "Ammo Type 2":
                ammo = selected.gunObj.compatibleAmmo[2];
                mWidget.spriteName = ammo.spriteName;
                mWidget.alpha      = (ammo.amountOwned > 0 && ammo.isPurchased) ? 1f : 0.5f;
                break;

            case "Ammo Type 3":
                ammo = selected.gunObj.compatibleAmmo[3];
                mWidget.spriteName = ammo.spriteName;
                mWidget.alpha      = (ammo.isPurchased) ? 1f : 0.5f;
                break;

            default:
                break;
            }
        }
        if (itemLocale == SuppliesUIObject._ItemLocale.StoreGridItem)
        {
            SupplyGrid parentGrid = transform.parent.GetComponent <SupplyGrid>();
            switch (gameObject.name)
            {
            case "Ammo0":
                ammo = selected.gunObj.compatibleAmmo[1];
                mWidget.spriteName = ammo.spriteName;
                if (parentGrid.isActive)
                {
                    mWidget.alpha = (ammo.amountOwned > 0 & ammo.isPurchased) ? 1f : 0.5f;
                }
                break;

            case "Ammo1":
                ammo = selected.gunObj.compatibleAmmo[2];
                mWidget.spriteName = ammo.spriteName;
                if (parentGrid.isActive)
                {
                    mWidget.alpha = (ammo.amountOwned > 0 && ammo.isPurchased) ? 1f : 0.5f;
                }
                break;

            case "Ammo2":
                ammo = selected.gunObj.compatibleAmmo[3];
                mWidget.spriteName = ammo.spriteName;
                if (parentGrid.isActive)
                {
                    mWidget.alpha = (ammo.isPurchased) ? 0.5f : 1f;
                }
                break;

            default:
                break;
            }
        }
    }
示例#12
0
 protected abstract void updateCurPos(SupplyGrid grid);
示例#13
0
 protected abstract void updateCurPos(SupplyGrid grid);