From 2007fc4ea73366bf31b4ece437ce9895764d2051 Mon Sep 17 00:00:00 2001 From: Turanszki Janos Date: Fri, 29 Sep 2017 22:17:50 +0100 Subject: [PATCH] added editor help menu, updated build configurations --- .gitignore | 1 + WickedEngine/Editor.cpp | 71 ++++++++++++++++++----- WickedEngine/WickedEngineEditor.vcxproj | 2 +- WickedEngine/WickedEngine_SHADERS.vcxproj | 2 +- WickedEngine/WickedEngine_UWP.vcxproj | 4 +- WickedEngine/WickedEngine_Windows.vcxproj | 2 +- 6 files changed, 63 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index 5a95bd2bc..350cfdcdc 100644 --- a/.gitignore +++ b/.gitignore @@ -225,3 +225,4 @@ ModelManifest.xml *.cfg /WickedEngine/models/Sample/nosun.wiw /WickedEngine/models/Sample/nosun.wimf +/.vs diff --git a/WickedEngine/Editor.cpp b/WickedEngine/Editor.cpp index afa8a5a01..2c02f43a4 100644 --- a/WickedEngine/Editor.cpp +++ b/WickedEngine/Editor.cpp @@ -313,7 +313,7 @@ void EditorComponent::Load() wiComboBox* renderPathComboBox = new wiComboBox("Render Path: "); renderPathComboBox->SetSize(XMFLOAT2(100, 20)); - renderPathComboBox->SetPos(XMFLOAT2(screenW - 940, 0)); + renderPathComboBox->SetPos(XMFLOAT2(screenW - 55 - 940, 0)); renderPathComboBox->AddItem("Forward"); renderPathComboBox->AddItem("Deferred"); renderPathComboBox->AddItem("Tiled Forward"); @@ -449,7 +449,7 @@ void EditorComponent::Load() wiCheckBox* translatorCheckBox = new wiCheckBox("Translator: "); translatorCheckBox->SetTooltip("Enable the translator tool"); - translatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25, 0)); + translatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 6 - 25, 0)); translatorCheckBox->SetSize(XMFLOAT2(18, 18)); translatorCheckBox->OnClick([=](wiEventArgs args) { if(!args.bValue) @@ -463,7 +463,7 @@ void EditorComponent::Load() wiCheckBox* isTranslatorCheckBox = new wiCheckBox("T:"); { isScalatorCheckBox->SetTooltip("Scale"); - isScalatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25 - 40 * 2, 22)); + isScalatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 6 - 25 - 40 * 2, 22)); isScalatorCheckBox->SetSize(XMFLOAT2(18, 18)); isScalatorCheckBox->OnClick([=](wiEventArgs args) { translator->isScalator = args.bValue; @@ -476,7 +476,7 @@ void EditorComponent::Load() GetGUI().AddWidget(isScalatorCheckBox); isRotatorCheckBox->SetTooltip("Rotate"); - isRotatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25 - 40 * 1, 22)); + isRotatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 6 - 25 - 40 * 1, 22)); isRotatorCheckBox->SetSize(XMFLOAT2(18, 18)); isRotatorCheckBox->OnClick([=](wiEventArgs args) { translator->isRotator = args.bValue; @@ -489,7 +489,7 @@ void EditorComponent::Load() GetGUI().AddWidget(isRotatorCheckBox); isTranslatorCheckBox->SetTooltip("Translate"); - isTranslatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 105 * 6 - 25, 22)); + isTranslatorCheckBox->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 6 - 25, 22)); isTranslatorCheckBox->SetSize(XMFLOAT2(18, 18)); isTranslatorCheckBox->OnClick([=](wiEventArgs args) { translator->isTranslator = args.bValue; @@ -505,7 +505,7 @@ void EditorComponent::Load() wiButton* saveButton = new wiButton("Save"); saveButton->SetTooltip("Save the current scene as a model"); - saveButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 6, 0)); + saveButton->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 6, 0)); saveButton->SetSize(XMFLOAT2(100, 40)); saveButton->SetColor(wiColor(0, 198, 101, 200), wiWidget::WIDGETSTATE::IDLE); saveButton->SetColor(wiColor(0, 255, 140, 255), wiWidget::WIDGETSTATE::FOCUS); @@ -572,7 +572,7 @@ void EditorComponent::Load() wiButton* modelButton = new wiButton("Load Model"); modelButton->SetTooltip("Load a model into the editor..."); - modelButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 5, 0)); + modelButton->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 5, 0)); modelButton->SetSize(XMFLOAT2(100, 40)); modelButton->SetColor(wiColor(0, 89, 255, 200), wiWidget::WIDGETSTATE::IDLE); modelButton->SetColor(wiColor(112, 155, 255, 255), wiWidget::WIDGETSTATE::FOCUS); @@ -626,7 +626,7 @@ void EditorComponent::Load() wiButton* skyButton = new wiButton("Load Sky"); skyButton->SetTooltip("Load a skybox cubemap texture..."); - skyButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 4, 0)); + skyButton->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 4, 0)); skyButton->SetSize(XMFLOAT2(100, 18)); skyButton->SetColor(wiColor(0, 89, 255, 200), wiWidget::WIDGETSTATE::IDLE); skyButton->SetColor(wiColor(112, 155, 255, 255), wiWidget::WIDGETSTATE::FOCUS); @@ -670,7 +670,7 @@ void EditorComponent::Load() wiButton* colorGradingButton = new wiButton("Color Grading"); colorGradingButton->SetTooltip("Load a color grading lookup texture..."); - colorGradingButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 4, 22)); + colorGradingButton->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 4, 22)); colorGradingButton->SetSize(XMFLOAT2(100, 18)); colorGradingButton->SetColor(wiColor(0, 89, 255, 200), wiWidget::WIDGETSTATE::IDLE); colorGradingButton->SetColor(wiColor(112, 155, 255, 255), wiWidget::WIDGETSTATE::FOCUS); @@ -714,7 +714,7 @@ void EditorComponent::Load() wiButton* scriptButton = new wiButton("Load Script"); scriptButton->SetTooltip("Load a Lua script..."); - scriptButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 3, 0)); + scriptButton->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 3, 0)); scriptButton->SetSize(XMFLOAT2(100, 40)); scriptButton->SetColor(wiColor(255, 33, 140, 200), wiWidget::WIDGETSTATE::IDLE); scriptButton->SetColor(wiColor(255, 100, 140, 255), wiWidget::WIDGETSTATE::FOCUS); @@ -749,7 +749,7 @@ void EditorComponent::Load() wiButton* shaderButton = new wiButton("Load Shaders"); shaderButton->SetTooltip("Load shaders from the specified directory..."); - shaderButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 2, 0)); + shaderButton->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 2, 0)); shaderButton->SetSize(XMFLOAT2(100, 40)); shaderButton->SetColor(wiColor(255, 33, 140, 200), wiWidget::WIDGETSTATE::IDLE); shaderButton->SetColor(wiColor(255, 100, 140, 255), wiWidget::WIDGETSTATE::FOCUS); @@ -784,10 +784,10 @@ void EditorComponent::Load() wiButton* clearButton = new wiButton("Clear World"); clearButton->SetTooltip("Delete every model from the scene"); - clearButton->SetPos(XMFLOAT2(screenW - 50 - 105 * 1, 0)); + clearButton->SetPos(XMFLOAT2(screenW - 50 - 55 - 105 * 1, 0)); clearButton->SetSize(XMFLOAT2(100, 40)); - clearButton->SetColor(wiColor(190, 0, 0, 200), wiWidget::WIDGETSTATE::IDLE); - clearButton->SetColor(wiColor(255, 0, 0, 255), wiWidget::WIDGETSTATE::FOCUS); + clearButton->SetColor(wiColor(255, 205, 43, 200), wiWidget::WIDGETSTATE::IDLE); + clearButton->SetColor(wiColor(255, 235, 173, 255), wiWidget::WIDGETSTATE::FOCUS); clearButton->OnClick([&](wiEventArgs args) { selected.clear(); EndTranslate(); @@ -802,6 +802,49 @@ void EditorComponent::Load() GetGUI().AddWidget(clearButton); + wiButton* helpButton = new wiButton("?"); + helpButton->SetTooltip("Help"); + helpButton->SetPos(XMFLOAT2(screenW - 50 - 55, 0)); + helpButton->SetSize(XMFLOAT2(50, 40)); + helpButton->SetColor(wiColor(34, 158, 214, 200), wiWidget::WIDGETSTATE::IDLE); + helpButton->SetColor(wiColor(113, 183, 214, 255), wiWidget::WIDGETSTATE::FOCUS); + helpButton->OnClick([=](wiEventArgs args) { + static wiLabel* helpLabel = nullptr; + if (helpLabel == nullptr) + { + stringstream ss(""); + ss << "Help: " << endl << "############" << endl << endl; + ss << "Move camera: WASD" << endl; + ss << "Look: Middle mouse button" << endl; + ss << "Select: Right mouse button" << endl; + ss << "Place decal/interact: Left mouse button when nothing is selected" << endl; + ss << "Duplicate object (with instancing): Ctrl + D" << endl; + ss << "Undo: Ctrl + Z" << endl; + ss << "Redo: Ctrl + Y" << endl; + ss << "Copy: Ctrl + C" << endl; + ss << "Paste: Ctrl + V" << endl; + ss << "Delete: DELETE button" << endl; + ss << "Script Console / backlog: HOME button" << endl; + ss << endl; + ss << "You can find sample models in the WickedEngine/models directory." << endl; + ss << "You can find a program configuration file at WickedEngine/config.ini" << endl; + ss << "You can find a startup script at WickedEngine/startup.lua (this will be executed on program start)" << endl; + ss << endl << endl << "For questions, bug reports, feedback, requests, please open an issue at:" << endl; + ss << "https://github.com/turanszkij/WickedEngine" << endl; + + helpLabel = new wiLabel("HelpLabel"); + helpLabel->SetText(ss.str()); + helpLabel->SetSize(XMFLOAT2(screenW / 3.0f, screenH / 2.5f)); + helpLabel->SetPos(XMFLOAT2(screenW / 2.0f - helpLabel->scale.x / 2.0f, screenH / 2.0f - helpLabel->scale.y / 2.0f)); + helpLabel->SetVisible(false); + GetGUI().AddWidget(helpLabel); + } + + helpLabel->SetVisible(!helpLabel->IsVisible()); + }); + GetGUI().AddWidget(helpButton); + + wiButton* exitButton = new wiButton("X"); exitButton->SetTooltip("Exit"); exitButton->SetPos(XMFLOAT2(screenW - 50, 0)); diff --git a/WickedEngine/WickedEngineEditor.vcxproj b/WickedEngine/WickedEngineEditor.vcxproj index 955e0ec58..63526a3e9 100644 --- a/WickedEngine/WickedEngineEditor.vcxproj +++ b/WickedEngine/WickedEngineEditor.vcxproj @@ -22,7 +22,7 @@ {5FE97B9B-A445-4EEA-A42D-9DE60B891D48} Win32Proj WickedEngineGame - 10.0.14393.0 + 10.0.15063.0 WickedEngineEditor diff --git a/WickedEngine/WickedEngine_SHADERS.vcxproj b/WickedEngine/WickedEngine_SHADERS.vcxproj index c1383c52f..b3dfdba03 100644 --- a/WickedEngine/WickedEngine_SHADERS.vcxproj +++ b/WickedEngine/WickedEngine_SHADERS.vcxproj @@ -590,7 +590,7 @@ {8C15DC72-70C8-4212-B046-0B166A688A7C} WickedEngine_SHADERS - 10.0.14393.0 + 10.0.15063.0 diff --git a/WickedEngine/WickedEngine_UWP.vcxproj b/WickedEngine/WickedEngine_UWP.vcxproj index bdb51b867..4d31019aa 100644 --- a/WickedEngine/WickedEngine_UWP.vcxproj +++ b/WickedEngine/WickedEngine_UWP.vcxproj @@ -34,9 +34,9 @@ 14.0 true Windows Store - 10.0.14393.0 - 10.0.10240.0 + 10.0.15063.0 10.0 + 10.0.15063.0 diff --git a/WickedEngine/WickedEngine_Windows.vcxproj b/WickedEngine/WickedEngine_Windows.vcxproj index c2962e065..642356978 100644 --- a/WickedEngine/WickedEngine_Windows.vcxproj +++ b/WickedEngine/WickedEngine_Windows.vcxproj @@ -22,7 +22,7 @@ {06163DCB-B183-4ED9-9C62-13EF1658E049} Win32Proj WickedEngine_Windows - 10.0.14393.0 + 10.0.15063.0