public HeroVirtualTabletopMainViewModelImpl(IEventAggregator eventAggregator, CrowdMemberExplorerViewModel crowdMemberExplorerViewModel,
                                             RosterExplorerViewModel rosterExplorerViewModel, CharacterEditorViewModel characterEditorViewModel, IdentityEditorViewModel identityEditorViewModel,
                                             AbilityEditorViewModel abilityEditorViewModel, MovementEditorViewModel movementEditorViewModel, ActiveCharacterWidgetViewModel activeCharacterWidgetViewModel,
                                             AttackConfigurationWidgetViewModel attackConfigurationWidgetViewModel, PopupService popupService,
                                             IconInteractionUtility iconInteractionUtility, DesktopContextMenu desktopContextMenu, Camera camera)
 {
     this.eventAggregator = eventAggregator;
     this.CrowdMemberExplorerViewModel       = crowdMemberExplorerViewModel;
     this.RosterExplorerViewModel            = rosterExplorerViewModel;
     this.CharacterEditorViewModel           = characterEditorViewModel;
     this.IdentityEditorViewModel            = identityEditorViewModel;
     this.AbilityEditorViewModel             = abilityEditorViewModel;
     this.MovementEditorViewModel            = movementEditorViewModel;
     this.ActiveCharacterWidgetViewModel     = activeCharacterWidgetViewModel;
     this.AttackConfigurationWidgetViewModel = attackConfigurationWidgetViewModel;
     this.iconInteractionUtility             = iconInteractionUtility;
     this.camera             = camera;
     this.popupService       = popupService;
     this.desktopContextMenu = desktopContextMenu;
     RegisterPopups();
     gameInitializeTimer = new System.Threading.Timer(gameInitializeTimer_Callback, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
     LaunchGame();
     this.eventAggregator.Subscribe(this);
     //this.eventAggregator.GetEvent<AddToRosterEvent>().Subscribe((IEnumerable<CrowdMemberModel> models) => { this.IsRosterExplorerExpanded = true; });
     //this.eventAggregator.GetEvent<EditCharacterEvent>().Subscribe((Tuple<ICrowdMemberModel, IEnumerable<ICrowdMemberModel>> tuple) => { this.IsCharacterEditorExpanded = true; });
     //this.eventAggregator.GetEvent<EditIdentityEvent>().Subscribe((Tuple<Identity, Character> tuple) => { this.IsIdentityEditorExpanded = true; });
     //this.eventAggregator.GetEvent<EditAbilityEvent>().Subscribe((Tuple<AnimatedAbility, Character> tuple) => { this.IsAbilityEditorExpanded = true; });
     //this.eventAggregator.GetEvent<EditMovementEvent>().Subscribe((CharacterMovement cm) => { this.IsMovementEditorExpanded = true; });
     //this.eventAggregator.GetEvent<CreateCrowdFromModelsEvent>().Subscribe((CrowdModel crowd) => { this.IsCrowdFromModelsExpanded = true; });
     //this.eventAggregator.GetEvent<AttackInitiatedEvent>().Subscribe((Tuple<Character, Attack> tuple) => { this.IsRosterExplorerExpanded = true; });
 }
Exemple #2
0
        public DesktopMouseHoverElementImpl(IconInteractionUtility iconInteractionUtility)
        {
            this.iconInteractionUtility = iconInteractionUtility;
            MemoryManager memMan = new MemoryManagerImpl(false);

            this.desktopMemoryCharacter = new DesktopMemoryCharacterImpl(memMan);
        }
Exemple #3
0
        private Vector3 GetCollisionVector(Vector3 sourceVector, Vector3 destVector)
        {
            float   distance        = Vector3.Distance(sourceVector, destVector);
            Vector3 collisionVector = new Vector3(0, 0, 0);
            int     numRetry        = 3; // try 3 times

            while (numRetry > 0)
            {
                try
                {
                    var collisionInfo = IconInteractionUtility.GetCollisionInfo(sourceVector.X, sourceVector.Y, sourceVector.Z, destVector.X, destVector.Y, destVector.Z);
                    collisionVector = Helper.GetCollisionVector(collisionInfo);
                    float collisionDistance = Vector3.Distance(sourceVector, collisionVector);
                    if (!HasCollision(collisionVector) || collisionDistance <= distance) // proper collision
                    {
                        break;
                    }
                }
                catch (Exception ex)
                {
                    System.Threading.Thread.Sleep(500);
                    numRetry--;
                }
            }
            if (float.IsNaN(collisionVector.X) || float.IsNaN(collisionVector.Y) || float.IsNaN(collisionVector.Z))
            {
                collisionVector = new Vector3(0, 0, 0);
            }
            return(collisionVector);
        }
        public string CompleteEvent(bool preventLoadCostumeWithoutTarget = true)
        {
            string command = string.Empty;
            string generatedKeyBindText = string.Empty;

            command = PopEvents();

            //if (preventLoadCostumeWithoutTarget)
            //{
            //    // HACK: Prevent loading costume without targetting first
            //    if (command.Contains(keyBindsStrings[GameEvent.LoadCostume]))
            //    {
            //        var loadCostumeIndex = command.IndexOf("$$loadcostume");
            //        if (loadCostumeIndex > 0)
            //        {
            //            var prevCommand = command.Substring(0, loadCostumeIndex);
            //            if (string.IsNullOrEmpty(prevCommand) || !prevCommand.Contains(keyBindsStrings[GameEvent.TargetName]))
            //            {
            //                return "";
            //            }
            //        }
            //        else
            //            return "";
            //    }
            //}
            // Another HACK: Prevent executing multiple targeting in a chain
            IconInteractionUtility.ExecuteCmd(command);

            return(command);
        }
Exemple #5
0
        private void LaunchGame()
        {
            bool directoryExists = CheckGameDirectory();

            if (!directoryExists)
            {
                SetGameDirectory();
            }

            LoadMainView();
            //logService.Info("Launching game...");
            //IconInteractionUtility.RunCOHAndLoadDLL(Module.Shared.Settings.Default.CityOfHeroesGameDirectory);
            IconInteractionUtility.InitializeGame(Module.Shared.Settings.Default.CityOfHeroesGameDirectory);
            gameInitializeTimer.Change(50, System.Threading.Timeout.Infinite);
        }
Exemple #6
0
        private void gameInitializeTimer_Callback(object state)
        {
            bool gameLoaded = IconInteractionUtility.IsGameLoaded();

            if (gameLoaded)
            {
                System.Threading.Thread.Sleep(1000);
                IconInteractionUtility.DoPostInitialization();
                DoPostGameLaunchOperations();
                gameInitializeTimer.Change(System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
            }
            else
            {
                gameInitializeTimer.Change(100, System.Threading.Timeout.Infinite);
            }
        }
Exemple #7
0
 public MouseElement()
 {
     HoveredInfo = IconInteractionUtility.GeInfoFromNpcMouseIsHoveringOver();
 }
Exemple #8
0
 public DesktopNavigatorImpl(IconInteractionUtility iconInteractionUtility)
 {
     this.CityOfHeroesInteractionUtility = iconInteractionUtility;
 }
 public KeyBindCommandGeneratorImpl(IconInteractionUtility iconInteractor)
 {
     _iconInteracter = iconInteractor;
 }
Exemple #10
0
        private void LoadRequiredKeybinds()
        {
            CheckRequiredKeybindsFileExists();

            IconInteractionUtility.ExecuteCmd("bindloadfile required_keybinds.txt");
        }