feat(ui): add microphone icon when recording voice

This commit is contained in:
2026-07-20 18:35:37 +08:00
parent b64d887e78
commit 527178e067
10 changed files with 34 additions and 11 deletions

View File

@@ -51,6 +51,7 @@ public:
void receive_voice(std::span<const char> opus, const glm::vec3& pos);
AudioRecording& audio_recording();
const AudioRecording& audio_recording() const;
private:
using FadeMap = std::unordered_map<std::string, AudioFade>;

View File

@@ -100,6 +100,7 @@ public:
int chunk_size() const;
static AABB get_block_aabb(const glm::ivec3& pos);
AudioEngine& get_audio();
const AudioEngine& get_audio() const;
Config& get_config();
WorldScene& world_scene();
void set_direct_exit();

View File

@@ -39,6 +39,8 @@ public:
// Not thread safe
void handle_chat_message(ChatMessage& message);
bool is_recording() const;
private:
SceneManager& m_scene_manager;
DevPanel m_dev_panel;

View File

@@ -1,6 +1,7 @@
#pragma once
#include "Cubed/ui/chat_box.hpp"
#include "Cubed/ui/image.hpp"
#include "Cubed/ui/ui_manager.hpp"
#include "Cubed/ui/widget.hpp"
@@ -18,7 +19,7 @@ public:
void init() override;
void render(Renderer& renderer) override;
void update(float dt) override;
void set_chatting(bool chantting, bool sned);
void add_chat_message(ChatMessage& message);
@@ -26,6 +27,8 @@ public:
private:
bool handle_key_event(const KeyEvent& e) override;
WorldScene& m_scene;
ChatBox* m_chat_box;
ChatBox* m_chat_box = nullptr;
Image* m_mircophone = nullptr;
};
} // namespace Cubed