Ejemplo n.º 1
0
        private void HotbarItemVechicleRemoteOverlayControl_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            WindowVehicleRemoteControl.Open(this.item);

            ClientInteractionUISystem.Register(
                Api.Client.Characters.CurrentPlayerCharacter,
                WindowVehicleRemoteControl.instance,
                onMenuClosedByClient:
                () =>
            {
                this.viewModel.UpdateIcon();
            });
        }
        protected override void ClientItemUseStart(ClientItemData data)
        {
            if (data.PrivateState.VehicleID == 0)
            {
                WindowVehicleRemoteControl.Open(data.Item);
            }
            else
            {
                var character = Api.Client.Characters.CurrentPlayerCharacter;
                if (!CharacterEnergySystem.SharedHasEnergyCharge(character, this.EngeryUse))
                {
                    CharacterEnergySystem.ClientShowNotificationNotEnoughEnergyCharge(this);
                    return;
                }

                VehicleRemoteSystem.Instance.ClientTryStartAction();
            }
        }