private void GetUsers()
 {
     isSelected = false;
     StatDisplay.NoError();
     DisplayedUser = new User();
     App.Messenger.NotifyColleagues("GetUsers");
 }
 private void ClearUserDisplay()
 {
     isSelected = false;
     StatDisplay.NoError();
     DisplayedUser = new User();
     App.Messenger.NotifyColleagues("UserCleared");
 } //ClearUserDisplay()
Exemplo n.º 3
0
 private void button6_Click(object sender, EventArgs e)
 {
     VirtualMoneyDisplay.Show();
     DebtsDisplay.Hide();
     DisplayPayments.Hide();
     StatDisplay.Hide();
 }
Exemplo n.º 4
0
 private void button12_Click(object sender, EventArgs e)
 {
     CleintsAdditor.Show();
     WorkersAdditor.Hide();
     VirtualMoneyDisplay.Hide();
     DebtsDisplay.Hide();
     DisplayPayments.Hide();
     StatDisplay.Hide();
 }
Exemplo n.º 5
0
    /* Switches the display of the current weapon stats to the next weapon in the list. */
    public void switchWeaponStats()
    {
        WeaponStats current = p.stats.weapon_by_type(p.stats.current_weapon());

        displays[3] = new StatDisplay("Damage", current.weapon_stat(STAT_TYPE.damage));
        displays[4] = new StatDisplay("Rate of Fire", current.weapon_stat(STAT_TYPE.rate_of_fire));
        displays[5] = new StatDisplay("Ammo Cost", current.weapon_stat(STAT_TYPE.ammo));

        updatePositions();
    }
        private void newPage_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName != "SelectedValue")
            {
                return;
            }

            var model = (StatValueViewModel)sender;
            var index = this.pages.IndexOf(model);
            var stats = new List <KeyValuePair <Statistic, object> >(index + 1);

            for (var i = 0; i < this.pages.Count; i++)
            {
                var selectedValue = this.pages[i].SelectedValue;
                if (selectedValue != null)
                {
                    stats.Add(new KeyValuePair <Statistic, object>(this.sortByList[i], selectedValue));
                }
            }

            if (stats.Count == 0)
            {
                this.ValueHeader   = "Value";
                this.StatisticList = this.GetDefaultList();
                return;
            }

            var moduleList = this.Settings.Statistics.Where(st => this.HasAllValues(st, stats)).ToArray();
            var statList   = new List <StatDisplay>();

            if (moduleList.Length == 0)
            {
                var statDisplay = new StatDisplay(
                    StatisticHelper.GetDisplayText(Statistic.MatchCount),
                    "0",
                    StatisticHelper.GetDescription(Statistic.MatchCount));
                statList.Add(statDisplay);
            }
            else
            {
                foreach (var stat in this.GetStatDisplayList())
                {
                    var statDisplay = new StatDisplay(
                        StatisticHelper.GetDisplayText(stat),
                        this.GetAverageValue(moduleList, stat),
                        StatisticHelper.GetDescription(stat));
                    statList.Add(statDisplay);
                }
            }

            this.ValueHeader   = "Average Value";
            this.StatisticList = statList;
        }
Exemplo n.º 7
0
    /* Creates the contents of the window */
    public void drawContents(int ID)
    {
        /* Draw each stat display */
        foreach (StatDisplay sd in displays)
        {
            drawStatDisplay(sd);
        }
        // Prints the name of the current weapon
        Rect weapon_lbl = StatDisplay.relativeRect(displays[2].labels[1], 2, -8, 35, 48, 22);

        GUI.Label(weapon_lbl, p.stats.weapon_by_type(p.stats.current_weapon()).type.ToString());
    }
 private void UpdateUser()
 {
     if (!StatDisplay.ChkUserForUpdate(DisplayedUser))
     {
         return;
     }
     if (!App.StoreXML.UpdateUser(DisplayedUser))
     {
         StatDisplay.Status = App.StoreXML.errorMessage;
         return;
     }
     App.Messenger.NotifyColleagues("UpdateUser", DisplayedUser);
 } //UpdateUser()
Exemplo n.º 9
0
	public void Update() {

		displays = new StatDisplay[6];
		// Initialize stat displays
		displays[0] = new StatDisplay("Health", p.stats.MAX_HEALTH);
		displays[1] = new StatDisplay("Shield", p.stats.MAX_SHIELD);
		displays[2] = new StatDisplay("Medpacks", p.stats.MEDPACKS);
		switchWeaponStats();

		// Toggle the display on and off
		if (Input.GetKeyDown(KeyCode.Tab)) {
			show = !show;
			Time_Count.toggle_pause();
		}
	}
Exemplo n.º 10
0
    public void Update()
    {
        displays = new StatDisplay[6];
        // Initialize stat displays
        displays[0] = new StatDisplay("Health", p.stats.MAX_HEALTH);
        displays[1] = new StatDisplay("Shield", p.stats.MAX_SHIELD);
        displays[2] = new StatDisplay("Medpacks", p.stats.MEDPACKS);
        switchWeaponStats();

        // Toggle the display on and off
        if (Input.GetKeyDown(KeyCode.Tab))
        {
            show = !show;
            Time_Count.toggle_pause();
        }
    }
Exemplo n.º 11
0
    //object that has this script is trigger
    private void OnTriggerEnter(Collider collision)
    {
        m_bonfire = collision.GetComponent <StatDisplay>();
        if (m_bonfire != null)
        {
            m_Plop.Play();
            if (m_bonfire.m_showStats == true)
            {
                m_bonfire.m_showStats = false;
            }

            else if (m_bonfire.m_showStats == false)
            {
                m_bonfire.m_showStats = true;
            }
        }
    }
Exemplo n.º 12
0
    void Start()
    {
        if (stats == null)
        {
            stats = this;
        }
        else
        {
            Destroy(gameObject);
        }

        Transform[] temp = GetComponentsInChildren <Transform>();

        for (int i = 0; i < temp.Length; ++i)
        {
            stats_icons.Add(temp[i].gameObject);
        }

        UpdateUI();
    }
Exemplo n.º 13
0
    private void Start()
    {
        JSONReadManager.LoadFile("mapFile");
        JSONReadManager.LoadFile("personalityFile");

        gridInstance      = GridManagerScript.instance;
        playerUnitManager = PlayerUnitManager.instance;
        enemyUnitManager  = EnemyUnitManager.instance;

        gridInstance.Initialize();

        display = GetComponent <StatDisplay>();
        display.Initialize();
        DisableText();

        chat.InitializeChatBox();
        chat.ShowAndHide(false);
        showingChat = false;

        AddMessageToChat("HOST", "Left click controls Units.");
        AddMessageToChat("HOST", "Right click deselects Units.");
        AddMessageToChat("HOST", "Press E to Prepare to Shoot.");
        AddMessageToChat("HOST", "Left click to shoot enemies.");
        AddMessageToChat("HOST", "WASD moves camera.");
        AddMessageToChat("HOST", "Middle Mouse rotates camera.");

        localTurnOver     = false;
        networkedTurnOver = false;

        localStartTurn     = false;
        networkedStartTurn = false;

        if (PersistentData.GetHosting())
        {
            randomSeed = (int)System.DateTime.Now.Ticks;

            ChampNetManager.SendSeedMessage(randomSeed);

            InitUnitManagers(randomSeed);
        }
    }
        private void newPage_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName != "SelectedValue")
            {
                return;
            }

            var model = (StatValueViewModel)sender;
            var index = this.pages.IndexOf(model);
            var stats = new List<KeyValuePair<Statistic, object>>(index + 1);

            for (var i = 0; i < this.pages.Count; i++)
            {
                var selectedValue = this.pages[i].SelectedValue;
                if (selectedValue != null)
                {
                    stats.Add(new KeyValuePair<Statistic, object>(this.sortByList[i], selectedValue));
                }
            }

            if (stats.Count == 0)
            {
                this.ValueHeader = "Value";
                this.StatisticList = this.GetDefaultList();
                return;
            }

            var moduleList = this.Settings.Statistics.Where(st => this.HasAllValues(st, stats)).ToArray();
            var statList = new List<StatDisplay>();

            if (moduleList.Length == 0)
            {
                var statDisplay = new StatDisplay(
                    StatisticHelper.GetDisplayText(Statistic.MatchCount),
                    "0",
                    StatisticHelper.GetDescription(Statistic.MatchCount));
                statList.Add(statDisplay);
            }
            else
            {
                foreach (var stat in this.GetStatDisplayList())
                {
                    var statDisplay = new StatDisplay(
                        StatisticHelper.GetDisplayText(stat),
                        this.GetAverageValue(moduleList, stat),
                        StatisticHelper.GetDescription(stat));
                    statList.Add(statDisplay);
                }
            }

            this.ValueHeader = "Average Value";
            this.StatisticList = statList;
        }
Exemplo n.º 15
0
	/* Switches the display of the current weapon stats to the next weapon in the list. */
	public void switchWeaponStats() {
		WeaponStats current = p.stats.weapon_by_type( p.stats.current_weapon() );

		displays[3] = new StatDisplay( "Damage", current.weapon_stat(STAT_TYPE.damage) );
		displays[4] = new StatDisplay( "Rate of Fire", current.weapon_stat(STAT_TYPE.rate_of_fire) );
		displays[5] = new StatDisplay( "Ammo Cost", current.weapon_stat(STAT_TYPE.ammo) );

		updatePositions();
	}
Exemplo n.º 16
0
	/* Draws the fields of the given stat display */
	private void drawStatDisplay(StatDisplay display) {
		// display title
		GUI.Label(display.labels[0], display.name + " (" + display.stat.pointer_value() + ")");

		// Determines if the stat value is capped
		bool is_last = display.stat.next() == -1;
		// Determines if the player can afford the next upgrade
		Stat_Cost for_next = display.stat.next_cost();
		bool can_buy = for_next == null || ( for_next.scrap_cost <= p.stats.get_scrap() && for_next.ecore_cost <= p.stats.get_ecores() );

		GUI.enabled = !is_last && can_buy;

		if (GUI.enabled) {
			// Text color green indicates that a stat can be upgraded currently
			GUI.skin.button.normal.textColor = Color.green;
			GUI.skin.button.fontStyle = FontStyle.Bold;
		} else if (!is_last) {
			GUI.skin.button.normal.textColor = Color.red;
		}

		// Create button to increment the pointer
		if ( GUI.Button(display.buttons[0], "+") && GUI.enabled ) {
			int origin = 0;
			// Store the original value of the player's health
			if (display.stat.type == STAT_TYPE.health) {
				origin = (int)p.stats.MAX_HEALTH.current();
			}

			display.stat.increment();

			// Subtract cost from player stats
			if (for_next != null) {
				p.stats.change_scrap(-for_next.scrap_cost);
				p.stats.change_ecores(-for_next.ecore_cost);
			}

			// Indicate that the max values of either health or shield changed, so that sliders will update
			if (display.stat.type == STAT_TYPE.health) {
				// Restore health equal to the change in health
				p.stats.change_health( (int)p.stats.MAX_HEALTH.current() - origin );
				p.stats.HP_raised = true;
			} else if (display.stat.type == STAT_TYPE.shield) {
				// Fully restore shield
				p.stats.change_shield( (int)p.stats.MAX_SHIELD.current() );
				p.stats.Shield_raised = true;
			} else {
				// Updates the player's weapon if necessary
				p.updateWeapons();
			}
		}

		GUI.skin.button.normal.textColor = Color.white;
		GUI.skin.button.fontStyle = FontStyle.Normal;

		/* Do NOT uncomment!!
		 
		GUI.enabled = display.stat.pointer_value() > 0;
		// Decrement a stat value and return the cost of the upgrade
		if (GUI.Button(display.buttons[1], "-") && GUI.enabled) {
			display.stat.decrement();

			// Readd cost of the upgrade to player stats
			if (display.stat.next_cost() != null) {
				p.stats.change_scrap(display.stat.next_cost().scrap_cost);
				p.stats.change_ecores(display.stat.next_cost().ecore_cost);
			}

			// Indicate that the max values of either health or shield changed, so that sliders will update
			if (display.stat.type == STAT_TYPE.health) {
				p.stats.HP_raised = true;
			} else if (display.stat.type == STAT_TYPE.shield) {
				p.stats.Shield_raised = true;
			}
		}*/

		GUI.enabled = true;
		// show cost for next upgrade
		GUI.Label(display.labels[1], "cost (scrap | e. cores): " + ( (for_next == null) ? "-- | --" : (for_next.scrap_cost + " | " + for_next.ecore_cost) ) );
		// show current value
		GUI.Label(display.labels[2], "" + display.stat.current());
		// display arrows
		GUI.Label(display.labels[3], ">>");
		// show next value (or '--' if no such element exists)
		GUI.Label(display.labels[4], (is_last) ? "--" : "" + display.stat.next(), lbl_grn_text);
	}
Exemplo n.º 17
0
    /* Draws the fields of the given stat display */
    private void drawStatDisplay(StatDisplay display)
    {
        // display title
        GUI.Label(display.labels[0], display.name + " (" + display.stat.pointer_value() + ")");

        // Determines if the stat value is capped
        bool is_last = display.stat.next() == -1;
        // Determines if the player can afford the next upgrade
        Stat_Cost for_next = display.stat.next_cost();
        bool      can_buy  = for_next == null || (for_next.scrap_cost <= p.stats.get_scrap() && for_next.ecore_cost <= p.stats.get_ecores());

        GUI.enabled = !is_last && can_buy;

        if (GUI.enabled)
        {
            // Text color green indicates that a stat can be upgraded currently
            GUI.skin.button.normal.textColor = Color.green;
            GUI.skin.button.fontStyle        = FontStyle.Bold;
        }
        else if (!is_last)
        {
            GUI.skin.button.normal.textColor = Color.red;
        }

        // Create button to increment the pointer
        if (GUI.Button(display.buttons[0], "+") && GUI.enabled)
        {
            int origin = 0;
            // Store the original value of the player's health
            if (display.stat.type == STAT_TYPE.health)
            {
                origin = (int)p.stats.MAX_HEALTH.current();
            }

            display.stat.increment();

            // Subtract cost from player stats
            if (for_next != null)
            {
                p.stats.change_scrap(-for_next.scrap_cost);
                p.stats.change_ecores(-for_next.ecore_cost);
            }

            // Indicate that the max values of either health or shield changed, so that sliders will update
            if (display.stat.type == STAT_TYPE.health)
            {
                // Restore health equal to the change in health
                p.stats.change_health((int)p.stats.MAX_HEALTH.current() - origin);
                p.stats.HP_raised = true;
            }
            else if (display.stat.type == STAT_TYPE.shield)
            {
                // Fully restore shield
                p.stats.change_shield((int)p.stats.MAX_SHIELD.current());
                p.stats.Shield_raised = true;
            }
            else
            {
                // Updates the player's weapon if necessary
                p.updateWeapons();
            }
        }

        GUI.skin.button.normal.textColor = Color.white;
        GUI.skin.button.fontStyle        = FontStyle.Normal;

        /* Do NOT uncomment!!
         *
         * GUI.enabled = display.stat.pointer_value() > 0;
         * // Decrement a stat value and return the cost of the upgrade
         * if (GUI.Button(display.buttons[1], "-") && GUI.enabled) {
         *      display.stat.decrement();
         *
         *      // Readd cost of the upgrade to player stats
         *      if (display.stat.next_cost() != null) {
         *              p.stats.change_scrap(display.stat.next_cost().scrap_cost);
         *              p.stats.change_ecores(display.stat.next_cost().ecore_cost);
         *      }
         *
         *      // Indicate that the max values of either health or shield changed, so that sliders will update
         *      if (display.stat.type == STAT_TYPE.health) {
         *              p.stats.HP_raised = true;
         *      } else if (display.stat.type == STAT_TYPE.shield) {
         *              p.stats.Shield_raised = true;
         *      }
         * }*/

        GUI.enabled = true;
        // show cost for next upgrade
        GUI.Label(display.labels[1], "cost (scrap | e. cores): " + ((for_next == null) ? "-- | --" : (for_next.scrap_cost + " | " + for_next.ecore_cost)));
        // show current value
        GUI.Label(display.labels[2], "" + display.stat.current());
        // display arrows
        GUI.Label(display.labels[3], ">>");
        // show next value (or '--' if no such element exists)
        GUI.Label(display.labels[4], (is_last) ? "--" : "" + display.stat.next(), lbl_grn_text);
    }