示例#1
0
    // public method
    // link component
    public void LinkComponentElement()
    {
        // link structure
        manager      = GameObject.FindWithTag("GameLogic").GetComponent <GameManager>();
        storeManager = GameObject.FindWithTag("GameLogic").GetComponent <StoreManager>();

        // button
        buttonSet = transform.Find("ButtonSet").gameObject;
        buttonSet.SetActive(false);
        furnitureSetUI      = transform.Find("FurnitureSetUI").gameObject;
        furnitureSetUILogic = furnitureSetUI.GetComponent <StorageUI>();
    }
示例#2
0
 void Awake()
 {
     if (_instance == null)
     {
         _instance = this;
         DontDestroyOnLoad(this.gameObject);
         _listSlotEquipment = new List <ItemUIScript>();
         _listSlotItem      = new List <ItemUIScript>();
         _listSlotGem       = new List <ItemUIScript>();
     }
     else
     {
         DestroyImmediate(this.gameObject);
     }
 }
示例#3
0
    // public method
    // link element component
    public void LinkComponentElement()
    {
        // link structure
        manager = GameObject.FindWithTag("GameLogic").GetComponent <GameManager>();

        // link element component
        storeUI      = transform.Find("StoreUI").gameObject;
        storeUILogic = storeUI.GetComponent <StoreUI>();
        storeUILogic.LinkComponentElement();

        storageUI      = transform.Find("StorageUI").gameObject;
        storageUILogic = storageUI.GetComponent <StorageUI>();

        storeCustomizingSet      = transform.Find("CustomizeUI").gameObject;
        storeCustomizingSetLogic = storeCustomizingSet.GetComponent <CustomizeUI>();
        storeCustomizingSetLogic.LinkComponentElement();

        createUI      = transform.Find("CreateUI").gameObject;
        createUILogic = createUI.GetComponent <CreateUI>();

        sellItemSettingUI      = transform.Find("SellItemSettingUI").gameObject;
        sellItemSettingUILogic = sellItemSettingUI.GetComponent <SellItemSettingUI>();

        furnitureMarketUI      = transform.Find("FurnitureMarketUI").gameObject;
        furnitureMarketUILogic = furnitureMarketUI.GetComponent <FurnitureMarketUI>();

        stageUI      = transform.Find("StageUI").gameObject;
        stageUILogic = stageUI.GetComponent <StageUI>();

        resultRewardUI      = transform.Find("ResultRewardUI").gameObject;
        resultRewardUILogic = resultRewardUI.GetComponent <ResultRewardUI>();

        resultUI      = transform.Find("ResultUI").gameObject;
        resultUILogic = resultUI.GetComponent <ResultUI>();

        chatSceneUI      = transform.Find("ChatScene").gameObject;
        chatSceneUILogic = chatSceneUI.GetComponent <ChatSceneUI>();

        characterCreateUI      = transform.Find("CharacterCreateUI").gameObject;
        characterCreateUILogic = characterCreateUI.GetComponent <CharacterCreateUI>();

        questUI      = transform.Find("QuestUI").gameObject;
        questUILogic = questUI.GetComponent <QuestUI>();
        questUILogic.LinkComponentElement();

        loadingScene = transform.Find("LoadingScene").gameObject;
    }
示例#4
0
    private IEnumerator WaitForInit()
    {
        MEHoloEntrance entrance = MEHoloEntrance.Instance;

        while (!entrance.HasInit)
        {
            yield return(null);
        }

        storageManager = StorageManager.Instance;
        inputManager   = MultiInputManager.Instance;
        cursor         = UIManager.Instance.cursorController;

        storageManager.TurnOn();

        inputManager.cbTap = OnTap;

        storageUI = storageManager.GetUI();
    }
示例#5
0
        public static bool SetStationStorage_Prefix(PlanetTransport __instance, int stationId, int storageIdx, int itemId, int itemCountMax, ELogisticStorage localLogic, ELogisticStorage remoteLogic)
        {
            if (Multiplayer.IsActive && !Multiplayer.Session.Ships.PatchLockILS)
            {
                StationComponent stationComponent = __instance.stationPool[stationId];

                if (stationComponent != null)
                {
                    StorageUI packet = new StorageUI(__instance.planet.id, stationComponent.id, stationComponent.gid, storageIdx, itemId, itemCountMax, localLogic, remoteLogic);
                    Multiplayer.Session.Network.SendPacket(packet);
                }

                if (Multiplayer.Session.LocalPlayer.IsHost)
                {
                    return(true);
                }

                return(false);
            }
            return(true);
        }
示例#6
0
        public CoreUI(OpCore core)
        {
            Core = core;

            // load menus for loaded services
            foreach (var service in Core.ServiceMap.Values)
            {
                var id = service.ServiceID;

                if (id == ServiceIDs.Board)
                {
                    Services[id] = new BoardUI(this, service);
                }

                if (id == ServiceIDs.Buddy)
                {
                    Services[id] = new BuddyUI(this, service);
                }

                if (id == ServiceIDs.Chat)
                {
                    Services[id] = new ChatUI(this, service);
                }

                if (id == ServiceIDs.IM)
                {
                    Services[id] = new IMUI(this, service);
                }

                if (id == ServiceIDs.Mail)
                {
                    Services[id] = new MailUI(this, service);
                }

                if (id == ServiceIDs.Plan)
                {
                    Services[id] = new PlanUI(this, service);
                }

                if (id == ServiceIDs.Profile)
                {
                    Services[id] = new ProfileUI(this, service);
                }

                if (id == ServiceIDs.Share)
                {
                    Services[id] = new ShareUI(this, service);
                }

                if (id == ServiceIDs.Storage)
                {
                    Services[id] = new StorageUI(this, service);
                }

                if (id == ServiceIDs.Trust)
                {
                    Services[id] = new TrustUI(this, service);
                }
            }

            Core.RunInGui      += Core_RunInGui;
            Core.UpdateConsole += Core_UpdateConsole;
            Core.ShowConfirm   += Core_ShowConfirm;
            Core.ShowMessage   += Core_ShowMessage;
            Core.VerifyPass    += Core_VerifyPass;

            Core_UpdateConsole("DeOps " + Application.ProductVersion);
        }
示例#7
0
        public static void EntityFastFillIn_Postfix(PlanetFactory __instance, int entityId)
        {
            // belt, splitter, monitor, miner, fractionator, piler: handle by BeltFastFillIn
            // storage: sync in StorageComponent.AddItemStacked
            // inserter, powerNode, powerCon, powerAcc: no fill in interaction

            if (Multiplayer.IsActive && entityId > 0 && __instance.entityPool[entityId].id == entityId)
            {
                EntityData entityData = __instance.entityPool[entityId];

                if (entityData.tankId > 0)
                {
                    int             tankId   = entityData.tankId;
                    TankComponent[] tankPool = __instance.factoryStorage.tankPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new TankStorageUpdatePacket(in tankPool[tankId], __instance.planetId));
                }
                if (entityData.assemblerId > 0)
                {
                    int assemblerId = entityData.assemblerId;
                    AssemblerComponent[] assemblerPool = __instance.factorySystem.assemblerPool;
                    if (assemblerPool[assemblerId].recipeId > 0)
                    {
                        Multiplayer.Session.Network.SendPacketToLocalStar(new AssemblerUpdateStoragePacket(__instance.planetId, assemblerId, assemblerPool[assemblerId].served, assemblerPool[assemblerId].incServed));
                    }
                }
                if (entityData.ejectorId > 0)
                {
                    int ejectorId = entityData.ejectorId;
                    EjectorComponent[] ejectorPool = __instance.factorySystem.ejectorPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new EjectorStorageUpdatePacket(ejectorId, ejectorPool[ejectorId].bulletCount, ejectorPool[ejectorId].bulletInc, __instance.planetId));
                }
                if (entityData.siloId > 0)
                {
                    int             siloId   = entityData.siloId;
                    SiloComponent[] siloPool = __instance.factorySystem.siloPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new SiloStorageUpdatePacket(siloId, siloPool[siloId].bulletCount, siloPool[siloId].bulletInc, __instance.planetId));
                }
                if (entityData.labId > 0)
                {
                    int            labId   = entityData.labId;
                    LabComponent[] labPool = __instance.factorySystem.labPool;

                    if (labPool[labId].researchMode)
                    {
                        for (int matrixId = 0; matrixId < LabComponent.matrixIds.Length; matrixId++)
                        {
                            Multiplayer.Session.Network.SendPacketToLocalStar(new LaboratoryUpdateCubesPacket(labPool[labId].matrixServed[matrixId], labPool[labId].matrixIncServed[matrixId], matrixId, labId, __instance.planetId));
                        }
                    }
                    else if (labPool[labId].matrixMode)
                    {
                        for (int m = 0; m < labPool[labId].served.Length; m++)
                        {
                            Multiplayer.Session.Network.SendPacketToLocalStar(new LaboratoryUpdateStoragePacket(labPool[labId].served[m], labPool[labId].incServed[m], m, labId, __instance.planetId));
                        }
                    }
                }
                if (entityData.stationId > 0)
                {
                    int stationId = entityData.stationId;
                    StationComponent stationComponent = __instance.transport.stationPool[stationId];
                    for (int i = 0; i < stationComponent.storage.Length; i++)
                    {
                        if (stationComponent.storage[i].itemId > 0)
                        {
                            StorageUI packet = new StorageUI(__instance.planetId, stationComponent.id, stationComponent.gid, i, stationComponent.storage[i].count, stationComponent.storage[i].inc);
                            Multiplayer.Session.Network.SendPacket(packet);
                        }
                    }
                    if (!stationComponent.isCollector && !stationComponent.isVeinCollector)
                    {
                        StationUI packet = new StationUI(__instance.planetId, stationComponent.id, stationComponent.gid, StationUI.EUISettings.SetDroneCount, stationComponent.idleDroneCount + stationComponent.workDroneCount);
                        Multiplayer.Session.Network.SendPacket(packet);
                    }
                    if (stationComponent.isStellar && !stationComponent.isCollector && !stationComponent.isVeinCollector)
                    {
                        StationUI packet = new StationUI(__instance.planetId, stationComponent.id, stationComponent.gid, StationUI.EUISettings.SetShipCount, stationComponent.idleShipCount + stationComponent.workShipCount);
                        Multiplayer.Session.Network.SendPacket(packet);
                    }
                    if (stationComponent.isStellar && !stationComponent.isCollector && !stationComponent.isVeinCollector && __instance.gameData.history.logisticShipWarpDrive)
                    {
                        StationUI packet = new StationUI(__instance.planetId, stationComponent.id, stationComponent.gid, StationUI.EUISettings.SetWarperCount, stationComponent.warperCount);
                        Multiplayer.Session.Network.SendPacket(packet);
                    }
                }
                if (entityData.powerGenId > 0)
                {
                    int powerGenId = entityData.powerGenId;
                    PowerGeneratorComponent[] genPool = __instance.powerSystem.genPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new PowerGeneratorFuelUpdatePacket(powerGenId, genPool[powerGenId].fuelId, genPool[powerGenId].fuelCount, genPool[powerGenId].fuelInc, __instance.planetId));
                    if (genPool[powerGenId].gamma)
                    {
                        Multiplayer.Session.Network.SendPacketToLocalStar(new RayReceiverChangeLensPacket(powerGenId, genPool[powerGenId].catalystPoint, genPool[powerGenId].catalystIncPoint, __instance.planetId));
                    }
                }
                if (entityData.powerExcId > 0)
                {
                    int powerExcId = entityData.powerExcId;
                    PowerExchangerComponent[] excPool = __instance.powerSystem.excPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new PowerExchangerStorageUpdatePacket(powerExcId, excPool[powerExcId].emptyCount, excPool[powerExcId].fullCount, __instance.planetId));
                }
                if (entityData.spraycoaterId > 0)
                {
                    int spraycoaterId = entityData.spraycoaterId;
                    SpraycoaterComponent[] spraycoaterPool = __instance.cargoTraffic.spraycoaterPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new SprayerStorageUpdatePacket(spraycoaterPool[spraycoaterId], __instance.planetId));
                }
            }
        }
示例#8
0
        public static void EntityFastTakeOut_Postfix(PlanetFactory __instance, int entityId)
        {
            // belt, splitter, monitor, piler: handle by BeltFastTakeOut
            // storage: sync in StorageComponent.TakeItemFromGrid
            // powerNode, powerCon, powerAcc: no fill in interaction

            if (Multiplayer.IsActive && entityId > 0 && __instance.entityPool[entityId].id == entityId)
            {
                EntityData entityData = __instance.entityPool[entityId];

                if (entityData.assemblerId > 0)
                {
                    int assemblerId = entityData.assemblerId;
                    AssemblerComponent[] assemblerPool = __instance.factorySystem.assemblerPool;
                    if (assemblerPool[assemblerId].recipeId > 0)
                    {
                        int[] produced = assemblerPool[assemblerId].produced;
                        for (int j = 0; j < produced.Length; j++)
                        {
                            Multiplayer.Session.Network.SendPacketToLocalStar(new AssemblerUpdateProducesPacket(j, produced[j], __instance.planetId, assemblerId));
                        }
                    }
                }
                if (entityData.ejectorId > 0)
                {
                    int ejectorId = entityData.ejectorId;
                    EjectorComponent[] ejectorPool = __instance.factorySystem.ejectorPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new EjectorStorageUpdatePacket(ejectorId, ejectorPool[ejectorId].bulletCount, ejectorPool[ejectorId].bulletInc, __instance.planetId));
                }
                if (entityData.inserterId > 0)
                {
                    int inserterId = entityData.inserterId;
                    InserterComponent[] inserterPool = __instance.factorySystem.inserterPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new InserterItemUpdatePacket(in inserterPool[inserterId], __instance.planetId));
                }
                if (entityData.fractionatorId > 0)
                {
                    int fractionatorId = entityData.fractionatorId;
                    FractionatorComponent[] fractionatorPool = __instance.factorySystem.fractionatorPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new FractionatorStorageUpdatePacket(in fractionatorPool[fractionatorId], __instance.planetId));
                }
                if (entityData.labId > 0)
                {
                    int            labId   = entityData.labId;
                    LabComponent[] labPool = __instance.factorySystem.labPool;
                    if (labPool[labId].matrixMode)
                    {
                        Multiplayer.Session.Network.SendPacketToLocalStar(new LaboratoryUpdateEventPacket(-3, labId, __instance.planetId));
                    }
                }
                if (entityData.minerId > 0)
                {
                    int minerId = entityData.minerId;
                    MinerComponent[] minerPool = __instance.factorySystem.minerPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new MinerStoragePickupPacket(minerId, __instance.planetId));
                }
                if (entityData.powerExcId > 0)
                {
                    int powerExcId = entityData.powerExcId;
                    PowerExchangerComponent[] excPool = __instance.powerSystem.excPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new PowerExchangerStorageUpdatePacket(powerExcId, excPool[powerExcId].emptyCount, excPool[powerExcId].fullCount, __instance.planetId));
                }
                if (entityData.powerGenId > 0)
                {
                    int powerGenId = entityData.powerGenId;
                    PowerGeneratorComponent[] genPool = __instance.powerSystem.genPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new PowerGeneratorFuelUpdatePacket(powerGenId, genPool[powerGenId].fuelId, genPool[powerGenId].fuelCount, genPool[powerGenId].fuelInc, __instance.planetId));
                    if (genPool[powerGenId].productId > 0)
                    {
                        Multiplayer.Session.Network.SendPacketToLocalStar(new PowerGeneratorProductUpdatePacket(in genPool[powerGenId], __instance.planetId));
                    }
                }
                if (entityData.stationId > 0)
                {
                    int stationId = entityData.stationId;
                    StationComponent stationComponent = __instance.transport.stationPool[stationId];
                    for (int i = 0; i < stationComponent.storage.Length; i++)
                    {
                        if (stationComponent.storage[i].itemId > 0)
                        {
                            StorageUI packet = new StorageUI(__instance.planetId, stationComponent.id, stationComponent.gid, i, stationComponent.storage[i].count, stationComponent.storage[i].inc);
                            Multiplayer.Session.Network.SendPacket(packet);
                        }
                    }
                    if (!stationComponent.isCollector && !stationComponent.isVeinCollector)
                    {
                        StationUI packet = new StationUI(__instance.planetId, stationComponent.id, stationComponent.gid, StationUI.EUISettings.SetDroneCount, stationComponent.idleDroneCount + stationComponent.workDroneCount);
                        Multiplayer.Session.Network.SendPacket(packet);
                    }
                    if (stationComponent.isStellar && !stationComponent.isCollector && !stationComponent.isVeinCollector)
                    {
                        StationUI packet = new StationUI(__instance.planetId, stationComponent.id, stationComponent.gid, StationUI.EUISettings.SetShipCount, stationComponent.idleShipCount + stationComponent.workShipCount);
                        Multiplayer.Session.Network.SendPacket(packet);
                    }
                    if (stationComponent.isStellar && !stationComponent.isCollector && !stationComponent.isVeinCollector && __instance.gameData.history.logisticShipWarpDrive)
                    {
                        StationUI packet = new StationUI(__instance.planetId, stationComponent.id, stationComponent.gid, StationUI.EUISettings.SetWarperCount, stationComponent.warperCount);
                        Multiplayer.Session.Network.SendPacket(packet);
                    }
                }
                if (entityData.siloId > 0)
                {
                    int             siloId   = entityData.siloId;
                    SiloComponent[] siloPool = __instance.factorySystem.siloPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new SiloStorageUpdatePacket(siloId, siloPool[siloId].bulletCount, siloPool[siloId].bulletInc, __instance.planetId));
                }
                if (entityData.tankId > 0)
                {
                    int             tankId   = entityData.tankId;
                    TankComponent[] tankPool = __instance.factoryStorage.tankPool;
                    Multiplayer.Session.Network.SendPacketToLocalStar(new TankStorageUpdatePacket(in tankPool[tankId], __instance.planetId));
                }
            }
        }
示例#9
0
 private void Awake()
 {
     _border    = transform.GetChild(0);
     _myStorage = transform.parent.GetComponent <StorageUI>();
 }