示例#1
0
        public IHttpActionResult DeleteAssetSubType(AssetSubType _AssetSubType)
        {
            string status = string.Empty;

            try
            {
                AssetSubType assetSubType = _PermissionsInboundService.GetAssetSubTypeById(_AssetSubType.Id);
                assetSubType.Deactivate     = "Y";
                assetSubType.DeactivateBy   = _AssetSubType.EnteredBy;
                assetSubType.DeactivateDate = DateTime.Now;
                _PermissionsInboundService.UpdateAssetSubType(assetSubType);
                status = _localizationService.GetResource("Master.API.Success.Message");
            }
            catch (ACSException ex)
            {
                _ILog.LogException("", Severity.ProcessingError, "AssetMasterController.cs", "DeleteAssetSubType", ex);
                status = ex.InnerException.Message;
            }
            catch (Exception ex)
            {
                _ILog.LogException("", Severity.ProcessingError, "AssetMasterController.cs", "DeleteAssetSubType", ex);
                status = ex.InnerException.Message;
            }

            return(Json(status));
        }
示例#2
0
        /// <summary>
        /// Set a Mesh asset on an Avatar i.e change what it's wearing
        /// </summary>
        public void SetMesh(AssetSubType type, SkinnedMeshRenderer skinnedMesh)
        {
            if (mCurrentlyWearing.ContainsKey(type))
            {
                mMeshes.Remove(mCurrentlyWearing[type]);
            }

            mCurrentlyWearing[type] = skinnedMesh;
            mMeshes.Add(skinnedMesh);

            // Update Tri & Vert totals. Also update UvSpaces
            mTotalVertCount = 0;
            mTotalTriCount  = 0;
            mAtlasSpaces.Clear();
            foreach (KeyValuePair <AssetSubType, SkinnedMeshRenderer> kvp in mCurrentlyWearing)
            {
                Mesh assetMesh = kvp.Value.sharedMesh;

                mTotalVertCount += assetMesh.vertices.Length;
                mTotalTriCount  += assetMesh.triangles.Length;
                mAtlasSpaces.Add(mMeshes.IndexOf(kvp.Value), mBodyTexture.GetTextureZoneUvArea(kvp.Key));
            }

            mIsDirty = true;
        }
示例#3
0
        public IHttpActionResult getAssetSubType(int Id)
        {
            try
            {
                AssetSubType assetSubType  = _PermissionsInboundService.GetAssetSubTypeById(Id);
                var          _AssetSubType = new
                {
                    Id        = assetSubType.Id,
                    AssetName = assetSubType.AssetName
                };

                return(Json(_AssetSubType));
            }
            catch (ACSException ex)
            {
                _ILog.LogException("", Severity.ProcessingError, "AssetMasterController.cs", "getAssetSubType", ex);
                return(Json(ex.InnerException));
            }
            catch (Exception ex)
            {
                _ILog.LogException("", Severity.ProcessingError, "AssetMasterController.cs", "getAssetSubType", ex);
                return(Json(ex.InnerException));
            }
            return(null);
        }
示例#4
0
        public ActionResult DeleteConfirmed(int id)
        {
            AssetSubType assetSubType = db.AssetSubTypes.Find(id);

            db.AssetSubTypes.Remove(assetSubType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#5
0
 /// <summary>
 /// Set Color property on a Layer's ColorFilter
 /// </summary>
 public void SetLayerFilterColor(AssetSubType type, Color color)
 {
     if (!mTypeToLayer.ContainsKey(type))
     {
         throw new Exception("AvatarTexture does not have layer for asset type " + type);
     }
     mTexturePalette.SetLayerFilterColor(mTypeToLayer[type], color);
 }
示例#6
0
        /// <summary>
        /// Set the PixelSource of a layer. Get the Source from the AssetRepository
        /// </summary>
        public void SetLayerSource(AssetSubType type, PixelSource source)
        {
            if (!mTypeToLayer.ContainsKey(type))
            {
                throw new Exception("AvatarTexture does not have layer for asset type " + type);
            }

            mTexturePalette.SetLayerPixelSource(mTypeToLayer[type], source);
        }
示例#7
0
        public Rect GetTextureZoneUvArea(AssetSubType assetType)
        {
            if (!mTypeToZone.ContainsKey(assetType))
            {
                throw new Exception("AvatarTexture does not have zone for asset type " + assetType);
            }

            return(mTexturePalette.GetTextureZoneUvArea(mTypeToZone[assetType]));
        }
示例#8
0
 public MeshAsset(AssetSubType type, Mesh mesh, string displayName, string path, string key)
     : base(type, displayName, path, key)
 {
     if (mesh == null)
     {
         throw new ArgumentNullException("mesh");
     }
     mMesh = mesh;
 }
示例#9
0
        public TransformAnimationAsset(AssetSubType assetSubType, AnimationClip animationClip, string name, string path, string key)
            : base(assetSubType, name, path, key)
        {
            if (animationClip == null)
            {
                throw new ArgumentNullException("animationClip");
            }

            mAnimationClip = animationClip;
        }
示例#10
0
        /// <summary>
        /// Set Color property on a Layer's ColorFilter with alpha
        /// </summary>
        public void SetLayerFilterAlpha(AssetSubType type, Color color)
        {
            if (!mTypeToLayer.ContainsKey(type))
            {
                throw new Exception("AvatarTexture does not have layer for asset type " + type);
            }
            Color c = mTexturePalette.GetLayerFilterColor(mTypeToLayer[type]);

            c = new Color(c.r, c.g, c.b, color.a);
            mTexturePalette.SetLayerFilterColor(mTypeToLayer[type], c);
        }
 public void InsertAssetSubType(AssetSubType _AssetSubType)
 {
     _AssetSubType.Deactivate     = "N";
     _AssetSubType.AssetName      = _AssetSubType.AssetName.Trim();
     _AssetSubType.EntryDate      = DateTime.Now;
     _AssetSubType.ModifiedBy     = null;
     _AssetSubType.ModifiedDate   = null;
     _AssetSubType.DeactivateBy   = null;
     _AssetSubType.DeactivateDate = null;
     _AssetSubTypeService.Insert(_AssetSubType);
 }
示例#12
0
 public ActionResult Edit(AssetSubType assetSubType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(assetSubType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AssetTypeID = new SelectList(db.AssetTypes, "ID", "Type", assetSubType.AssetTypeID);
     return(View(assetSubType));
 }
示例#13
0
        public RigAnimationAsset(AssetSubType type, AnimationClip rigAnimationClip, string displayName, string path, string key, RigAnimationName animationName)
            : base(type, displayName, path, key)
        {
            if (rigAnimationClip == null)
            {
                throw new ArgumentNullException("rigAnimationClip");
            }
            mAnimationClip = rigAnimationClip;

            mAnimationName = animationName;
        }
示例#14
0
        public ActionResult Create(AssetSubType assetSubType)
        {
            if (ModelState.IsValid)
            {
                db.AssetSubTypes.Add(assetSubType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.AssetTypeID = new SelectList(db.AssetTypes, "ID", "Type", assetSubType.AssetTypeID);
            return(View(assetSubType));
        }
示例#15
0
    public PersonalAssistantAsset()
    {
        assetName     = "Personal Assistant";
        assetPortrait = GameManager.SingleInstance.App.Model.assetSpritesModel.personalAssistantSprite;
        text          = "Gain +1 Influence. You may reroll 1 die when resolving an influence test.";
        type          = AssetType.Ally;
        subTypes      = new AssetSubType[0];
        cost          = 2;
        artifact      = false;
        magical       = false;
        reckoningText = "";

        ownedInvestigator = null;
    }
    public ArcaneScholarAsset()
    {
        assetName     = "Arcane Scholar";
        assetPortrait = GameManager.SingleInstance.App.Model.assetSpritesModel.arcaneScholarSprite;
        text          = "Gain +1 Lore. You may reroll 1 die when resolving a Lore test.";
        type          = AssetType.Ally;
        subTypes      = new AssetSubType[0];
        cost          = 2;
        artifact      = false;
        magical       = false;
        reckoningText = "";

        ownedInvestigator = null;
    }
示例#17
0
        // GET: AssetSubTypes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AssetSubType assetSubType = db.AssetSubTypes.Find(id);

            if (assetSubType == null)
            {
                return(HttpNotFound());
            }
            return(View(assetSubType));
        }
示例#18
0
    public PrivateInvestigatorAsset()
    {
        assetName     = "Private Investigator";
        assetPortrait = GameManager.SingleInstance.App.Model.assetSpritesModel.privateInvestigatorSprite;
        text          = "Gain +1 Observation. You may reroll 1 die when resolving an observation test.";
        type          = AssetType.Ally;
        subTypes      = new AssetSubType[0];
        cost          = 2;
        artifact      = false;
        magical       = false;
        reckoningText = "";

        ownedInvestigator = null;
    }
示例#19
0
    public WhiskeyAsset()
    {
        assetName     = "Whiskey";
        assetPortrait = GameManager.SingleInstance.App.Model.assetSpritesModel.whiskeySprite;
        text          = "You may discard this card to prevent an investigator on your space from losing up to 2 Sanity.";
        type          = AssetType.Item;
        subTypes      = new AssetSubType[0];
        cost          = 2;
        artifact      = false;
        magical       = false;
        reckoningText = "";

        ownedInvestigator = null;
    }
    public LuckyTalismanAsset()
    {
        assetName     = "Lucky Talisman";
        assetPortrait = GameManager.SingleInstance.App.Model.assetSpritesModel.luckyTalismanSprite;
        text          = "Once per round, you may reroll all of your dice when resolving a test.";
        type          = AssetType.Trinket;
        subTypes      = new AssetSubType[1];
        subTypes[0]   = AssetSubType.Relic;
        cost          = 3;
        artifact      = false;
        magical       = false;
        reckoningText = "";

        ownedInvestigator = null;
    }
示例#21
0
    public AxeAsset()
    {
        assetName     = "Axe";
        assetPortrait = GameManager.SingleInstance.App.Model.assetSpritesModel.axeSprite;
        text          = "Gain +2 Strength during Combat Encounters.  You may spend 2 Sanity to reroll any number of dice when resolving a Strength test during a Combat Encounter.";
        type          = AssetType.Item;
        subTypes      = new AssetSubType[1];
        subTypes[0]   = AssetSubType.Weapon;
        cost          = 2;
        artifact      = false;
        magical       = false;
        reckoningText = "";

        ownedInvestigator = null;
    }
        public string DuplicityCheckAssetSubType(AssetSubType _AssetSubType)
        {
            var dupes = _AssetSubTypeService.Table.Where(x => x.AssetName == _AssetSubType.AssetName &&
                                                         x.Deactivate == "N" &&
                                                         (_AssetSubType.Id != 0 ? x.Id : 0) != (_AssetSubType.Id != 0 ? _AssetSubType.Id : 1)).FirstOrDefault();

            if (dupes != null)
            {
                return("N");
            }
            else
            {
                return("Y");
            }
        }
    public TwinSceptersArtifact()
    {
        assetName     = "Twin Scepters";
        assetPortrait = GameManager.SingleInstance.App.Model.assetSpritesModel.twinSceptersSprite;
        text          = "Gain +4 Strength during Combat Encounters. \n\r Gain +4 Lore when resolving Spell effects.";
        type          = AssetType.Item;
        subTypes      = new AssetSubType[1] {
            AssetSubType.Relic
        };
        artifact      = true;
        magical       = false;
        reckoningText = "";

        ownedInvestigator = null;
    }
示例#24
0
        // GET: AssetSubTypes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AssetSubType assetSubType = db.AssetSubTypes.Find(id);

            if (assetSubType == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AssetTypeID = new SelectList(db.AssetTypes, "ID", "Type", assetSubType.AssetTypeID);
            return(View(assetSubType));
        }
示例#25
0
 public Asset(AssetSubType type, string displayName, string path, string key)
 {
     mAssetType = type;
     if (displayName == null)
     {
         throw new ArgumentNullException("displayName");
     }
     mDisplayName           = displayName;
     mPath                  = path;
     mUniqueKey             = key;
     mClientAssetRepository = GameFacade.Instance.RetrieveProxy <ClientAssetRepository>();
     if (mClientAssetRepository == null)
     {
         throw new Exception("Cannot create assets without an AssetRepository proxy registered in GameFacade");
     }
 }
示例#26
0
        public IHttpActionResult InsertAssetSubType(AssetSubType _AssetSubType)
        {
            string status = "";

            try
            {
                status = _PermissionsInboundService.DuplicityCheckAssetSubType(_AssetSubType);
                if (status == "Y")
                {
                    if (_AssetSubType.Id == 0)
                    {
                        _PermissionsInboundService.InsertAssetSubType(_AssetSubType);
                        status = _localizationService.GetResource("Master.API.Success.Message");
                    }

                    else
                    {
                        AssetSubType assetSubType = _PermissionsInboundService.GetAssetSubTypeById(_AssetSubType.Id);
                        assetSubType.AssetName    = _AssetSubType.AssetName;
                        assetSubType.ModifiedBy   = _AssetSubType.EnteredBy;
                        assetSubType.ModifiedDate = DateTime.Now;
                        _PermissionsInboundService.UpdateAssetSubType(assetSubType);
                        status = _localizationService.GetResource("Master.API.Success.Message");
                    }
                }
                else
                {
                    status = "Duplicate";
                }
            }
            catch (ACSException ex)
            {
                _ILog.LogException("", Severity.ProcessingError, "AssetMasterController.cs", "InsertAssetSubType", ex);
                status = ex.InnerException.Message;
            }
            catch (Exception ex)
            {
                _ILog.LogException("", Severity.ProcessingError, "AssetMasterController.cs", "InsertAssetSubType", ex);
                status = ex.InnerException.Message;
            }
            return(Json(status));
        }
示例#27
0
        public FaceMeshAsset(AssetSubType type, Mesh mesh, string displayName, string path, string key, XmlNode meshInfo)
            : base(type, mesh, displayName, path, key)
        {
            if (mesh == null)
            {
                throw new ArgumentNullException("mesh");
            }

            XmlNode faceMeshInfoNode = meshInfo;

            XmlNodeList uvShellNodes = faceMeshInfoNode.SelectNodes("descendant::UvShell");

            mUvShellCount = uvShellNodes.Count;
            if (mUvShellCount == 0)
            {
                Console.LogError("FaceMeshAsset(): FaceMesh " + DisplayName + " does not have any UvShell info");
                return;
            }
            mUvShellNames     = new string[mUvShellCount];
            mUvGridDimensions = new Vector2[mUvShellCount];
            mTextureZoneNames = new string[mUvShellCount];

            /* foreach UvShell get its data */
            int count = 0;

            foreach (XmlNode uvShellNode in uvShellNodes)
            {
                int subMeshIndex = XmlUtility.GetIntAttribute(uvShellNode, "subMeshIndex");
                mUvShellNames[subMeshIndex]     = XmlUtility.GetStringAttribute(uvShellNode, "name");
                mTextureZoneNames[subMeshIndex] = XmlUtility.GetStringAttribute(uvShellNode, "textureZone");

                int gridWidth  = XmlUtility.GetIntAttribute(uvShellNode, "gridWidth");
                int gridHeight = XmlUtility.GetIntAttribute(uvShellNode, "gridHeight");

                mUvGridDimensions[subMeshIndex] = new Vector2(gridWidth, gridHeight);
                ++count;
            }
        }
        private void ParseItemsFromXml(XmlNode itemIdXml)
        {
            XmlNodeList itemXmlNodes = itemIdXml.SelectNodes("Item");

            foreach (XmlNode itemXmlNode in itemXmlNodes)
            {
                XmlNode itemIdNode = itemXmlNode.SelectSingleNode("Id");
                ItemId  itemId     = new ItemId(Convert.ToUInt32(itemIdNode.InnerText));
                mItemIds.Add(itemId);

                XmlNodeList assetXmlNodes = itemXmlNode.SelectNodes("Assets/Asset");
                foreach (XmlNode assetXmlNode in assetXmlNodes)
                {
                    AssetSubType assetSubType = (AssetSubType)Enum.Parse(typeof(AssetSubType), assetXmlNode.Attributes["AssetSubType"].Value);
                    switch (assetSubType)
                    {
                    case AssetSubType.RoomBackgroundTexture:
                        mRoomBackgroundItemId = itemId;
                        mItemIds.Remove(mRoomBackgroundItemId);
                        break;
                    }
                }
            }
        }
示例#29
0
 public FaceAnimationAsset(AssetSubType type, FaceAnimation faceAnimation, string displayName, string path, string key, FaceAnimationName faceAnimationName)
     : base(type, displayName, path, key)
 {
     mFaceAnimation     = faceAnimation;
     mFaceAnimationName = faceAnimationName;
 }
 public void UpdateAssetSubType(AssetSubType _AssetSubType)
 {
     _AssetSubTypeService.Update(_AssetSubType);
 }