Example #1
0
        private static void AddTooltip(ItemDetailsDisplay __instance, String val)
        {
            List <ItemDetailRowDisplay> tooltip = Fields.INSTANCE.TOOLTIP.GetValue(__instance);

            ItemDetailRowDisplay statRow = Methods.INSTANCE.ItemDetailsDisplay_GetRow.Call(__instance, new object[] { tooltip.Count });

            statRow.SetInfo("", val);

            Fields.INSTANCE.TOOLTIP.SetValue(__instance, tooltip);
        }
Example #2
0
        static bool ItemDetailRowDisplay_SetInfo_Pre(ItemDetailRowDisplay __instance, string _dataName, float _dataValue)
        {
            #region quit
            if (!_effectivenessAffectsAllStats)
            {
                return(true);
            }
            #endregion

            __instance.SetInfo(_dataName, _dataValue.Round(), false, null);
            return(false);
        }
Example #3
0
        private static void AddStatTooltip(ItemDetailsDisplay __instance, String stat, string val)
        {
            List <ItemDetailRowDisplay> tooltip = Fields.INSTANCE.TOOLTIP.GetValue(__instance);

            ItemDetailRowDisplay statRow = Methods.INSTANCE.ItemDetailsDisplay_GetRow.Call(__instance, new object[] { tooltip.Count });

            statRow.SetInfo(stat, val);

            ItemDetailRowDisplay durability = tooltip[tooltip.Count - 2];

            //tooltip[tooltip.Count - 2] = statRow;
            //tooltip[tooltip.Count - 1] = durability;

            Fields.INSTANCE.TOOLTIP.SetValue(__instance, tooltip);
        }
 public static void RefreshDetail(ItemDetailsDisplay __instance, int _rowIndex, DisplayedInfos _infoType)
 {
     try
     {
         if (_infoType != DisplayedInfos.Durability)
         {
             return;
         }
         Item m_lastItem = (Item)AccessTools.Field(typeof(ItemDetailsDisplay), "m_lastItem").GetValue(__instance);
         if (m_lastItem.IsPerishable && m_lastItem.CurrentDurability > 0)
         {
             ItemDetailRowDisplay row = (ItemDetailRowDisplay)AccessTools.Method(typeof(ItemDetailsDisplay), "GetRow").Invoke(__instance, new object[] { _rowIndex });
             Text m_lblDataName       = (Text)AccessTools.Field(typeof(ItemDetailRowDisplay), "m_lblDataName").GetValue(row);
             row.SetInfo(m_lblDataName.text, GameTimetoDays(m_lastItem.CurrentDurability / m_lastItem.PerishScript.DepletionRate));
         }
     }
     catch (Exception ex)
     {
         InnRentStash.MyLogger.LogError("RefreshDetail: " + ex.Message);
     }
 }