Integrated AssetService

This commit is contained in:
2024-12-27 14:37:30 -05:00
parent cd2d119abb
commit 2418ddfc46
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
#pragma once
#include <Core/AssetService.hpp>
#include <Client/AssetService.hpp>
#include "J3ML/Geometry.hpp"
#include "Client/Splash.hpp"
@@ -29,7 +29,7 @@ namespace CaveGame::ClientApp
[[nodiscard]] bool InGameSession() const;
[[nodiscard]] bool InMainMenu() const;
Core::AssetService assets;
Client::AssetService assets;
CaveGame::Client::Splash* splash_ctx;
CaveGame::Client::MainMenu* menu_ctx;
CaveGame::Client::GameSession* game_ctx;

View File

@@ -76,6 +76,7 @@ namespace CaveGame::ClientApp
// TODO: Implement Resource/Asset manager rather than passing asset references around like this.
this->menu_ctx->BuildWidgets();
this->assets.TempLoadSimple();
this->assets.EnqueueDefaultAssetsFolder();
this->ChangeScene(this->splash_ctx);
@@ -320,12 +321,11 @@ namespace CaveGame::ClientApp
game_ctx->SaveAndExit();
ChangeScene(menu_ctx);
}
//Die();
if (ev.key == Keys::P) {
if (current_scene == game_ctx) {
auto* plr = new Core::Player(InputService::GetMousePosition());
auto coords = game_ctx->world->camera.ScreenToWorld(InputService::GetMousePosition());
auto* plr = new Core::Player(coords);
game_ctx->world->AddEntity(plr);
}