Example #1
0
        public bool Initialize(Engine engine)
        {
            this.engine = engine;
            if (!TryOpenMpq(out mpq))
            {
                OnFailedInitialize?.Invoke();
                waitForInitialized.SetResult(false);
                waitForInitialized = new();
                return(false);
            }
            coroutineManager    = new();
            NotificationsCenter = new NotificationsCenter(this);
            TimeManager         = new TimeManager(this);
            ScreenSpaceSelector = new ScreenSpaceSelector(this);
            DbcManager          = new DbcManager(this, databaseClientFileOpener);
            CurrentMap          = DbcManager.MapStore.FirstOrDefault(m => m.Id == 1) ?? Map.Empty;
            TextureManager      = new WoWTextureManager(this);
            MeshManager         = new WoWMeshManager(this);
            MdxManager          = new MdxManager(this);
            WmoManager          = new WmoManager(this);
            ChunkManager        = new ChunkManager(this);
            CameraManager       = new CameraManager(this);
            LightingManager     = new LightingManager(this);
            AreaTriggerManager  = new AreaTriggerManager(this);
            RaycastSystem       = new RaycastSystem(engine);
            ModuleManager       = new ModuleManager(this, gameView); // must be last

            OnInitialized?.Invoke();
            IsInitialized = true;
            waitForInitialized.SetResult(true);
            return(true);
        }
Example #2
0
 public Startup(IConfiguration configuration, IServiceFacade facade, ILogger <Startup> logger,
                NotificationsCenter notificationsCenter, PipelineManager pipelineManager
                , SystemInitializer systemInitializer)
 {
     Configuration        = configuration;
     _facade              = facade;
     _logger              = logger;
     _notificationsCenter = notificationsCenter;
     _pipelineManager     = pipelineManager;
     _systemInitializer   = systemInitializer;
 }
 public WorldManager(IGameFiles gameFiles,
                     IGameContext gameContext,
                     CameraManager cameraManager,
                     NotificationsCenter notificationsCenter,
                     AreaTableStore areaTableStore)
 {
     this.gameFiles           = gameFiles;
     this.gameContext         = gameContext;
     this.cameraManager       = cameraManager;
     this.notificationsCenter = notificationsCenter;
     this.areaTableStore      = areaTableStore;
 }
Example #4
0
 private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         int    id   = int.Parse(mascotas.Rows[mascotas.SelectedRows[0].Index].Cells["MascotaID"].Value.ToString());
         string name = mascotas.Rows[mascotas.SelectedRows[0].Index].Cells["Mascota"].Value.ToString();
         CurrentPet.SetCurrentPet(new CurrentPet(id, name, 0, ""));
         handlePetRegister();
         PetNote.Enabled = true;
     }
     catch (Exception ex)
     {
         NotificationsCenter.ShowErrorMessageForException(ex);
     }
 }
Example #5
0
        private void DangerPetIndicator_OnChange(object sender, EventArgs e)
        {
            try
            {
                var petRegister = new PetRegister(CurrentClient.GetID(), CurrentPet.GetID().Value, DangerPetIndicator.Checked ? "Mascota marcada como peligrosa" : "Mascota marcada como no peligrosa", DateTime.Now, "Rojo");
                if (sqlHelper.SavePetRegister(petRegister))
                {
                    NotificationsCenter.ShowSucessMessage("Registro guardado", DangerPetIndicator.Checked ? "Mascota marcada como peligrosa" : "Mascota marcada como no peligrosa");
                }
                else
                {
                    NotificationsCenter.ShowErrorMessage("Error intentando guardar el registro.");
                }

                handlePetRegister();
            }
            catch (Exception exception)
            {
                NotificationsCenter.ShowErrorMessageForException(exception);
            }
        }
        public bool Initialize()
        {
            var gameFiles = ResolveOrCreate <IGameFiles>();

            if (!gameFiles.Initialize())
            {
                return(false);
            }
            coroutineManager = new();

            dbcManager = ResolveOrCreate <DbcManager>();
            SetMap(1);

            foreach (var store in dbcManager.Stores())
            {
                registry.RegisterInstance(store.Item1, store.Item2);
            }

            notificationsCenter = ResolveOrCreate <NotificationsCenter>();
            timeManager         = ResolveOrCreate <TimeManager>();
            screenSpaceSelector = ResolveOrCreate <ScreenSpaceSelector>();
            loadingManager      = ResolveOrCreate <LoadingManager>();
            textureManager      = ResolveOrCreate <WoWTextureManager>();
            meshManager         = ResolveOrCreate <WoWMeshManager>();
            mdxManager          = ResolveOrCreate <MdxManager>();
            wmoManager          = ResolveOrCreate <WmoManager>();
            worldManager        = ResolveOrCreate <WorldManager>();
            chunkManager        = ResolveOrCreate <ChunkManager>();
            cameraManager       = ResolveOrCreate <CameraManager>();
            lightingManager     = ResolveOrCreate <LightingManager>();
            areaTriggerManager  = ResolveOrCreate <AreaTriggerManager>();
            raycastSystem       = ResolveOrCreate <RaycastSystem>();
            moduleManager       = ResolveOrCreate <ModuleManager>();

            IsInitialized = true;
            return(true);
        }
Example #7
0
        private void petAddRegister_Click(object sender, EventArgs e)
        {
            if (PetNote.Text.Length == 0)
            {
                NotificationsCenter.ShowWarningMessage("Ingrese texto para el registo.");
            }

            try
            {
                var petRegister = new PetRegister(CurrentClient.GetID(), CurrentPet.GetID().Value, PetNote.Text, DateTime.Now, "Verde");
                if (sqlHelper.SavePetRegister(petRegister))
                {
                    NotificationsCenter.ShowSucessMessage("Registro guardado", "Los registros están actualizados en la base de datos.");
                }
                else
                {
                    NotificationsCenter.ShowErrorMessage("Error intentando guardar el registro.");
                }
            }
            catch (Exception exception)
            {
                NotificationsCenter.ShowErrorMessageForException(exception);
            }
        }
Example #8
0
 public void SuccessPrinting()
 {
     NotificationsCenter.ShowSucessMessage("Imprimiendo Ticket", "Revisa la impresora");
     RefreshForm();
     pagar.Enabled = true;
 }
Example #9
0
 public void ErrorPrinting(Exception exception)
 {
     NotificationsCenter.ShowErrorMessageForException(exception);
     pagar.Enabled = true;
 }
Example #10
0
 public Login()
 {
     InitializeComponent();
     StartPosition = FormStartPosition.CenterScreen;
     NotificationsCenter notificationsCenter = new NotificationsCenter(YOKKO);
 }