Ejemplo n.º 1
0
            internal static void ExtendedHousingLoad(CraftInfo info)
            {
                if (info == null)
                {
                    return; // TODO: check if this case needs debug logging message.
                }
                if (Sideloader.DebugLoggingResolveInfo.Value)
                {
                    Sideloader.Logger.LogInfo($"Resolving Extended Save Game");
                }

                PluginData ExtendedData = ExtendedSave.GetExtendedDataById(info, UARExtID);

                if (ExtendedData != null)
                {
                    var ResolvedInfo = ((Dictionary <int, byte[]>)ExtendedData.data[mapItemInfoKey]);
                    int index        = 0;
                    HousingObjectIteration(info.ObjectInfos, ref index, (item, i) =>
                    {
                        if (!ResolvedInfo.TryGetValue(i, out byte[] bytes))
                        {
                            return;
                        }
                        var extResolve = AIGameResolveInfo.Deserialize(bytes);
                        if (extResolve == null)
                        {
                            return;
                        }
                        item.ID = extResolve.Slot;
                        ResolveHousingFurniture(extResolve, item);
                    });
Ejemplo n.º 2
0
        internal static void ResolveHousingFurniture(AIGameResolveInfo extResolve, OIItem OI, ResolveType resolveType = ResolveType.Load)
        {
            AIGameResolveInfo intResolve = LoadedMainGameResolutionInfo.FirstOrDefault(x => x.ResolveItem && x.Slot == extResolve.Slot && x.GUID == extResolve.GUID); // originally OI.ID, maybe something gotta be changed related with hard mod compatibility?

            if (intResolve != null)
            {
                if (resolveType == ResolveType.Load && Sideloader.DebugLogging.Value)
                {
                    Sideloader.Logger.LogDebug($"Resolving (Main-Game Furniture) [{extResolve.GUID}] {OI.ID}->{intResolve.LocalSlot}");
                }
                OI.ID = intResolve.LocalSlot;
            }
            else if (resolveType == ResolveType.Load)
            {
                ShowGUIDError(extResolve.GUID); // TODO: does craft menu is fault proof?
            }
        }