This commit is contained in:
CodingJellyfish 2024-01-06 12:17:57 +08:00 committed by GitHub
parent b35cd18eb0
commit 3928a49d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -18,10 +18,12 @@
#include "states_screens/dialogs/addons_loading.hpp"
#include "audio/sfx_manager.hpp"
#include "addons/addons_manager.hpp"
#include "config/player_manager.hpp"
#include "config/user_config.hpp"
#include "guiengine/engine.hpp"
#include "guiengine/message_queue.hpp"
#include "guiengine/scalable_font.hpp"
#include "guiengine/widgets.hpp"
#include "input/input_manager.hpp"
@ -55,7 +57,7 @@ AddonsLoading::AddonsLoading(const std::string &id)
, m_addon(*(addons_manager->getAddon(id)) )
#endif
{
m_message_shown = false;
m_icon_shown = false;
#ifdef SERVER_ONLY
m_icon_downloaded = std::make_shared<bool>(false);
@ -279,6 +281,16 @@ void AddonsLoading::voteClicked()
dismiss();
new VoteDialog(addon_id);
}
else
{
SFXManager::get()->quickSound("anvil");
if (!m_message_shown)
{
MessageQueue::add(MessageQueue::MT_ERROR,
_("You must be logged in to rate this addon."));
m_message_shown = true;
}
}
#endif
} // voteClicked

View File

@ -51,6 +51,8 @@ private:
/** True if the icon is being displayed. */
bool m_icon_shown;
/** True if the error message has shown once. */
bool m_message_shown;
std::shared_ptr<bool> m_icon_downloaded;
/** A pointer to the download request, which gives access