Ejemplo n.º 1
0
    public BuildModeHUDController()
    {
        view = UnityEngine.Object.Instantiate(Resources.Load <GameObject>("BuildModeHUD")).GetComponent <BuildModeHUDView>();

        view.name = "_BuildModeHUD";
        view.gameObject.SetActive(false);

        catalogItemDropController = new CatalogItemDropController();

        buildModeEntityListController = view.GetComponentInChildren <BuilderInWorldEntityListController>();
        buildModeEntityListController = view.entityListController;
        entityInformationController   = view.entityInformationController;

        entityInformationController.OnPositionChange           += (x) => OnSelectedObjectPositionChange?.Invoke(x);
        entityInformationController.OnRotationChange           += (x) => OnSelectedObjectRotationChange?.Invoke(x);
        entityInformationController.OnScaleChange              += (x) => OnSelectedObjectScaleChange?.Invoke(x);
        entityInformationController.OnNameChange               += (entity, newName) => OnEntityRename?.Invoke(entity, newName);
        entityInformationController.OnSmartItemComponentUpdate += (entity) => OnEntitySmartItemComponentUpdate?.Invoke(entity);

        catalogItemDropController.catalogGroupListView = view.catalogGroupListView;
        catalogItemDropController.catalogGroupListView = view.catalogGroupListView;

        buildModeEntityListController.OnEntityClick            += (x) => OnEntityClick(x);
        buildModeEntityListController.OnEntityDelete           += (x) => OnEntityDelete(x);
        buildModeEntityListController.OnEntityLock             += (x) => OnEntityLock(x);
        buildModeEntityListController.OnEntityChangeVisibility += (x) => OnEntityChangeVisibility(x);
        buildModeEntityListController.OnEntityRename           += (entity, newName) => OnEntityRename(entity, newName);

        buildModeEntityListController.CloseList();

        view.OnCatalogItemDrop                += () => catalogItemDropController.CatalogitemDropped();
        view.OnChangeModeAction               += () => OnChangeModeAction?.Invoke();
        view.OnExtraBtnsClick                 += ChangeVisibilityOfExtraBtns;
        view.OnControlsVisibilityAction       += ChangeVisibilityOfControls;
        view.OnChangeUIVisbilityAction        += ChangeVisibilityOfUI;
        view.OnSceneLimitInfoChangeVisibility += ChangeVisibilityOfSceneInfo;
        view.OnSceneLimitInfoControllerChangeVisibilityAction += ChangeVisibilityOfSceneInfo;
        view.OnSceneCatalogControllerChangeVisibilityAction   += ChangeVisibilityOfCatalog;


        view.OnTranslateSelectionAction += () => OnTranslateSelectedAction?.Invoke();
        view.OnRotateSelectionAction    += () => OnRotateSelectedAction?.Invoke();
        view.OnScaleSelectionAction     += () => OnScaleSelectedAction?.Invoke();
        view.OnResetSelectedAction      += () => OnResetAction?.Invoke();
        view.OnDuplicateSelectionAction += () => OnDuplicateSelectedAction?.Invoke();
        view.OnDeleteSelectionAction    += () => OnDeleteSelectedAction?.Invoke();

        catalogItemDropController.OnCatalogItemDropped += CatalogItemSelected;
        view.OnCatalogItemSelected += CatalogItemSelected;
        view.OnStopInput           += () => OnStopInput?.Invoke();
        view.OnResumeInput         += () => OnResumeInput?.Invoke();


        view.OnEntityListChangeVisibilityAction += () => ChangeVisibilityOfEntityList();

        view.OnTutorialAction += () => OnTutorialAction?.Invoke();
        view.OnPublishAction  += () => OnPublishAction?.Invoke();
        view.OnLogoutAction   += () => OnLogoutAction?.Invoke();
    }
Ejemplo n.º 2
0
 private void ConfigureTopActionsButtonsController()
 {
     controllers.topActionsButtonsController.OnChangeModeClick += () => OnChangeModeAction?.Invoke();
     controllers.topActionsButtonsController.OnExtraClick      += ChangeVisibilityOfExtraBtns;
     controllers.topActionsButtonsController.OnTranslateClick  += () => OnTranslateSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnRotateClick     += () => OnRotateSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnScaleClick      += () => OnScaleSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnResetClick      += () => OnResetAction?.Invoke();
     controllers.topActionsButtonsController.OnDuplicateClick  += () => OnDuplicateSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnDeleteClick     += () => OnDeleteSelectedAction?.Invoke();
     controllers.topActionsButtonsController.OnLogOutClick     += () => OnLogoutAction?.Invoke();
     controllers.topActionsButtonsController.extraActionsController.OnControlsClick += ChangeVisibilityOfControls;
     controllers.topActionsButtonsController.extraActionsController.OnHideUIClick   += ChangeVisibilityOfUI;
     controllers.topActionsButtonsController.extraActionsController.OnTutorialClick += () => OnTutorialAction?.Invoke();
 }
Ejemplo n.º 3
0
        public virtual void ResetFromGround()
        {
            ClearRange();

            X = Zone.CalculPin((uint)HomePosition.X, true);
            Y = Zone.CalculPin((uint)HomePosition.Y, false);
            Z = HomePosition.Z;

            WorldPosition.X = HomePosition.X;
            WorldPosition.Y = HomePosition.Y;
            WorldPosition.Z = HomePosition.Z;

            SetOffset((ushort)(HomePosition.X >> 12), (ushort)(HomePosition.Y >> 12));

            // Object already visible so we must manually update range
            SetHeldState(EHeldState.Home);

            Region.UpdateRange(this, true);

            OnResetAction?.Invoke(this);
        }
Ejemplo n.º 4
0
        public override void ResetFromGround()
        {
            X = Zone.CalculPin((uint)HomePosition.X, true);
            Y = Zone.CalculPin((uint)HomePosition.Y, false);
            Z = HomePosition.Z;

            OnLoad();

            WorldPosition.X = HomePosition.X;
            WorldPosition.Y = HomePosition.Y;
            WorldPosition.Z = HomePosition.Z;

            SetOffset((ushort)(HomePosition.X >> 12), (ushort)(HomePosition.Y >> 12));

            SetHeldState(EHeldState.Inactive);

            foreach (Player plr in Region.Players)
            {
                plr.SendClientMessage($"The supplies from {Objective.ObjectiveName} have decayed. New supplies will be sent.", Objective.OwningRealm == Realms.REALMS_REALM_ORDER ? ChatLogFilters.CHATLOGFILTERS_C_ORDER_RVR_MESSAGE : ChatLogFilters.CHATLOGFILTERS_C_DESTRUCTION_RVR_MESSAGE);
            }

            OnResetAction?.Invoke(this);
        }
Ejemplo n.º 5
0
        public void ResetTo(EHeldState newState)
        {
            if (MyBuff != null)
            {
                MyBuff.BuffHasExpired = true;
                MyBuff = null;
            }

            if (HeldState == newState)
            {
                return;
            }

            SetHeldState(newState);

            if (Holder == null)
            {
                ClearRange();
            }

            X = Zone.CalculPin((uint)HomePosition.X, true);
            Y = Zone.CalculPin((uint)HomePosition.Y, false);
            Z = HomePosition.Z;

            WorldPosition.X = HomePosition.X;
            WorldPosition.Y = HomePosition.Y;
            WorldPosition.Z = HomePosition.Z;

            SetOffset((ushort)(WorldPosition.X >> 12), (ushort)(WorldPosition.Y >> 12));

            Region.UpdateRange(this, true);

            OnResetAction?.Invoke(this);

            Holder = null;
        }
Ejemplo n.º 6
0
    private void ConfigureTopActionsButtonsController()
    {
        controllers.topActionsButtonsController.OnChangeModeClick += () => OnChangeModeAction?.Invoke();
        controllers.topActionsButtonsController.OnExtraClick      += ChangeVisibilityOfExtraBtns;
        controllers.topActionsButtonsController.OnTranslateClick  += () => OnTranslateSelectedAction?.Invoke();
        controllers.topActionsButtonsController.OnRotateClick     += () => OnRotateSelectedAction?.Invoke();
        controllers.topActionsButtonsController.OnScaleClick      += () => OnScaleSelectedAction?.Invoke();
        controllers.topActionsButtonsController.OnUndoClick       += () => OnUndoAction?.Invoke();
        controllers.topActionsButtonsController.OnRedoClick       += () => OnRedoAction?.Invoke();
        controllers.topActionsButtonsController.OnDuplicateClick  += () => OnDuplicateSelectedAction?.Invoke();
        controllers.topActionsButtonsController.OnDeleteClick     += () => OnDeleteSelectedAction?.Invoke();
        controllers.topActionsButtonsController.OnSnapModeClick   += () => OnChangeSnapModeAction?.Invoke();
        controllers.topActionsButtonsController.OnLogOutClick     += ExitStart;
        controllers.topActionsButtonsController.extraActionsController.OnControlsClick    += ChangeVisibilityOfControls;
        controllers.topActionsButtonsController.extraActionsController.OnHideUIClick      += ChangeVisibilityOfUI;
        controllers.topActionsButtonsController.extraActionsController.OnResetClick       += () => OnResetAction?.Invoke();
        controllers.topActionsButtonsController.extraActionsController.OnTutorialClick    += () => OnTutorialAction?.Invoke();
        controllers.topActionsButtonsController.extraActionsController.OnResetCameraClick += () => OnResetCameraAction?.Invoke();

        controllers.topActionsButtonsController.extraActionsController.SetResetButtonInteractable(false);
    }