From 39ba56cba7d63249fb909c0dd2a34d55aa2b9299 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Mon, 14 May 2018 08:53:26 +0200 Subject: [PATCH 01/45] Add utility conversion constructors to Mathlib --- src/math/mathlib.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/math/mathlib.h b/src/math/mathlib.h index 7b0c4e94..9082b8c6 100644 --- a/src/math/mathlib.h +++ b/src/math/mathlib.h @@ -6,6 +6,7 @@ #include #include #include +#include namespace Math { @@ -105,6 +106,16 @@ namespace Math this->x = x; this->y = y; } + t_float2(const ZMath::float2& v) + { + this->x = v.x; + this->y = v.y; + } + t_float2(float v) + { + this->x = v; + this->y = v; + } union { struct @@ -139,6 +150,18 @@ namespace Math this->y = y; this->z = z; } + t_float3(const ZMath::float3& v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + } + t_float3(float v) + { + this->x = v; + this->y = v; + this->z = v; + } union { struct @@ -175,6 +198,20 @@ namespace Math this->z = z; this->w = w; } + t_float4(const ZMath::float4& v) + { + this->x = v.x; + this->y = v.y; + this->z = v.z; + this->w = v.w; + } + t_float4(float v) + { + this->x = v; + this->y = v; + this->z = v; + this->w = w; + } union { struct From 018024f792e7b9ae6f763c42ac7afc1d7112eb18 Mon Sep 17 00:00:00 2001 From: Francesco Bertolaccini Date: Wed, 16 May 2018 20:53:04 +0200 Subject: [PATCH 02/45] Fix warnings about `memcpy` being used improperly --- src/math/mathlib.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/math/mathlib.h b/src/math/mathlib.h index 9082b8c6..f4efb44f 100644 --- a/src/math/mathlib.h +++ b/src/math/mathlib.h @@ -326,7 +326,7 @@ namespace Math t_vector() {} t_vector(const void* v) { - memcpy(this, v, sizeof(T)); + memcpy(T::v, v, sizeof(T)); } t_vector(const T& v) @@ -507,7 +507,7 @@ namespace Math // Assignment operators Matrix& operator=(const Matrix& M) { - memcpy(this, &M, sizeof(float) * 16); + memcpy(m, &M, sizeof(mv)); return *this; } Matrix& operator+=(const Matrix& M) From b3ca91828125ff15b3d99c3e957de811135bef9d Mon Sep 17 00:00:00 2001 From: Andre Taulien Date: Fri, 11 May 2018 19:01:31 +0200 Subject: [PATCH 03/45] Fixed particle effects turning fog-colored in the distance --- content/shaders/essl/fs_particle_textured.bin | Bin 607 -> 461 bytes .../essl/fs_particle_textured.bin.disasm | 6 +----- content/shaders/glsl/fs_particle_textured.bin | Bin 567 -> 395 bytes .../glsl/fs_particle_textured.bin.disasm | 14 +++----------- src/shaders/fs_particle_textured.sc | 3 ++- src/shaders/tools.sh | 4 ++++ 6 files changed, 10 insertions(+), 17 deletions(-) diff --git a/content/shaders/essl/fs_particle_textured.bin b/content/shaders/essl/fs_particle_textured.bin index 568c95b63054f9bff9cbb313aef1deb71b4db9fe..65a6ee6f9aa0d51395657100a2404496f40d0c2b 100644 GIT binary patch delta 82 zcmcc5a+cY^E!cxqKFs1469ZRqd`W7BbAC>K5d$Lw5b>18yXB|*r6v}+B^EJ(g=R5M gbeuf#vp#n+NLjq0f~|taWM@WwCIzj@2N>rA0LNGtcK`qY delta 196 zcmX@he4oY9E!cxqKFs14GXqy~d`W7BbAC>K5d$Lw5OI~pyXB{Y1(?7BJYWI8)WjmU z#3G20G}Az7VN<)A7*ijiGiy)z9hB6IX@@Ah=Gv-h*?vWw2 delta 284 zcmeBX-p=CS7VN<)A7*ijnSrY~z9hB6IX@@Ah=Gv-h`37Q-SX4H0!&~59^F;lciIa?V%2Ja}6p}%D;|;C36coVxlH7u_#G-g3kN}LWV5>0ks(uVe2&!DK z94H2p)+?1%H?KOC}_YH0L63^5H8aL^OJKDa|;wSG=QcmC`^`SH01)Z^c6tl r*shdy& diff --git a/content/shaders/glsl/fs_particle_textured.bin.disasm b/content/shaders/glsl/fs_particle_textured.bin.disasm index be78977e..a905d521 100644 --- a/content/shaders/glsl/fs_particle_textured.bin.disasm +++ b/content/shaders/glsl/fs_particle_textured.bin.disasm @@ -2,19 +2,11 @@ varying vec4 v_color; varying vec2 v_texcoord0; varying vec3 v_view_pos; uniform sampler2D s_texColor; -uniform vec4 u_FogColor; uniform vec4 u_FogNearFar; void main () { - vec4 color_1; - vec4 tmpvar_2; - tmpvar_2 = (texture2D (s_texColor, v_texcoord0) * v_color); - color_1.w = tmpvar_2.w; - color_1.xyz = mix (tmpvar_2.xyz, u_FogColor.xyz, clamp (( - (sqrt(dot (v_view_pos, v_view_pos)) - u_FogNearFar.x) - / - (u_FogNearFar.y - u_FogNearFar.x) - ), 0.0, 1.0)); - gl_FragColor = color_1; + gl_FragColor = ((texture2D (s_texColor, v_texcoord0) * v_color) * (1.0 - clamp ( + ((sqrt(dot (v_view_pos, v_view_pos)) - u_FogNearFar.x) / (u_FogNearFar.y - u_FogNearFar.x)) + , 0.0, 1.0))); } diff --git a/src/shaders/fs_particle_textured.sc b/src/shaders/fs_particle_textured.sc index 7c24101b..d9f780a1 100644 --- a/src/shaders/fs_particle_textured.sc +++ b/src/shaders/fs_particle_textured.sc @@ -19,7 +19,8 @@ void main() vec4 color = diffuse * v_color; // Apply linear fog - color.rgb = computeLinearFog(length(v_view_pos), u_FogNearFar.x, u_FogNearFar.y, color.rgb, u_FogColor.xyz); + // color.rgb = computeLinearFog(length(v_view_pos), u_FogNearFar.x, u_FogNearFar.y, color.rgb, u_FogColor.xyz); + color *= computeLinearFogFactor(length(v_view_pos), u_FogNearFar.x, u_FogNearFar.y); gl_FragColor = color; } diff --git a/src/shaders/tools.sh b/src/shaders/tools.sh index 80b92cde..5d6ef537 100644 --- a/src/shaders/tools.sh +++ b/src/shaders/tools.sh @@ -11,6 +11,10 @@ vec3 computeLinearFog(float distance, float fogNear, float fogFar, vec3 color, v return mix(color.rgb, fogColor, l); } +float computeLinearFogFactor(float distance, float fogNear, float fogFar) { + return 1.0 - saturate((distance - fogNear)/(fogFar - fogNear)); +} + vec4 applySkyColor(float intensity) { return mix(u_SkyColors[0], u_SkyColors[1], intensity); From 6285fbe9fac399a5c14290d72a27e689bc7664ab Mon Sep 17 00:00:00 2001 From: markusobi Date: Tue, 22 May 2018 20:49:26 +0200 Subject: [PATCH 04/45] removed unnecessary particle copy --- src/logic/visuals/PfxVisual.cpp | 37 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/logic/visuals/PfxVisual.cpp b/src/logic/visuals/PfxVisual.cpp index 549c7b94..81b9e18d 100644 --- a/src/logic/visuals/PfxVisual.cpp +++ b/src/logic/visuals/PfxVisual.cpp @@ -48,7 +48,7 @@ bool Logic::PfxVisual::load(const std::string& visual) // Need that one. Or should give a default value of 1? //assert(!m_Emitter.ppsScaleKeys.empty()); - if(m_Emitter.ppsScaleKeys.empty()) + if (m_Emitter.ppsScaleKeys.empty()) m_Emitter.ppsScaleKeys.push_back(1.0f); // Init particle-systems dynamic vertex-buffer @@ -102,7 +102,7 @@ Components::PfxComponent& Logic::PfxVisual::getPfxComponent() void Logic::PfxVisual::onUpdate(float deltaTime) { - Components::PfxComponent &pfx = getPfxComponent(); + Components::PfxComponent& pfx = getPfxComponent(); Controller::onUpdate(deltaTime); // Spawn new particles. Need to accumulate deltaTime so the floor doesn't keep us from spawning any particles @@ -115,7 +115,7 @@ void Logic::PfxVisual::onUpdate(float deltaTime) // Loop ppsScaleKeys if wanted if (Math::ifloor(m_ppsScaleKey) >= static_cast(m_Emitter.ppsScaleKeys.size())) - { //&& !m_Emitter.ppsIsLooping) { + { //&& !m_Emitter.ppsIsLooping) { m_ppsScaleKey = 0.0f; if (!m_Emitter.ppsIsLooping) { @@ -123,7 +123,7 @@ void Logic::PfxVisual::onUpdate(float deltaTime) } } if (Math::ifloor(m_shpScaleKey) >= static_cast(m_Emitter.shpScaleKeys.size())) - { //&& !m_Emitter.shpScaleIsLooping){ + { //&& !m_Emitter.shpScaleIsLooping){ m_shpScaleKey = 0.0f; if (!m_Emitter.shpScaleIsLooping) { @@ -152,27 +152,27 @@ void Logic::PfxVisual::onUpdate(float deltaTime) m_BBox.max = {-FLT_MAX, -FLT_MAX, -FLT_MAX}; // Update particle values - for (Components::PfxComponent::Particle &p : pfx.m_Particles) + for (Components::PfxComponent::Particle& p : pfx.m_Particles) updateParticle(p, deltaTime); //Notice that iterator is not incremented in for loop - for (size_t i = 0; i < pfx.m_Particles.size(); ) + for (size_t i = 0; i < pfx.m_Particles.size();) { - auto p = pfx.m_Particles.at(i); + auto& particle = pfx.m_Particles[i]; - if (p.lifetime <= 0) + if (particle.lifetime <= 0) { - // Kill particle. Move the last one into the free slot and reduce the vector size - // to keep the memory continuous - pfx.m_Particles[i] = pfx.m_Particles.back(); + // Efficient erasing: Copy the last particle into the free slot and remove it + particle = pfx.m_Particles.back(); pfx.m_Particles.pop_back(); - // No need to increase iterator, since we have a new particle in this slot now - }else + // No need to increase the index, since we have a new particle in this slot now + } + else { ++i; } } - if(pfx.m_Particles.size() == 0 && m_dead) + if (pfx.m_Particles.size() == 0 && m_dead) { m_canBeRemoved = true; } @@ -316,17 +316,16 @@ void Logic::PfxVisual::updateParticle(Components::PfxComponent::Particle& p, flo p.size += p.sizeVel * deltaTime; p.alpha += p.alphaVel * deltaTime; - float alphaFinal; - if(m_Emitter.visSoftAlpha) + if (m_Emitter.visSoftAlpha) { - float alphaRatio = (p.alpha - m_Emitter.visAlphaStart) / (m_Emitter.visAlphaEnd - m_Emitter.visAlphaStart); - alphaFinal = Math::sinusSmooth(alphaRatio) * p.alpha; + float alphaRatio = (p.alpha - m_Emitter.visAlphaStart) / (m_Emitter.visAlphaEnd - m_Emitter.visAlphaStart); + alphaFinal = Math::sinusSmooth(alphaRatio) * p.alpha; } else { - alphaFinal = p.alpha; + alphaFinal = p.alpha; } // Compute actual color for this frame From c79f759c7d7d4b65abd03d26bfa9ced6561cdefc Mon Sep 17 00:00:00 2001 From: Bude Date: Sun, 10 Jun 2018 22:33:47 +0200 Subject: [PATCH 05/45] Update Stubs for introducechapter function --- src/logic/scriptExternals/Stubs.cpp | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/src/logic/scriptExternals/Stubs.cpp b/src/logic/scriptExternals/Stubs.cpp index 3fbb1122..2b5d92bf 100644 --- a/src/logic/scriptExternals/Stubs.cpp +++ b/src/logic/scriptExternals/Stubs.cpp @@ -1932,32 +1932,16 @@ void ::Logic::ScriptExternals::registerStubs(Daedalus::DaedalusVM& vm, bool verb vm.registerExternalFunction("introducechapter", [=](Daedalus::DaedalusVM& vm) { if (verbose) LogInfo() << "introducechapter"; - int i4 = vm.popDataValue(); - if (verbose) LogInfo() << "i4: " << i4; - std::string s3 = vm.popString(); - if (verbose) LogInfo() << "s3: " << s3; - std::string s2 = vm.popString(); - if (verbose) LogInfo() << "s2: " << s2; - std::string s1 = vm.popString(); - if (verbose) LogInfo() << "s1: " << s1; - std::string s0 = vm.popString(); - if (verbose) LogInfo() << "s0: " << s0; - - }); - - vm.registerExternalFunction("introducechapter", [=](Daedalus::DaedalusVM& vm) { - if (verbose) LogInfo() << "introducechapter"; - int waittime = vm.popDataValue(); + double waittime = vm.popDataValue(); if (verbose) LogInfo() << "waittime: " << waittime; std::string sound = vm.popString(); if (verbose) LogInfo() << "sound: " << sound; std::string texture = vm.popString(); if (verbose) LogInfo() << "texture: " << texture; - std::string untertitel = vm.popString(); - if (verbose) LogInfo() << "untertitel: " << untertitel; - std::string titel = vm.popString(); - if (verbose) LogInfo() << "titel: " << titel; - + std::string subtitle = vm.popString(); + if (verbose) LogInfo() << "subtitle: " << subtitle; + std::string title = vm.popString(); + if (verbose) LogInfo() << "title: " << title; }); vm.registerExternalFunction("log_addentry", [=](Daedalus::DaedalusVM& vm) { @@ -2729,4 +2713,4 @@ void ::Logic::ScriptExternals::registerStubs(Daedalus::DaedalusVM& vm, bool verb if (verbose) LogInfo() << "s0: " << s0; }); -} +} \ No newline at end of file From efec62eb25d672e291f124930a26bfc905c55d35 Mon Sep 17 00:00:00 2001 From: Bude Date: Sun, 10 Jun 2018 22:36:32 +0200 Subject: [PATCH 06/45] Add IntroduceChapterView with basic functionality Add chapterintroduce function as external --- src/logic/scriptExternals/Externals.cpp | 17 +++- src/ui/Hud.cpp | 10 +- src/ui/Hud.h | 8 +- src/ui/IntroduceChapterView.cpp | 120 ++++++++++++++++++++++++ src/ui/IntroduceChapterView.h | 54 +++++++++++ 5 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 src/ui/IntroduceChapterView.cpp create mode 100644 src/ui/IntroduceChapterView.h diff --git a/src/logic/scriptExternals/Externals.cpp b/src/logic/scriptExternals/Externals.cpp index 0e5122b6..e26ea909 100644 --- a/src/logic/scriptExternals/Externals.cpp +++ b/src/logic/scriptExternals/Externals.cpp @@ -10,7 +10,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -1503,4 +1505,17 @@ void ::Logic::ScriptExternals::registerEngineExternals(World::WorldInstance& wor npc.playerController->drawWeaponMelee(true); } }); -} + + vm->registerExternalFunction("introducechapter", [=](Daedalus::DaedalusVM& vm) { + double waittime = vm.popDataValue(); + std::string sound = vm.popString(); + std::string texture = vm.popString(); + std::string subtitle = vm.popString(); + std::string title = vm.popString(); + + engine->getJobManager().executeInMainThread([=](Engine::BaseEngine* pEngine) { + engine->getHud().getIntroduceChapterView().enqueueChapterIntroduction(title, subtitle, texture, sound, waittime); + }); + + }); +} \ No newline at end of file diff --git a/src/ui/Hud.cpp b/src/ui/Hud.cpp index a80cc01c..d3cc235e 100644 --- a/src/ui/Hud.cpp +++ b/src/ui/Hud.cpp @@ -14,6 +14,7 @@ #include "Menu_Status.h" #include "PrintScreenMessages.h" #include "TextView.h" +#include "IntroduceChapterView.h" #include #include #include @@ -39,6 +40,8 @@ UI::Hud::Hud(Engine::BaseEngine& e) m_pMenuBackground = new ImageView(m_Engine); m_pMenuBackground->setHidden(true); m_pMenuBackground->setRelativeSize(false); + m_pIntroduceChapterView = new IntroduceChapterView(m_Engine); + m_pIntroduceChapterView->setHidden(true); addChild(m_pHealthBar); addChild(m_pManaBar); @@ -49,6 +52,7 @@ UI::Hud::Hud(Engine::BaseEngine& e) addChild(m_pLoadingScreen); addChild(m_pMenuBackground); addChild(m_pConsoleBox); + addChild(m_pIntroduceChapterView); // Initialize status bars { @@ -119,6 +123,7 @@ UI::Hud::~Hud() removeChild(m_pLoadingScreen); removeChild(m_pConsoleBox); removeChild(m_pMenuBackground); + removeChild(m_pIntroduceChapterView); popAllMenus(); @@ -130,6 +135,7 @@ UI::Hud::~Hud() delete m_pClock; delete m_pLoadingScreen; delete m_pConsoleBox; + delete m_pIntroduceChapterView; } void UI::Hud::update(double dt, Engine::Input::MouseState& mstate, Render::RenderConfig& config) @@ -251,7 +257,7 @@ void UI::Hud::onInputAction(Engine::ActionType action) { using Engine::ActionType; - if (!m_pLoadingScreen->isHidden()) + if (!m_pLoadingScreen->isHidden() || !m_pIntroduceChapterView->isHidden()) return; if (m_Engine.getConsole().isOpen()) @@ -341,4 +347,4 @@ void UI::Hud::popAllMenus() { while (!m_MenuChain.empty()) popMenu(); -} +} \ No newline at end of file diff --git a/src/ui/Hud.h b/src/ui/Hud.h index a0ba6e9e..682ec7d2 100644 --- a/src/ui/Hud.h +++ b/src/ui/Hud.h @@ -27,6 +27,7 @@ namespace UI class Menu; class DialogBox; class LoadingScreen; + class IntroduceChapterView; class Hud : public View { @@ -102,6 +103,10 @@ namespace UI * LoadingScreen */ LoadingScreen& getLoadingScreen() { return *m_pLoadingScreen; } + /** + * IntroduceChapterView + */ + IntroduceChapterView& getIntroduceChapterView() { return *m_pIntroduceChapterView; } /** * Controls visibility of gameplay-hud */ @@ -154,6 +159,7 @@ namespace UI LoadingScreen* m_pLoadingScreen; ImageView* m_pMenuBackground; ConsoleBox* m_pConsoleBox; + IntroduceChapterView* m_pIntroduceChapterView; /** * Chain of opened menus. Only the last one will be rendered and processed @@ -192,4 +198,4 @@ namespace UI addChild(m_MenuChain.back()); return *menu; } -} +} \ No newline at end of file diff --git a/src/ui/IntroduceChapterView.cpp b/src/ui/IntroduceChapterView.cpp new file mode 100644 index 00000000..dc8a9339 --- /dev/null +++ b/src/ui/IntroduceChapterView.cpp @@ -0,0 +1,120 @@ + + +#include "IntroduceChapterView.h" +#include +#include + +UI::IntroduceChapterView::IntroduceChapterView(Engine::BaseEngine& e) + : View(e) +{ + m_pImageView = new ImageView(e); + addChild(m_pImageView); + m_pImageView->setAlignment(EAlign::A_Center); + m_pImageView->setTranslation(Math::float2(0.25, 0.20)); //TODO: get this right + m_pImageView->setRelativeSize(false); + m_pImageView->setSize(Math::float2(4.5/8.0, 3.0/4.5)); + + m_pTitleTextView = new TextView(e); + addChild(m_pTitleTextView); + m_pTitleTextView->setAlignment(EAlign::A_Center); + m_pTitleTextView->setTranslation(Math::float2(0.5, 0.28)); //TODO: get this right + m_pTitleTextView->setFont(DEFAULT_FONT_LARGE); + + m_pSubtitleTextView = new TextView(e); + addChild(m_pSubtitleTextView); + m_pSubtitleTextView->setAlignment(EAlign::A_Center); + m_pSubtitleTextView->setTranslation(Math::float2(0.5, 0.78)); //TODO: get this right + m_pSubtitleTextView->setFont(DEFAULT_FONT); + + initializeIntroduceChapterView(); +} + +UI::IntroduceChapterView::~IntroduceChapterView() +{ + removeChild(m_pImageView); + delete m_pImageView; + + removeChild(m_pTitleTextView); + delete m_pTitleTextView; + + removeChild(m_pSubtitleTextView); + delete m_pSubtitleTextView; +} + +void UI::IntroduceChapterView::initializeIntroduceChapterView() +{ + m_Title = ""; + m_Subtitle = ""; + m_TextureName = ""; //TODO: some default + m_SoundName = ""; + m_WaitTime = 0; + + m_QueueStatus = QueueStatus::Empty; + + setHidden(true); + + m_pImageView->setHidden(true); + m_pTitleTextView->setHidden(true); + m_pSubtitleTextView->setHidden(true); +} + +void UI::IntroduceChapterView::update(double dt, Engine::Input::MouseState& mstate, Render::RenderConfig& config) +{ + if ( m_QueueStatus == QueueStatus::Empty || /* Dialog in progess */ m_Engine.getMainWorld().get().getDialogManager().isDialogActive() ) + return; + + //Dequeue + if ( m_QueueStatus == QueueStatus::InQueue ) + { + //Setup ImageView picture + { + Textures::TextureAllocator& alloc = m_Engine.getEngineTextureAlloc(); + Handle::TextureHandle image = alloc.loadTextureVDF(m_TextureName); + if (image.isValid()) + { + m_pImageView->setImage(image); + m_pImageView->setHidden(false); + } + } + + //Setup Text + { + m_pTitleTextView->setText(m_Title); + m_pTitleTextView->setHidden(false); + } + { + m_pSubtitleTextView->setText(m_Subtitle); + m_pTitleTextView->setHidden(false); + } + + //Setup Sound + + //TODO: Pause Engine? + + m_QueueStatus = QueueStatus::Dequeued; + + setHidden(false); + } + + View::update(dt, mstate, config); + + m_WaitTime -= dt; + + if ( m_WaitTime < 0 ) + { + //TODO: unpause Engine? + + initializeIntroduceChapterView(); + } +} + +void UI::IntroduceChapterView::enqueueChapterIntroduction(std::string title, std::string subtitle, std::string texture_name, std::string sound_name, double wait_time) +{ + m_Title = title; + m_Subtitle = subtitle; + m_TextureName = texture_name; + m_SoundName = sound_name; + m_WaitTime = wait_time/1000; + + m_QueueStatus = QueueStatus::InQueue; +} diff --git a/src/ui/IntroduceChapterView.h b/src/ui/IntroduceChapterView.h new file mode 100644 index 00000000..275e502c --- /dev/null +++ b/src/ui/IntroduceChapterView.h @@ -0,0 +1,54 @@ + +#pragma once + +#include "View.h" +#include "ImageView.h" +#include "TextView.h" + +namespace UI +{ + class IntroduceChapterView : public View + { + public: + IntroduceChapterView(Engine::BaseEngine& e); + + ~IntroduceChapterView(); + + /** + * Updates/draws the UI-Views + * @param dt time since last frame + * @param mstate mouse-state + */ + void update(double dt, Engine::Input::MouseState& mstate, Render::RenderConfig& config) override; + + /** + * Adds a single choice + * @param choice Choice presented to the user + * @param name Name of the person or thing we are interacting with + */ + void enqueueChapterIntroduction(std::string title, std::string subtitle, std::string texture_name, std::string sound_name, double wait_time); + + private: + + void initializeIntroduceChapterView(); + + enum QueueStatus + { + Empty, + InQueue, + Dequeued + }; + + QueueStatus m_QueueStatus; + + std::string m_Title; + std::string m_Subtitle; + std::string m_TextureName; + std::string m_SoundName; + double m_WaitTime; + + ImageView* m_pImageView; + TextView* m_pTitleTextView; + TextView* m_pSubtitleTextView; + }; +} \ No newline at end of file From b1d0361e2ba930efb5a061801e2fe43bb5c12782 Mon Sep 17 00:00:00 2001 From: Bude Date: Sun, 17 Jun 2018 17:30:00 +0200 Subject: [PATCH 07/45] Fix #338 --- src/ui/Hud.cpp | 8 +++- src/ui/IntroduceChapterView.cpp | 85 ++++++++++++++++----------------- src/ui/IntroduceChapterView.h | 52 ++++++++++++++++---- 3 files changed, 92 insertions(+), 53 deletions(-) diff --git a/src/ui/Hud.cpp b/src/ui/Hud.cpp index d3cc235e..454cbfd9 100644 --- a/src/ui/Hud.cpp +++ b/src/ui/Hud.cpp @@ -257,9 +257,15 @@ void UI::Hud::onInputAction(Engine::ActionType action) { using Engine::ActionType; - if (!m_pLoadingScreen->isHidden() || !m_pIntroduceChapterView->isHidden()) + if (!m_pLoadingScreen->isHidden()) return; + if (!m_pIntroduceChapterView->isHidden() && action == ActionType::UI_ToggleMainMenu) + { + m_pIntroduceChapterView->close(); + return; + } + if (m_Engine.getConsole().isOpen()) { if (action == ActionType::UI_Close || action == ActionType::UI_ToggleConsole) diff --git a/src/ui/IntroduceChapterView.cpp b/src/ui/IntroduceChapterView.cpp index dc8a9339..2fb41ef3 100644 --- a/src/ui/IntroduceChapterView.cpp +++ b/src/ui/IntroduceChapterView.cpp @@ -3,30 +3,30 @@ #include "IntroduceChapterView.h" #include #include +#include