mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
feat(ui): add microphone icon when recording voice
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user