Esempio n. 1
0
        public static void ApplyTileInfoToObject(CharacterTileScreenExtender.TileMetadata tileInfo, GameObject target)
        {
            try
            {
                //for new game, these details gets applied later when patch calls ApplyTileInfoDeferred()
                TileInfo     = tileInfo;
                TargetObject = target;

                //for other cases (such as opening a wish menu in game), the following applies changes immediately:
                ApplyTileToEffects(target, tileInfo.Tile);
                target.pRender.Tile        = tileInfo.Tile;
                target.pRender.DetailColor = tileInfo.DetailColor;
                target.pRender.TileColor   = $"&{tileInfo.ForegroundColor}";
                target.pRender.ColorString = $"&{tileInfo.ForegroundColor}";

                //updates the Character Creation Complete screen buffer to show the new tile
                if (CreateCharacterBuffer != null && CustomTileWriteCoords != null && TargetObject != null)
                {
                    CreateCharacterBuffer.Goto(CustomTileWriteCoords.X, CustomTileWriteCoords.Y);
                    CreateCharacterBuffer.Write("{{y|[}}");
                    CreateCharacterBuffer.Write(TargetObject.pRender);
                    CreateCharacterBuffer.Write("{{y|]}}");
                }
            }
            catch (Exception ex)
            {
                Utilities.Logger.Log($"(Error) Failed to apply custom tile to body [{ex}]");
            }
        }
Esempio n. 2
0
 public static void ResetTileInfo()
 {
     TileInfo              = null;
     TargetObject          = null;
     CreateCharacterBuffer = null;
     CustomTileWriteCoords = null;
 }