Beispiel #1
0
    void ShowImage(string name, GUIBase_Widget image)
    {
        GUIBase_Widget widget = Layout.GetWidget(name);

        widget.CopyMaterialSettings(image);
        widget.Show(true, true);
    }
Beispiel #2
0
    void SetImage(string name, GUIBase_Widget image)
    {
        GUIBase_Widget widget = Layout.GetWidget(name);

        if (image != null)
        {
            widget.CopyMaterialSettings(image);
        }
        widget.Show(image != null ? true : false, true);
    }
    // ------
    public void SetCurrentWeapon()
    {
        if (LocalPlayer == null || LocalPlayer.Owner == null || LocalPlayer.Owner.WeaponComponent == null)
        {
            return;
        }

        E_WeaponID w = LocalPlayer.Owner.WeaponComponent.CurrentWeapon;

        if (w == E_WeaponID.None || CurrentWeapon == w)
        {
            return;
        }

        CurrentWeapon = w;

        WeaponSettings s = WeaponSettingsManager.Instance.Get(w);

        WeaponLabel.SetNewText(s.Name);
        WeaponIcon.CopyMaterialSettings(s.HudWidget);
        UpdateAmmoDisplay();
        UpdatePlayerWeapons();
    }