示例#1
0
        public float DrawShopIcon(PointF position, bool seleceted, ShopIcon shopIcon, SizeF size)
        {
            if (shopIcon == ShopIcon.None)
            {
                return(0f);
            }

            GetShopIconFromEnum(shopIcon, out var iconNormal, out var iconHover);
            NativeFunctions.DrawSprite("commonmenu", seleceted ? iconHover : iconNormal, position + new SizeF(15, 18),
                                       size);
            return(34f);
        }
 public NativeMenuUnmanagedListItem(string text, string description, object value, ShopIcon shopIcon) : base(text, description, value, shopIcon)
 {
     Init();
 }
示例#3
0
 public NativeMenuItemBase(string text, string description, object value, ShopIcon shopIcon) :
     this(text, description, value)
 {
     ShopIcon = shopIcon;
 }
示例#4
0
        private static void GetShopIconFromEnum(ShopIcon icon, out string a, out string b)
        {
            switch (icon)
            {
            case ShopIcon.None:
                a = string.Empty;
                b = string.Empty;
                break;

            case ShopIcon.ShopTrevorIcon:
                a = "shop_trevor_icon_a";
                b = "shop_travor_icon_b";
                break;

            case ShopIcon.ShopTickIcon:
                a = "shop_tick_icon";
                b = "shop_tick_icon";
                break;

            case ShopIcon.ShopTattoosIcon:
                a = "shop_tattoos_icon_a";
                b = "shop_tattoos_icon_b";
                break;

            case ShopIcon.ShopNewStar:
                a = "shop_new_star";
                b = "shop_new_star";
                break;

            case ShopIcon.ShopMichaelIcon:
                a = "shop_michael_icon_a";
                b = "shop_michael_icon_b";
                break;

            case ShopIcon.ShopMaskIcon:
                a = "shop_mask_icon_a";
                b = "shop_mask_icon_b";
                break;

            case ShopIcon.ShopMakeupIcon:
                a = "shop_makeup_icon_a";
                b = "shop_makeup_icon_b";
                break;

            case ShopIcon.ShopLock:
                a = "shop_lock";
                b = "shop_lock";
                break;

            case ShopIcon.ShopHealthIcon:
                a = "shop_health_icon_a";
                b = "shop_health_icon_b";
                break;

            case ShopIcon.ShopGunClubIcon:
                a = "shop_gunclub_icon_a";
                b = "shop_gunclub_icon_b";
                break;

            case ShopIcon.ShopGarageIcon:
                a = "shop_garage_icon_a";
                b = "shop_garage_icon_b";
                break;

            case ShopIcon.ShopGarageBikeIcon:
                a = "shop_garage_bike_icon_a";
                b = "shop_garage_bike_icon_b";
                break;

            case ShopIcon.ShopFranklinIcon:
                a = "shop_franklin_icon_a";
                b = "shop_franklin_icon_b";
                break;

            case ShopIcon.ShopClothingIcon:
                a = "shop_clothing_icon_a";
                b = "shop_clothing_icon_b";
                break;

            case ShopIcon.ShopBarberIcon:
                a = "shop_barber_icon_a";
                b = "shop_barber_icon_b";
                break;

            case ShopIcon.ShopArmorIcon:
                a = "shop_armour_icon_a";
                b = "shop_armour_icon_b";
                break;

            case ShopIcon.ShopAmmoIcon:
                a = "shop_ammo_icon_a";
                b = "shop_ammo_icon_b";
                break;

            case ShopIcon.ShopBoxTick:
                a = "shop_box_tick";
                b = "shop_box_tickb";
                break;

            case ShopIcon.ShopBoxCross:
                a = "shop_box_cross";
                b = "shop_box_cross_b";
                break;

            case ShopIcon.ShopBoxBlank:
                a = "shop_box_blank";
                b = "shop_box_blankb";
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(icon), icon, null);
            }
        }
示例#5
0
    void UpdateIcon(ShopIcon sIcon)
    {
        Weapon wp = null;
        if (sIcon.weapon == null)
        {
            sIcon.image.sprite = m_spriteNone;
            sIcon.effect.sprite = m_spriteNone;
            sIcon.cost.text = "";
        }
        else
        {
            wp = sIcon.weapon.GetComponent<Weapon>();

            if (wp == null)
            {
                Debug.LogError("Weapon prefab is not added.", sIcon.weapon);
            }
            else
            {
                switch (wp.m_swingType)
                {
                    case WeaponSwing.LIGHT:
                        sIcon.image.sprite = m_iconDagger;
                        break;
                    case WeaponSwing.MEDIUM:
                        sIcon.image.sprite = m_iconSword;
                        break;
                    case WeaponSwing.HEAVY:
                        sIcon.image.sprite = m_iconAxe;
                        break;
                }

            }
            sIcon.effect.sprite = GetEffectSprite(wp.m_attack.m_effectType);
            sIcon.cost.text = wp.m_goldCost.ToString();
        }
    }
示例#6
0
    // Update is called once per frame
    void Update()
    {
        if (m_shopCanves.activeSelf == true)
        {
            if (m_es.currentSelectedGameObject != null && m_isActive)
            {
                if (Input.GetButtonDown("Cancel"))
                    OnCloseShop();
            }
            /*//DEBUG TO DISABLE
            if (Input.GetKeyDown(KeyCode.P))
            {
                ProgressIcons();
            }
            //DEBUG TO DISABLE
            if (Input.GetKeyDown(KeyCode.O))
            {
                ActivateShop();
            }
            //DEBUG TO DISABLE
            if (Input.GetKeyDown(KeyCode.I))
            {
                m_needsUpdateing = true;
                UpdateShop();
            }
            //DEBUG TO DISABLE
            if (Input.GetKeyDown(KeyCode.U))
            {
                UpdateAllIcons();
            }*/

            if (m_es.currentSelectedGameObject == null)
            {
                m_es.SetSelectedGameObject(m_newItem1.gameObject);
            }

            if (m_selected == null)
            {
                m_selected = m_es.currentSelectedGameObject.GetComponent<ShopIcon>();
                //m_lastObjectSelected = m_es.currentSelectedGameObject;
            }

            if ( m_es.currentSelectedGameObject != m_selected.gameObject)
            {
                if (m_es.currentSelectedGameObject != null)
                {
                    m_selected = m_es.currentSelectedGameObject.GetComponent<ShopIcon>();
                }

                UpdateCompareIcons();
            }

            if (m_playersWeapon != PlayerInventory.Inst.m_currentWeapon)
            {
                m_playersWeapon = PlayerInventory.Inst.m_currentWeapon;

                UpdateCompareIcons();
            }

        }
    }
示例#7
0
 public NativeMenuListItem(string text, string description, object[] value, int index, ShopIcon shopIcon) : base(text, description, value, shopIcon)
 {
     Init(value, index);
 }
 public NativeMenuCheckboxItem(string text, string description, bool value, ShopIcon shopIcon) : base(text,
                                                                                                      description, value, shopIcon)
 {
     Checked = value;
 }