Exemplo n.º 1
0
 public static void Trash()
 {
     if (HamHelpers.InValidSellArea() &&
         ToggleAutoSell && ToggleVendorTrash && Mod.Enabled)
     {
         long gold = 0;
         foreach (ItemEntity item in ItemSlotHelper.ItemsToRemove(out gold))
         {
             if (TrashItemsKeep.ContainsKey(item.Blueprint.AssetGuid))
             {
                 Game.Instance.Player.Inventory.Remove(item, item.Count - TrashItemsKeep[item.Blueprint.AssetGuid]);
             }
             else
             {
                 Game.Instance.Player.Inventory.Remove(item, item.Count);
             }
         }
         Game.Instance.Player.GainMoney(gold);
         LogItemData data = new LogItemData($"{gold} gold made from autoselling trash loot!", GameLogStrings.Instance.DefaultColor, null, PrefixIcon.None, new List <LogChannel>
         {
             LogChannel.None
         });
         Game.Instance.UI.BattleLogManager.LogView.AddLogEntry(data, false);
     }
 }
Exemplo n.º 2
0
    public void onShowProfile(BLOKUSProfile profile)
    {
        foreach (GameObject gameObject in playerGameLogList)
        {
            Destroy(gameObject);
        }
        playerGameLogList.Clear();

        BLOKUSRankItem bLOKUSRankItem2 = profile.twoPlayersRankItem;
        BLOKUSRankItem bLOKUSRankItem4 = profile.fourPlayersRankItem;

        profileRankScoreText2.text    = bLOKUSRankItem2.rankScore + "";
        profileRecordDetailText2.text = "win:" + bLOKUSRankItem2.winCount +
                                        "   lose:" + bLOKUSRankItem2.loseCount + "   escape:" + bLOKUSRankItem2.escapeCount;
        profileRankScoreText4.text    = bLOKUSRankItem4.rankScore + "";
        profileRecordDetailText4.text = "win:" + bLOKUSRankItem4.winCount +
                                        "   lose:" + bLOKUSRankItem4.loseCount + "   escape:" + bLOKUSRankItem4.escapeCount;

        foreach (BLOKUSPlayerGameLogItem gameLogItem in profile.playerGameLogs)
        {
            GameObject logItemObject = Instantiate(LogItem, playerGameLogContent.transform, false);
            playerGameLogList.Add(logItemObject);

            LogItemData logItemData = logItemObject.GetComponent <LogItemData>();
            if ("win".Equals(gameLogItem.result))
            {
                logItemData.resultText.color = new UnityEngine.Color(0.2588F, 0.6549F, 0.2274F, 1);
            }
            else if ("lose".Equals(gameLogItem.result))
            {
                logItemData.resultText.color = new UnityEngine.Color(0.9411F, 0.098F, 0.098F, 1);
            }
            else
            {
                logItemData.resultText.color = new UnityEngine.Color(1, 0.6862F, 0.047F, 1);
            }
            logItemData.result     = gameLogItem.result;
            logItemData.stepsCount = gameLogItem.stepsCount + "";
            if (GameType.BLOKUS_FOUR == gameLogItem.gameType)
            {
                logItemData.gameType = "4 players";
            }
            else
            {
                logItemData.gameType = "2 players";
            }
            logItemData.detail = gameLogItem.detail;
            logItemData.time   = gameLogItem.time;
            logItemData.score  = gameLogItem.changeScore + "";
            logItemData.ShowGameLogInfo();
        }
    }
Exemplo n.º 3
0
        public static void AddLogEntry(string message, Color color, bool gameDefaultColour = true)
        {
            GameModeType currentGameMode = Game.Instance.CurrentMode;

            if (Main.settings.toggleAddToLog == Storage.isTrueString && (currentGameMode == GameModeType.Default || currentGameMode == GameModeType.Pause))
            {
                if (gameDefaultColour)
                {
                    color = GameLogStrings.Instance.DefaultColor;
                }

                LogItemData logItemData = new LogItemData(message, GameLogStrings.Instance.DefaultColor, null, PrefixIcon.None, new List <LogChannel> {
                    LogChannel.None
                });
                Game.Instance.UI.BattleLogManager.LogView.AddLogEntry(logItemData);
            }
        }
Exemplo n.º 4
0
        /// <summary>Adds a message to the battle log</summary>
        /// <param name="message">Message to add</param>
        /// <param name="tooltip">Secondary object or <see cref="String" /> for the tooltip to display</param>
        /// <param name="color"><see cref="Color" /> to use to render <paramref name="message" /></param>
        public void AddBattleLogMessage(string message, object tooltip = null, Color?color = null)
        {
#if PATCH21
            var data = new LogItemData(message, color ?? GameLogStrings.Instance.DefaultColor, tooltip, PrefixIcon.None, new List <LogChannel> {
                LogChannel.Combat
            });
#else
            var data = new LogDataManager.LogItemData(message, color ?? GameLogStrings.Instance.DefaultColor, tooltip, PrefixIcon.None);
#endif
            if (Game.Instance.UI.BattleLogManager)
            {
                Game.Instance.UI.BattleLogManager.LogView.AddLogEntry(data);
            }
            else
            {
                Main.PendingLogItems.Add(data);
            }
        }