Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 0.1.4 #47

Merged
merged 4 commits into from
Dec 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Metadata:
assetHandle: 14649156906707556343
filePath: Editor/Textures/Icons/icon_statemachine_alias_state.dds
type: 16
Dependencies:
[]
Properties:
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Metadata:
assetHandle: 1700358712748332125
filePath: Editor/Textures/Icons/icon_statemachine_animation_state.dds
type: 16
Dependencies:
[]
Properties:
{}
4 changes: 2 additions & 2 deletions Engine/Launcher.exe
Git LFS file not shown
4 changes: 2 additions & 2 deletions Engine/Sandbox.exe
Git LFS file not shown
2 changes: 1 addition & 1 deletion Engine/Templates/Project/Project.vtproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Project:
EngineVersion: 0.1.2
EngineVersion: 0.1.4
Name: Project
CompanyName: None
AssetsDirectory: Assets
Expand Down
5 changes: 0 additions & 5 deletions SideProjects/VoltLauncher/App/Data.yaml

This file was deleted.

28 changes: 24 additions & 4 deletions SideProjects/VoltLauncher/VoltLauncher/src/Launcher/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,19 @@ bool FileSystem::SetRegistryValue(const std::string& key, const std::string& val

void FileSystem::StartProcess(const std::filesystem::path& processName, const std::wstring& commandLine)
{
DWORD exitCode = 0;
std::wstring processDir = processName.parent_path().wstring();
std::wstring tempProcessName = processName.wstring();
tempProcessName.insert(tempProcessName.begin(), '\"');
tempProcessName.push_back('\"');

SHELLEXECUTEINFO ShExecInfo = { 0 };
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = L"open";
ShExecInfo.lpFile = processName.c_str();
ShExecInfo.lpParameters = commandLine.c_str();
ShExecInfo.lpDirectory = processName.parent_path().c_str();
ShExecInfo.lpDirectory = processDir.c_str();
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
Expand Down Expand Up @@ -164,8 +168,24 @@ bool FileSystem::ShowDirectoryInExplorer(const std::filesystem::path& aPath)
return false;
}

ShellExecute(nullptr, L"explorer", absolutePath.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
return true;
bool succeded = false;

HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if (SUCCEEDED(hr))
{
ITEMIDLIST* pidl = ILCreateFromPath(absolutePath.c_str());
if (pidl)
{
hr = SHOpenFolderAndSelectItems(pidl, 0, nullptr, 0);

succeded = SUCCEEDED(hr);

ILFree(pidl);
}
}

CoUninitialize();
return succeded;
}

std::filesystem::path FileSystem::PickFolderDialogue()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ void LauncherLayer::UI_DrawAboutModal()
Walnut::UI::ShiftCursorX(20.0f);

ImGui::BeginGroup();
ImGui::Text("Walnut application framework");
ImGui::Text("by Studio Cherno.");
ImGui::Text("Volt Launcher");
ImGui::Text("by Volt.");
ImGui::EndGroup();

if (Walnut::UI::ButtonCentered("Close"))
Expand Down Expand Up @@ -406,7 +406,11 @@ void LauncherLayer::UI_DrawProjectsContent()

if (ImGui::ImageButton(m_editIcon->GetDescriptorSet(), { 32, 32 }))
{
FileSystem::StartProcess(m_data.engineInfo.engineDirectory / "Sandbox.exe", project.path.wstring());
std::wstring tempProjectPath = project.path.wstring();
tempProjectPath.push_back('"');
tempProjectPath.insert(tempProjectPath.begin(), '"');

FileSystem::StartProcess(m_data.engineInfo.engineDirectory / "Sandbox.exe", tempProjectPath);
}

ImGui::SameLine();
Expand Down Expand Up @@ -498,7 +502,7 @@ void LauncherLayer::UI_DrawEnginesContent()

if (ImGui::Button("Add"))
{
const std::string url = "https://github.com/ChunkTreasure1/Volt/releases/download/v0.1.2/Volt.zip";
const std::string url = "https://github.com/ChunkTreasure1/Volt/releases/latest/download/Volt.zip";
g_installProgress = 0.f;
m_isInstalling = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ void ConvertToWorldEngineModal::DrawModalContent()
}
}

Volt::AssetManager::SaveAsset(m_scene.GetSharedPtr());
if (Volt::AssetManager::ExistsInRegistry(m_scene->handle))
{
Volt::AssetManager::SaveAsset(m_scene.GetSharedPtr());
}
Close();
}

Expand Down
2 changes: 1 addition & 1 deletion Volt/Sandbox/src/Sandbox/Window/SceneSettingsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void SceneSettingsPanel::UpdateMainContent()

if (UI::BeginProperties("sceneSettings"))
{
if (UI::Property("Use World Engine", sceneSettings.useWorldEngine))
if (UI::Property("Use World Engine", sceneSettings.useWorldEngine) && sceneSettings.useWorldEngine)
{
ModalSystem::GetModal<ConvertToWorldEngineModal>(m_convertionModal).SetCurrentScene(m_editorScene);
ModalSystem::GetModal<ConvertToWorldEngineModal>(m_convertionModal).Open();
Expand Down
2 changes: 1 addition & 1 deletion Volt/Volt/src/Volt/Core/Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <string>
#include <iostream>

#define VT_VERSION Version::Create(0, 1, 3)
#define VT_VERSION Version::Create(0, 1, 4)

#define BIT(X) (1 << (X))
#define TO_NORMALIZEDRGB(r, g, b) glm::vec4{ r / 255.f, g / 255.f, b / 255.f, 1.f }
Expand Down
1 change: 1 addition & 0 deletions Volt/Volt/src/Volt/Project/ProjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ namespace Volt
}
}

VT_CORE_INFO("[ProjectManager]: Loading project {0}", projectPath);
DeserializeProject();

m_currentEngineDirectory = std::filesystem::current_path();
Expand Down
49 changes: 35 additions & 14 deletions Volt/Volt/src/Volt/Utility/FileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,29 @@ void FileSystem::MoveToRecycleBin(const std::filesystem::path& path)
bool FileSystem::ShowDirectoryInExplorer(const std::filesystem::path& aPath)
{
auto absolutePath = std::filesystem::canonical(aPath);
if (!Exists(absolutePath))
if (!std::filesystem::exists(absolutePath))
{
return false;
}

ShellExecute(nullptr, L"explorer", absolutePath.c_str(), nullptr, nullptr, SW_SHOWNORMAL);
return true;
bool succeded = false;

HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
if (SUCCEEDED(hr))
{
PIDLIST_ABSOLUTE pidl = ILCreateFromPath(absolutePath.c_str());
if (pidl)
{
hr = SHOpenFolderAndSelectItems(pidl, 0, nullptr, 0);

succeded = SUCCEEDED(hr);

ILFree(pidl);
}
}

CoUninitialize();
return succeded;
}

void FileSystem::Initialize()
Expand Down Expand Up @@ -271,15 +287,20 @@ std::string FileSystem::GetCurrentUserName()

void FileSystem::StartProcess(const std::filesystem::path& processPath)
{
STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory(&si, sizeof(STARTUPINFO));
ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));

si.cb = sizeof(STARTUPINFO);

CreateProcess(processPath.wstring().c_str(), nullptr, nullptr, nullptr, FALSE, 0, nullptr, nullptr, &si, &pi);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
std::wstring processDir = processPath.parent_path().wstring();
std::wstring tempProcessName = processPath.wstring();
tempProcessName.insert(tempProcessName.begin(), '\"');
tempProcessName.push_back('\"');

SHELLEXECUTEINFO ShExecInfo = { 0 };
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = L"open";
ShExecInfo.lpFile = tempProcessName.c_str();
ShExecInfo.lpParameters = L"";
ShExecInfo.lpDirectory = processDir.c_str();
ShExecInfo.nShow = SW_SHOW;
ShExecInfo.hInstApp = NULL;
ShellExecuteEx(&ShExecInfo);
}