게임 Item 데이터 내부통신을 위한 구조체.
 public void Refresh(ItemInfo info, ItemInfo parentInfo, bool ifEnough = false)
 {
     if (ifEnough)
     {
         this.mListPanel.CheckIfEnough(info);
     }
     else
     {
         this.mListPanel.Refresh(info, parentInfo);
         if (Globals.Instance.AttDB.AwakeRecipeDict.GetInfo(info.ID) == null)
         {
             this.mCreateInfoLayer.gameObject.SetActive(false);
             this.mSourceInfoLayer.gameObject.SetActive(true);
             this.mSourceBG.enabled = true;
             this.mSourceInfoLayer.Refresh(info);
         }
         else
         {
             this.mCreateInfoLayer.gameObject.SetActive(true);
             this.mSourceInfoLayer.gameObject.SetActive(false);
             this.mSourceBG.enabled = false;
             this.mCreateInfoLayer.Refresh(info, parentInfo);
         }
     }
 }
Example #2
0
    public void AddItem()
    {
        if (this.bAddAble == false) return;

        //셋팅된 정보대로 ItemInfo 를 만든다.

        ItemInfo newItemInfo = new ItemInfo();

        newItemInfo.name = inputName.value;             //입력된 이름

        if (inputPopup.value.CompareTo("Type0") == 0 )
            newItemInfo.type = 0;

        else if (inputPopup.value.CompareTo("Type1") == 0)
            newItemInfo.type = 1;

        else if (inputPopup.value.CompareTo("Type2") == 0)
            newItemInfo.type = 2;


        this.itemList.AddItem(newItemInfo);


        //한번 추가된 이후로 중복 추가 안되게.
        this.bAddAble = false;



    }
 public CommonSourceItemData(int sceneID, ItemInfo itemInfo, ulong index)
 {
     this.mSourceType = EItemSource.EISource_SceneLoot;
     this.mSceneID = sceneID;
     this.mItemInfo = itemInfo;
     this.id = index;
 }
        public static bool FindClosestTreeInRadius(Vector3D fromPosition, float radius, out ItemInfo result)
        {
            result = default(ItemInfo);

            BoundingSphereD sphere = new BoundingSphereD(fromPosition, (double)radius);
            var entities = MyEntities.GetEntitiesInSphere(ref sphere);

            double closestDistanceSq = double.MaxValue;

            foreach (MyEntity entity in entities)
            {
                MyTrees trees = entity as MyTrees;
                if (trees == null) continue;

                trees.GetPhysicalItemsInRadius(fromPosition, radius, m_tmpEnvItemList);

                foreach (var tree in m_tmpEnvItemList)
                {
                    double distanceSq = Vector3D.DistanceSquared(fromPosition, tree.Transform.Position);
                    if (distanceSq < closestDistanceSq)
                    {
                        result.ItemsEntityId = entity.EntityId;
                        result.ItemId = tree.LocalId;
                        result.Target = tree.Transform.Position;
                        closestDistanceSq = distanceSq;
                    }
                }
            }

			entities.Clear();

            return closestDistanceSq != double.MaxValue;
        }
Example #5
0
        private void ItemUsedOnBlock(World world, Coordinates3D coordinates, BlockFace face, Coordinates3D cursor, ItemInfo item)
        {
            var info = world.GetBlockInfo(coordinates);
            if (Block.GetIsSolidOnFace(info, face) == false)
                return;
            
            coordinates += MathHelper.BlockFaceToCoordinates(face);

            switch (face)
            {
                case BlockFace.NegativeZ:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingNorth);
                    break;
                case BlockFace.PositiveZ:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingSouth);
                    break;
                case BlockFace.NegativeX:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingWest);
                    break;
                case BlockFace.PositiveX:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingEast);
                    break;
                default:
                    // Ladders can't be placed lying flat.
                    break;
            }
        }
Example #6
0
 public void Init(ItemInfo itemInfo)
 {
     BagIndex = itemInfo.BagIndex;
     Quality = ItemModeLocator.Instance.GetQuality(itemInfo.TmplId);
     DateTime expireTime = Utils.ConvertFromJavaTimestamp(itemInfo.ExpireTime);
     TimeRemain = expireTime.Subtract(DateTime.Now);
 }
Example #7
0
 public Item(int id, bool isEqueped, ItemInfo info)
 {
     this.id = id;
     this.count = 1;
     this.info = info;
     this.isEqueped = isEqueped;
 }
 public void Refresh(PetInfo petInfo, int curPetCount, int needPetCount)
 {
     this.mItemInfo = null;
     this.mPetInfo = petInfo;
     this.mLopetInfo = null;
     this.IsEnough = (curPetCount >= needPetCount);
     if (petInfo != null)
     {
         this.mIcon.gameObject.SetActive(true);
         this.mQualityMask.gameObject.SetActive(true);
         this.mIcon.spriteName = petInfo.Icon;
         this.mQualityMask.spriteName = Tools.GetItemQualityIcon(petInfo.Quality);
     }
     else
     {
         this.mIcon.gameObject.SetActive(false);
         this.mQualityMask.gameObject.SetActive(false);
     }
     this.mSb.Remove(0, this.mSb.Length);
     if (curPetCount < needPetCount)
     {
         this.mSb.Append("[ff0000]");
     }
     else
     {
         this.mSb.Append("[ffffff]");
     }
     this.mSb.Append(curPetCount).Append("[-]/").Append(needPetCount);
     this.mNum.text = this.mSb.ToString();
 }
 public GUITrialRewardItemData(ERewardType et, ItemInfo iInfo, int num, int dNum)
 {
     this.mERewardType = et;
     this.mItemInfo = iInfo;
     this.mItemNum = num;
     this.mDaiBiNum = dNum;
 }
 public void Refresh(ItemInfo itemInfo, bool isMask)
 {
     this.mPetInfo = null;
     this.mItemInfo = itemInfo;
     this.mIsActive = isMask;
     this.Refresh();
 }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = core.Http["key"];

            try
            {
                ItemInfo info = new ItemInfo(core, key);

                // about to redirect, preserve the referer

                string urlreferer = Request.QueryString["urlreferer"];
                if (!string.IsNullOrEmpty(urlreferer))
                {
                    // update the session record
                    db.UpdateQuery(string.Format("UPDATE user_sessions SET session_http_referer = '{2}' WHERE session_string = '{1}' AND session_ip = '{0}';",
                    core.Session.IPAddress.ToString(), core.Session.SessionId, urlreferer));
                }

                core.Http.StatusCode = 301;
                core.Http.ForceDomain = true;
                core.Http.Redirect(info.Uri);
            }
            catch (InvalidIteminfoException)
            {
                core.Functions.Generate404();
            }
            /*catch
            {
                core.Functions.Generate404();
            }*/
        }
 private void Refresh()
 {
     if (this.mLootData != null)
     {
         if (this.mLootData.RewardType == 1)
         {
             this.mItemIcon.spriteName = "M101";
             this.mItemQuality.spriteName = Tools.GetItemQualityIcon(0);
             this.mItemNum.text = this.mLootData.RewardValue1.ToString();
             this.mItemInfo = null;
         }
         else if (this.mLootData.RewardType == 2)
         {
             this.mItemIcon.spriteName = "M102";
             this.mItemQuality.spriteName = Tools.GetItemQualityIcon(2);
             this.mItemNum.text = this.mLootData.RewardValue1.ToString();
             this.mItemInfo = null;
         }
         else if (this.mLootData.RewardType == 3)
         {
             this.mItemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.mLootData.RewardValue1);
             if (this.mItemInfo != null)
             {
                 this.mItemIcon.spriteName = this.mItemInfo.Icon;
                 this.mItemQuality.spriteName = Tools.GetItemQualityIcon(this.mItemInfo.Quality);
                 this.mItemNum.text = this.mLootData.RewardValue2.ToString();
             }
         }
     }
 }
Example #13
0
 public void Init(ItemInfo info, int num, bool showValue, bool showTips)
 {
     this.itemInfo = info;
     this.count = num;
     this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
     if (this.petInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("PetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
         });
         base.gameObject.SetActive(false);
         return;
     }
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality);
     UISprite uISprite = GameUITools.FindUISprite("icon", base.gameObject);
     uISprite.spriteName = this.petInfo.Icon;
     UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
     if (showValue)
     {
         uILabel.text = this.count.ToString();
     }
     else
     {
         uILabel.gameObject.SetActive(false);
     }
     if (showTips)
     {
         UIEventListener expr_FD = UIEventListener.Get(base.gameObject);
         expr_FD.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_FD.onClick, new UIEventListener.VoidDelegate(this.OnRewardClick));
     }
 }
 private void Init(ItemInfo info, int num)
 {
     if (info.Type != 3 || info.SubType != 3)
     {
         global::Debug.LogErrorFormat("Use reward type error {0}", new object[]
         {
             (EItemType)info.Type
         });
         base.gameObject.SetActive(false);
         return;
     }
     this.itemInfo = info;
     this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2);
     if (this.lopetInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("LopetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
         });
         base.gameObject.SetActive(false);
         return;
     }
     UISprite uISprite = GameUITools.FindUISprite("Quality", base.gameObject);
     uISprite.spriteName = Tools.GetItemQualityIcon(this.lopetInfo.Quality);
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = this.lopetInfo.Icon;
     UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
     uILabel.text = string.Format("{0}{1}[-] [FFFFFF]x{2}", Tools.GetItemQualityColorHex(this.lopetInfo.Quality), this.itemInfo.Name, num);
 }
    void OnGUI()
    {
        m_Type = (ItemType)EditorGUILayout.EnumPopup("Item Type", m_Type);
        m_strName = EditorGUILayout.TextField("Name", m_strName);
        m_strDescription = EditorGUILayout.TextField("Description", m_strDescription);

        ScriptableObject target = this;
        SerializedObject so = new SerializedObject(target);
        SerializedProperty sp_picNames = so.FindProperty("m_strPicNames");
        SerializedProperty sp_childItems = so.FindProperty("m_iChildItems");

        EditorGUILayout.PropertyField(sp_picNames, true);
        EditorGUILayout.PropertyField(sp_childItems, true);
        so.ApplyModifiedProperties();


        if (GUILayout.Button("Create"))
        {
            ItemInfo info = new ItemInfo();
            info.m_iID = 0;
            info.m_Type = m_Type;
            info.m_strName = m_strName;
            info.m_strDescription = m_strDescription;
            info.m_iPhotoIDs = m_iPhotoIDs;
            info.m_iChildIDs = m_iChildIDs;

            WriteItemInfo(info);
        }
    }
Example #16
0
 public Item(int id, int count, ItemInfo info)
 {
     this.id = id;
     this.count = count;
     this.info = info;
     this.isEqueped = false;
 }
Example #17
0
    public void SetItemInfo( ItemInfo itemInfo )
    {
        //셋팅된 아이템 정보 물린다.
        this.itemInfo = itemInfo;

        //아이템이 해제되었다면..
        if (this.itemInfo == null)
        {
            this.itemImage.enabled = false;
        }

        //아이템이 셋팅되었다면..
        else
        {
            //ㅅ활성화 시키고
            this.itemImage.enabled = true;

            //셋팅된 아이템 이미지로 교체
            this.itemImage.spriteName =
                ItemInfo.ItemType[this.itemInfo.type];

        }
        

    }
Example #18
0
        public static ItemInfo ParseItemInfo(string itemdata)
        {
            try
            {
                var item = new ItemInfo();
                var sdata = itemdata.Split(',');
                var index = 0;
                item.Id = int.Parse(sdata[index++]);
                item.BotId = int.Parse(sdata[index++]);
                item.Time = float.Parse(sdata[index++]);
                item.ItemType = int.Parse(sdata[index++]);
                item.px = float.Parse(sdata[index++]);
                item.py = float.Parse(sdata[index++]);
                if (sdata.Length > index)
                {
                    item.Itemdata = string.Join(",", sdata, index, sdata.Length - index);
                }
                return item;
            }
            catch (System.Exception)
            {

                return null;
            }
        }
Example #19
0
 public override void InitPopUp(ItemInfo info)
 {
     if (info == null)
     {
         return;
     }
     this.Refresh(info);
 }
Example #20
0
 public static ItemInfo FlyBagItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 5;
     item.Itemdata = "";
     item.ItemName = "FlyBag"; 
     return item;
 }
Example #21
0
 public static ItemInfo BulletItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 4;
     item.Itemdata = "";
     item.ItemName = "Bulllet";
     return item;
 }
Example #22
0
 public static ItemInfo LifeItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 3;
     item.Itemdata = "1";
     item.ItemName = "Life";
     return item;
 }
Example #23
0
 public static ItemInfo BloodItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 2;
     item.Itemdata = "100";
     item.ItemName = "BLood";
     return item;
 }
Example #24
0
 public static ItemInfo WeapontemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 1;
     item.Itemdata = "1:1:1";
     item.ItemName = "Weapon";
     return item;
 }
Example #25
0
 private void Refresh(ItemInfo info)
 {
     this.mEquipIconItem.Refresh(info, false, false, false);
     this.mName.text = info.Name;
     this.mName.color = Tools.GetItemQualityColor(info.Quality);
     this.mNumValue.text = Globals.Instance.Player.ItemSystem.GetItemCount(info.ID).ToString();
     this.mDesc.text = info.Desc;
 }
Example #26
0
 private bool increaseItemCountInInventory(ItemInfo itmInf)
 {
     ItemInfo inventoryItem = items.Find (x => x.itemName == itmInf.itemName);
     Debug.Log (inventoryItem.getAmount ());
     inventoryItem.increaseAmountBy (itmInf.getAmount ());
     Debug.Log (inventoryItem.getAmount ());
     return true;
 }
Example #27
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            Item = null;
            ShowItem = null;

            DisposeCountLabel();
        }
Example #28
0
        void InternalSetSelected(ItemInfo info, bool fromProperty)
        {
            if (info == SelectedInfo) return;

            SelectedInfo = info;

            OnSelectedChanged(fromProperty);
            SelectedChanged.Invoke();
        }
Example #29
0
    protected string DisplayIconImage(ItemInfo item)
    {
        if (item != null && !string.IsNullOrEmpty(item.IconUrl))
        {
            return string.Format("<img alt=\"{1}\" border=\"0\" src=\"{0}\" height=\"90\" width=\"120\" />", item.IconUrl, Util.RemoveHtml(item.Description, 200));
        }

        return string.Empty;
    }
Example #30
0
    //快速添加消费
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        string itemName = this.ItemNameEmpIns.Text.Trim();
        string itemType = this.ItemTypeEmpIns.SelectedValue;
        int catTypeId = Convert.ToInt32(this.CatTypeEmpIns.SelectedValue);
        string itemPrice = this.ItemPriceEmpIns.Text.Trim();
        DateTime itemBuyDate = Convert.ToDateTime(this.ItemBuyDateEmpIns.Text.Trim() + " " + DateTime.Now.ToString("HH:mm:ss"));
        int cardId = Convert.ToInt32(this.CardEmpIns.SelectedValue);

        if (itemName == "")
        {
            Utility.Alert(this, "商品名称未填写!");
            return;
        }

        Response.Cookies["CatTypeID"].Value = catTypeId.ToString();
        Response.Cookies["CatTypeID"].Expires = DateTime.MaxValue;

        Response.Cookies["CardID"].Value = cardId.ToString();
        Response.Cookies["CardID"].Expires = DateTime.MaxValue;

        if (!ValidHelper.CheckDouble(itemPrice))
        {
            Utility.Alert(this, "商品价格填写错误!");
            return;
        }

        ItemInfo item = new ItemInfo();
        item.ItemType = itemType;
        item.ItemName = itemName;
        item.CategoryTypeID = catTypeId;
        item.ItemPrice = Convert.ToDecimal(itemPrice);
        item.ItemBuyDate = itemBuyDate;
        item.UserID = userId;
        item.RegionID = 0;
        item.RegionType = "";
        item.Synchronize = 1;
        item.ZhuanTiID = ztId;
        item.ModifyDate = DateTime.Now;
        item.CardID = cardId;

        bool success = item_bll.InsertItem(item);
        if (success)
        {
            Session["TodayDate"] = itemBuyDate.ToString("yyyy-MM-dd");
            this.ItemNameEmpIns.Text = "";
            this.ItemPriceEmpIns.Text = "";

            List.EditIndex = -1;
            BindGrid();
        }
        else
        {
            Utility.Alert(this, "添加失败!");
            return;
        }
    }