palladium/include/pd/overlays/message_mgr.hpp
tobid7 b4a4b6a426 # Rewrite Stage 1.5
- Added Overlays (Performance / Keyboaed)
- Keyboard has Gamepad Movement WIP (kinda)
- Work on UI7 Started
- Added Input Manager
- Added Message Boxes (Animated)
- Added Signle Header Tween func for animated stuff (Keyboard Messages, etc)
- Add FastHash (Maybe useful later)
- Using const & for vec in lithium
- Add ability to copy a command by a Ref
- Make Lists in Commands OpenAccess for Modification (StaticObject)
- Add Static Object (System to PreRender Suff that never changes) but can still be recolored or moved
- Add Layer and Font change functions
- Make Renderer Tools (RotateCorner, CreateRect, CreateLine, InBox, OptiCommandList) static (OpenAccess)
- Add ReIndexing to PushCommand
- Add Ability to Init vec3 and vec4 with vec2 and add .xy and .zw to vec4
- Fully Animated Keyboard that currently has problem of Top Down GamePad movement
- Add Func to Get GamePad Icon Codepoints for TextRenderer
- Made deltatime a float
- Using filesystem::path().wstring for convertation (works)
- Add a New InBox to Renderer that only checks if a point is inside a boundingbox
- Disable Font loading on Renderer Init due to 3ds Freezes when using SystemFont
- Make SystemFont lineheight 10% larger than it is to be nearly the same size as the ttf fonts
- Fix Some SpaceOffsets between TTF and SystemFont Rendering
- Cleanup the Update Rendermode Func
- Use LayerRenderSystem by default now as it now runs faster even with ttf fonts
2025-01-19 20:16:43 +01:00

45 lines
1.3 KiB
C++

#pragma once
#include <pd/graphics/lithium.hpp>
#include <pd/maths/color.hpp>
#include <pd/maths/tween.hpp>
namespace PD {
class MessageMgr : public PD::SmartCtor<MessageMgr> {
public:
class Container : public PD::SmartCtor<Container> {
public:
Container(const std::string& title, const std::string& msg);
~Container() {}
void Render(PD::LI::Renderer::Ref ren);
void Update(int slot, float delta);
void FlyIn();
void ToBeMoved(int slot);
void ToBeRemoved();
bool ShouldBeRemoved() const { return (tbr && pos.IsFinished()) || kill; }
private:
PD::Color col_bg; // Background Color
PD::Color col_text; // Text Color
float lifetime = 0.f; // LifeTime
PD::Tween<vec2> pos; // Position effect
std::string title; // Title
std::string msg; // Message
vec2 size; // Size of the Background
bool tbr = false; // To be Removed ?
bool kill = false; // Instant Kill
int s = 0; // Slot
};
MessageMgr(PD::LI::Renderer::Ref r) { ren = r; }
~MessageMgr() {}
void Push(const std::string& title, const std::string& text);
void Update(float delta);
private:
std::vector<Container::Ref> msgs;
PD::LI::Renderer::Ref ren;
};
} // namespace PD