// Token: 0x060002B5 RID: 693 RVA: 0x00016B94 File Offset: 0x00014D94
        public static float GetRenderQueue(string matName)
        {
            float result;

            try
            {
                Dictionary <int, KeyValuePair <string, float> > dictionary = PrivateAccessor.Get <Dictionary <int, KeyValuePair <string, float> > >(typeof(ImportCM), "m_hashPriorityMaterials");
                int hashCode = matName.GetHashCode();
                KeyValuePair <string, float> keyValuePair;
                if (dictionary == null || !dictionary.TryGetValue(hashCode, out keyValuePair))
                {
                    result = -1f;
                }
                else if (keyValuePair.Key == matName)
                {
                    result = keyValuePair.Value;
                }
                else
                {
                    result = -1f;
                }
            }
            catch (Exception ex)
            {
                LogUtil.Error(new object[]
                {
                    "failed to get pmat field.",
                    ex
                });
                result = 0f;
            }
            return(result);
        }
 // Token: 0x060002AA RID: 682 RVA: 0x0001683C File Offset: 0x00014A3C
 private Hashtable GetMaskTable()
 {
     if (!(this.CurrentMaid == null))
     {
         return(PrivateAccessor.Get <Hashtable>(this.CurrentMaid.body0, "m_hFoceHide"));
     }
     return(null);
 }
Exemplo n.º 3
0
        // Token: 0x06000283 RID: 643 RVA: 0x00015F50 File Offset: 0x00014150
        static MaidChangeDetector()
        {
            int num = PrivateAccessor.Get <int>(typeof(TBody), "strSlotNameItemCnt");

            if (num <= 0)
            {
                num = 3;
            }
            MaidChangeDetector.SLOT_COUNT = TBody.m_strDefSlotName.Length / num;
        }
        static MaidChangeDetector()
        {
            var cnt = PrivateAccessor.Get <int>(typeof(TBody), "strSlotNameItemCnt");

            if (cnt <= 0)
            {
                cnt = 3;
            }
            SLOT_COUNT = TBody.m_strDefSlotName.Length / cnt;
        }
        private MaidHolder()
        {
            MaidName = string.Empty;
            int cnt = PrivateAccessor.Get <int>(typeof(TBody), "strSlotNameItemCnt");

            if (cnt <= 0)
            {
                cnt = 3;
            }
            SLOT_COUNT = TBody.m_strDefSlotName.Length / cnt;
        }
        // Token: 0x0600028F RID: 655 RVA: 0x00016078 File Offset: 0x00014278
        private MaidHolder()
        {
            this.MaidName = string.Empty;
            int num = PrivateAccessor.Get <int>(typeof(TBody), "strSlotNameItemCnt");

            if (num <= 0)
            {
                num = 3;
            }
            this._slotCount = TBody.m_strDefSlotName.Length / num;
        }
        private void DetectTarget(Func <int, Maid> GetMaid, int maidCount)
        {
            for (var i = 0; i < maidCount; i++)
            {
                var maid = GetMaid(i);

                if (maid == null || maid.IsAllProcPropBusy)
                {
                    continue;
                }
                if (SLOT_COUNT != maid.body0.goSlot.Count)
                {
                    continue;                                        // 公式外のメイドを除外
                }
                var maidId = maid.GetInstanceID();
                if (!IsEnabled(maid))
                {
                    cache.Remove(maidId);
                    continue;
                }
                MenuCache mc;
                if (!cache.TryGetValue(maidId, out mc))
                {
                    var props = PrivateAccessor.Get <MaidProp[]>(maid, "m_aryMaidProp");
                    if (props != null)
                    {
                        mc = new MenuCache();
                        mc.SetProps(props);
                        cache[maidId] = mc;
                    }

                    continue;
                }

//                var maidProps = PrivateAccessor.Get<MaidProp[]>(maid, "m_aryMaidProp");
                for (var mpn = (int)MPN.body; mpn < mc.maidProps.Length; mpn++)
                {
                    var prop = mc.maidProps[mpn];
                    if (mc.menuIds[mpn] == prop.nFileNameRID)
                    {
                        continue;
                    }

                    var mpn1 = mpn;
                    LogUtil.Debug(() => "Item changed [" + (MPN)mpn1 + "] " + mc.maidProps[mpn1].strFileName);
                    mc.menuIds[mpn] = prop.nFileNameRID;
                    foreach (var notifier in notifiers)
                    {
                        notifier(maid, prop);
                    }
                }
            }
        }
Exemplo n.º 8
0
 // Token: 0x06000282 RID: 642 RVA: 0x00015DA0 File Offset: 0x00013FA0
 private void DetectTarget(Func <int, Maid> GetMaid, int maidCount)
 {
     for (int i = 0; i < maidCount; i++)
     {
         Maid maid = GetMaid(i);
         if (!(maid == null) && !maid.IsAllProcPropBusy && MaidChangeDetector.SLOT_COUNT == maid.body0.goSlot.Count)
         {
             int instanceID = maid.GetInstanceID();
             MaidChangeDetector.MenuCache mc;
             if (!this.IsEnabled(maid))
             {
                 MaidChangeDetector.cache.Remove(instanceID);
             }
             else if (!MaidChangeDetector.cache.TryGetValue(instanceID, out mc))
             {
                 MaidProp[] array = PrivateAccessor.Get <MaidProp[]>(maid, "m_aryMaidProp");
                 if (array != null)
                 {
                     mc = new MaidChangeDetector.MenuCache();
                     mc.SetProps(array);
                     MaidChangeDetector.cache[instanceID] = mc;
                 }
             }
             else
             {
                 for (int j = 43; j < mc.maidProps.Length; j++)
                 {
                     MaidProp maidProp = mc.maidProps[j];
                     if (mc.menuIds[j] != maidProp.nFileNameRID)
                     {
                         int mpn1 = j;
                         LogUtil.Debug(() => string.Concat(new object[]
                         {
                             "Item changed [",
                             (MPN)mpn1,
                             "] ",
                             mc.maidProps[mpn1].strFileName
                         }));
                         mc.menuIds[j] = maidProp.nFileNameRID;
                         foreach (Action <Maid, MaidProp> action in this.notifiers)
                         {
                             action(maid, maidProp);
                         }
                     }
                 }
             }
         }
     }
 }
 public static float GetRenderQueue(string matName)
 {
     try {
         var priorityMaterials = PrivateAccessor.Get <Dictionary <int, KeyValuePair <string, float> > >(typeof(ImportCM), "m_hashPriorityMaterials");
         KeyValuePair <string, float> kvPair;
         var hashCode = matName.GetHashCode();
         if (priorityMaterials != null && priorityMaterials.TryGetValue(hashCode, out kvPair))
         {
             if (kvPair.Key == matName)
             {
                 return(kvPair.Value);
             }
         }
         return(-1f);
     } catch (Exception e) {
         LogUtil.Error("failed to get pmat field.", e);
         return(0f);
     }
 }
 private Hashtable GetMaskTable()
 {
     return(currentMaid == null
         ? null
         : PrivateAccessor.Get <Hashtable>(currentMaid.body0, "m_hFoceHide"));
 }