Skip to content

Commit

Permalink
Fix #4923 (#4981)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingJellyfish authored Jan 6, 2024
1 parent b35cd18 commit 3928a49
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/states_screens/dialogs/addons_loading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions src/states_screens/dialogs/addons_loading.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class AddonsLoading : public GUIEngine::ModalDialog

/** 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
Expand Down

0 comments on commit 3928a49

Please sign in to comment.