Skip to content

Commit

Permalink
feat: drop ultralight and use fw instead
Browse files Browse the repository at this point in the history
  • Loading branch information
zpl-zak committed Dec 29, 2024
1 parent cd14713 commit 3cd7c83
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 1,184 deletions.
6 changes: 1 addition & 5 deletions code/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ set(MAFIAMP_CLIENT_FILES
src/core/ui/devs/debug_world.cpp
src/core/ui/devs/entity_browser.cpp
src/core/ui/devs/network_stats.cpp
src/core/ui/web/manager.cpp
src/core/ui/web/clipboard.cpp
src/core/ui/web/sdk.cpp
src/core/ui/web/view.cpp
src/core/states/initialize.cpp
src/core/states/main_menu.cpp
src/core/states/session_connected.cpp
Expand Down Expand Up @@ -131,7 +127,7 @@ set(MAFIAMP_SDK_FILES

add_library(MafiaMPClient SHARED ${MAFIAMP_CLIENT_FILES} ${MAFIAMP_SDK_FILES})
target_include_directories(MafiaMPClient PRIVATE src)
target_link_libraries(MafiaMPClient Framework FrameworkClient shlwapi Lua54 DirectXTK UltralightSDK JavaScriptCorePP)
target_link_libraries(MafiaMPClient Framework FrameworkClient shlwapi Lua54 DirectXTK)
target_link_options(MafiaMPClient PRIVATE /SAFESEH:NO /MANIFEST:NO)

add_custom_command(TARGET MafiaMPClient POST_BUILD
Expand Down
15 changes: 13 additions & 2 deletions code/client/src/core/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
#include "modules/human.h"
#include "modules/vehicle.h"

#include "game/module.h"

namespace MafiaMP::Core {
std::unique_ptr<Application> gApplication = nullptr;

Expand Down Expand Up @@ -62,10 +64,19 @@ namespace MafiaMP::Core {
_input = std::make_shared<MafiaMP::Game::GameInput>();
_console = std::make_shared<UI::Console>(_commandProcessor);
_chat = std::make_shared<UI::Chat>();
_webManager = std::make_shared<UI::Web::Manager>();
_webManager = std::make_shared<Framework::GUI::Manager>();

if (_webManager) {
if (!_webManager->Init()) {
Framework::GUI::ViewportConfiguration vhConfiguration;
{
RECT vhRect;
GetClientRect(Game::gGlobals.window, &vhRect);
vhConfiguration = {
vhRect.right - vhRect.left,
vhRect.bottom - vhRect.top,
};
}
if (!_webManager->Init(gProjectPath, vhConfiguration, GetRenderer())) {
Framework::Logging::GetLogger("Web")->error("Failed to initialize web manager");
return false;
}
Expand Down
6 changes: 3 additions & 3 deletions code/client/src/core/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "luavm.h"
#include "ui/chat.h"
#include "ui/console.h"
#include "ui/web/manager.h"

#include "dev_features.h"

Expand All @@ -19,14 +18,15 @@
#include <integrations/client/instance.h>
#include <utils/command_processor.h>
#include <utils/states/machine.h>
#include <gui/manager.h>

namespace MafiaMP::Core {
class Application: public Framework::Integrations::Client::Instance {
private:
std::shared_ptr<Framework::Utils::States::Machine> _stateMachine;
std::shared_ptr<UI::Console> _console;
std::shared_ptr<UI::Chat> _chat;
std::shared_ptr<UI::Web::Manager> _webManager;
std::shared_ptr<Framework::GUI::Manager> _webManager;
std::shared_ptr<Game::Streaming::EntityFactory> _entityFactory;
std::shared_ptr<Framework::Utils::CommandProcessor> _commandProcessor;
std::shared_ptr<MafiaMP::Game::GameInput> _input;
Expand Down Expand Up @@ -98,7 +98,7 @@ namespace MafiaMP::Core {
return _luaVM;
}

std::shared_ptr<UI::Web::Manager> GetWebManager() const {
std::shared_ptr<Framework::GUI::Manager> GetWebManager() const {
return _webManager;
}

Expand Down
55 changes: 0 additions & 55 deletions code/client/src/core/ui/web/clipboard.cpp

This file was deleted.

13 changes: 0 additions & 13 deletions code/client/src/core/ui/web/clipboard.h

This file was deleted.

145 changes: 0 additions & 145 deletions code/client/src/core/ui/web/manager.cpp

This file was deleted.

58 changes: 0 additions & 58 deletions code/client/src/core/ui/web/manager.h

This file was deleted.

Loading

0 comments on commit 3cd7c83

Please sign in to comment.