Beispiel #1
0
 public static void PatchGameTime_Bind(PlayerChapter __instance)
 {
     try
     {
         PatchGoldAmount(__instance);
     }
     catch (Exception ex)
     {
         _instance._logger.Error("Error patching gold amount: " + ex);
     }
 }
Beispiel #2
0
        private static void PatchGoldAmount(PlayerChapter chapter)
        {
            var          patcher    = _instance._patcher;
            InventoryExt extension1 = chapter.Owner.GetExtension <InventoryExt>();

            var goldText = patcher.GetField <LocalizedText>(chapter, "m_goldText");

            int resource1        = extension1.GetResource(GameData.Instance.GoldResource);
            int goldRetainAmount = Game.Instance.ResourceManager.GetGoldRetainAmount(resource1);

            goldText.Text = resource1 < 0 || Game.Instance.Mode != Game.GameMode.Story ?
                            "{" + resource1.ToString() + "}" :
                            string.Format("{0} {{{1}}}", resource1, goldRetainAmount);
        }