summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp2
-rw-r--r--src/gui/gui.h7
-rw-r--r--src/gui/sdlfont.cpp4
-rw-r--r--src/gui/theme.cpp2
-rw-r--r--src/gui/theme.h5
-rw-r--r--src/gui/viewport.cpp6
-rw-r--r--src/gui/viewport.h2
-rw-r--r--src/gui/widgets/button.h2
-rw-r--r--src/gui/widgets/characterdisplay.cpp2
-rw-r--r--src/gui/widgets/dropdown.cpp2
-rw-r--r--src/gui/widgets/emotepage.h2
-rw-r--r--src/gui/widgets/itemcontainer.h2
-rw-r--r--src/gui/widgets/listbox.h2
-rw-r--r--src/gui/widgets/playerbox.cpp9
-rw-r--r--src/gui/widgets/progressbar.cpp3
-rw-r--r--src/gui/widgets/scrollarea.cpp24
-rw-r--r--src/gui/widgets/slider.cpp3
-rw-r--r--src/gui/widgets/sliderlist.cpp3
-rw-r--r--src/gui/widgets/sliderlist.h2
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/spellshortcutcontainer.h2
-rw-r--r--src/gui/widgets/tabs/chattab.cpp11
-rw-r--r--src/gui/widgets/tabs/guildchattab.cpp6
-rw-r--r--src/gui/widgets/tabs/setup_input.cpp9
-rw-r--r--src/gui/widgets/tabs/setup_input.h9
-rw-r--r--src/gui/widgets/tabs/setuptabscroll.h2
-rw-r--r--src/gui/widgets/tabs/whispertab.cpp5
-rw-r--r--src/gui/widgets/textfield.cpp4
-rw-r--r--src/gui/windows/chatwindow.cpp8
-rw-r--r--src/gui/windows/chatwindow.h8
-rw-r--r--src/gui/windows/equipmentwindow.cpp2
-rw-r--r--src/gui/windows/equipmentwindow.h2
-rw-r--r--src/gui/windows/outfitwindow.cpp2
-rw-r--r--src/gui/windows/outfitwindow.h2
-rw-r--r--src/gui/windows/shopwindow.cpp2
-rw-r--r--src/gui/windows/shopwindow.h2
-rw-r--r--src/gui/windows/statuswindow.cpp2
-rw-r--r--src/gui/windows/statuswindow.h5
-rw-r--r--src/gui/windows/whoisonline.h2
39 files changed, 75 insertions, 96 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index dcd4d82ea..126fc9a3b 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -940,7 +940,7 @@ void Gui::removeDragged(gcn::Widget *widget)
mFocusHandler->setDraggedWidget(nullptr);
}
-uint32_t Gui::getMouseState(int *const x, int *const y) const
+uint32_t Gui::getMouseState(int *const x, int *const y)
{
const uint32_t res = SDL_GetMouseState(x, y);
const int scale = mainGraphics->getScale();
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 033a71282..5fddc7df7 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -147,8 +147,9 @@ class Gui final : public gcn::Gui
MouseEvent *createMouseEvent(Window *const widget) A_WARN_UNUSED;
- void getAbsolutePosition(gcn::Widget *restrict widget,
- int &restrict x, int &restrict y);
+ static void getAbsolutePosition(gcn::Widget *restrict widget,
+ int &restrict x,
+ int &restrict y);
void addGlobalFocusListener(gcn::FocusListener* focusListener);
@@ -164,7 +165,7 @@ class Gui final : public gcn::Gui
int getLastMouseY() const
{ return mLastMouseY; }
- uint32_t getMouseState(int *const x, int *const y) const;
+ static uint32_t getMouseState(int *const x, int *const y);
protected:
void handleMouseMoved(const gcn::MouseInput &mouseInput);
diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp
index 8ef78c262..f97970a26 100644
--- a/src/gui/sdlfont.cpp
+++ b/src/gui/sdlfont.cpp
@@ -404,8 +404,8 @@ TTF_Font *SDLFont::openFont(const char *const name, const int size)
// return nullptr;
// return TTF_OpenFontIndexRW(rw, 1, size, 0);
// #else
- return TTF_OpenFontIndex(ResourceManager::getInstance()->getPath(
- name).c_str(), size, 0);
+ return TTF_OpenFontIndex(ResourceManager::getPath(name).c_str(),
+ size, 0);
// #endif
}
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 44f2ca24e..4218aff7c 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -1179,7 +1179,7 @@ Skin *Theme::loadSkinRect(ImageRect &image, const std::string &name,
}
void Theme::unloadRect(const ImageRect &rect, const int start,
- const int end) const
+ const int end)
{
for (int f = start; f <= end; f ++)
{
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 910964bdf..b40be2881 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -502,8 +502,9 @@ class Theme final : public Palette, public ConfigListener
const std::string &name2, const int start = 0,
const int end = 8);
- void unloadRect(const ImageRect &rect, const int start = 0,
- const int end = 8) const;
+ static void unloadRect(const ImageRect &rect,
+ const int start = 0,
+ const int end = 8);
static Image *getImageFromThemeXml(const std::string &name,
const std::string &name2)
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 5206b7424..341af1f0b 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -277,7 +277,7 @@ void Viewport::_followMouse()
{
if (!gui)
return;
- const uint8_t button = gui->getMouseState(&mMouseX, &mMouseY);
+ const uint8_t button = Gui::getMouseState(&mMouseX, &mMouseY);
// If the left button is dragged
if (mPlayerFollowMouse && (button & SDL_BUTTON(1)))
{
@@ -302,7 +302,7 @@ void Viewport::_drawDebugPath(Graphics *const graphics)
if (!player_node || !userPalette || !actorManager || !mMap || !gui)
return;
- gui->getMouseState(&mMouseX, &mMouseY);
+ Gui::getMouseState(&mMouseX, &mMouseY);
static Path debugPath;
static Vector lastMouseDestination = Vector(0.0F, 0.0F);
@@ -1034,7 +1034,7 @@ void Viewport::returnCamera()
mCameraRelativeY = 0;
}
-void Viewport::validateSpeed() const
+void Viewport::validateSpeed()
{
if (!inputManager.isActionActive(static_cast<int>(
Input::KEY_TARGET_ATTACK)) && !inputManager.isActionActive(
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index 2ccb5ddac..dcddc003c 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -284,7 +284,7 @@ class Viewport final : public WindowContainer,
/// Clears any matching hovers
void clearHover(const ActorSprite *const actor);
- void validateSpeed() const;
+ static void validateSpeed();
private:
/**
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index a2333d581..3dd783e52 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -107,7 +107,7 @@ class Button final : public gcn::Button,
/**
* Update the alpha value to the button components.
*/
- void updateAlpha();
+ static void updateAlpha();
void mouseReleased(gcn::MouseEvent& mouseEvent) override final;
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index bd3f042f9..5ae4e2f5b 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -127,7 +127,7 @@ void CharacterDisplay::mouseMoved(gcn::MouseEvent &event A_UNUSED)
int mouseX = 0;
int mouseY = 0;
- gui->getMouseState(&mouseX, &mouseY);
+ Gui::getMouseState(&mouseX, &mouseY);
const std::string &name = mName->getCaption();
if (!name.empty())
{
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 068ffe1fc..59cdec6fb 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -183,7 +183,7 @@ DropDown::~DropDown()
if (theme)
{
theme->unload(mSkin);
- theme->unloadRect(skinRect);
+ Theme::unloadRect(skinRect);
}
}
}
diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h
index 8cef8f058..132cfb8e9 100644
--- a/src/gui/widgets/emotepage.h
+++ b/src/gui/widgets/emotepage.h
@@ -53,7 +53,7 @@ class EmotePage final : public gcn::Widget,
void resetAction();
- int getSelectedIndex()
+ int getSelectedIndex() const
{ return mSelectedIndex; }
private:
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index 272536c87..f4a73af9f 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -134,7 +134,7 @@ class ItemContainer final : public gcn::Widget,
void updateMatrix();
- bool getClickCount() A_WARN_UNUSED
+ bool getClickCount() const A_WARN_UNUSED
{ return mClicks; }
private:
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index 83a33eb62..b1a2f0da5 100644
--- a/src/gui/widgets/listbox.h
+++ b/src/gui/widgets/listbox.h
@@ -97,7 +97,7 @@ class ListBox : public gcn::ListBox,
void setCenter(const bool b)
{ mCenterText = b; }
- int getPressedIndex()
+ int getPressedIndex() const
{ return mPressedIndex; }
unsigned int getRowHeight() const override A_WARN_UNUSED
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index 2e078c088..6fda932bf 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -70,13 +70,8 @@ PlayerBox::~PlayerBox()
if (gui)
gui->removeDragged(this);
- Theme *const theme = Theme::instance();
- if (theme)
- {
- theme->unloadRect(mBackground);
- theme->unloadRect(mSelectedBackground);
- }
-
+ Theme::unloadRect(mBackground);
+ Theme::unloadRect(mSelectedBackground);
mBeing = nullptr;
}
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index aecb323f8..38257e0a8 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -101,8 +101,7 @@ ProgressBar::~ProgressBar()
theme->unload(mSkin);
mSkin = nullptr;
}
- if (theme)
- theme->unloadRect(mFillRect);
+ Theme::unloadRect(mFillRect);
delete mVertexes;
mVertexes = nullptr;
}
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index 6d7695198..a260142a1 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -96,23 +96,19 @@ ScrollArea::~ScrollArea()
delete getContent();
instances--;
- const Theme *const theme = Theme::instance();
- if (theme)
+ if (instances == 0)
{
- if (instances == 0)
+ Theme::unloadRect(background);
+ Theme::unloadRect(vMarker);
+ Theme::unloadRect(vMarkerHi);
+ Theme::unloadRect(vBackground);
+ Theme::unloadRect(hBackground);
+ for (int i = 0; i < 2; i ++)
{
- theme->unloadRect(background);
- theme->unloadRect(vMarker);
- theme->unloadRect(vMarkerHi);
- theme->unloadRect(vBackground);
- theme->unloadRect(hBackground);
- for (int i = 0; i < 2; i ++)
+ for (int f = UP; f < BUTTONS_DIR; f ++)
{
- for (int f = UP; f < BUTTONS_DIR; f ++)
- {
- if (buttons[f][i])
- buttons[f][i]->decRef();
- }
+ if (buttons[f][i])
+ buttons[f][i]->decRef();
}
}
}
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index 37b696a4e..750b58528 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -72,9 +72,8 @@ Slider::~Slider()
mInstances--;
if (mInstances == 0 && Theme::instance())
{
- const Theme *const theme = Theme::instance();
for (int mode = 0; mode < 2; mode ++)
- theme->unloadRect(buttons[mode]);
+ Theme::unloadRect(buttons[mode]);
}
}
diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp
index 6dd968eef..60d7926d1 100644
--- a/src/gui/widgets/sliderlist.cpp
+++ b/src/gui/widgets/sliderlist.cpp
@@ -77,8 +77,7 @@ SliderList::~SliderList()
void SliderList::updateAlpha()
{
- mButtons[0]->updateAlpha();
- mButtons[1]->updateAlpha();
+ Button::updateAlpha();
}
void SliderList::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent)
diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h
index 4ef673b83..73f8c6f5c 100644
--- a/src/gui/widgets/sliderlist.h
+++ b/src/gui/widgets/sliderlist.h
@@ -67,7 +67,7 @@ class SliderList final : public Container,
void adjustSize();
- int getSelected() A_WARN_UNUSED
+ int getSelected() const A_WARN_UNUSED
{ return mSelectedIndex; }
protected:
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index c4e4b0671..bf14f21fe 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -321,7 +321,7 @@ void SpellShortcutContainer::widgetHidden(const gcn::Event &event A_UNUSED)
mSpellPopup->setVisible(false);
}
-int SpellShortcutContainer::getItemByIndex(const int index)
+int SpellShortcutContainer::getItemByIndex(const int index) const
{
return spellShortcut->getItem(
(mNumber * SPELL_SHORTCUT_ITEMS) + index);
diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h
index 31e98a592..37e7b5660 100644
--- a/src/gui/widgets/spellshortcutcontainer.h
+++ b/src/gui/widgets/spellshortcutcontainer.h
@@ -75,7 +75,7 @@ class SpellShortcutContainer final : public ShortcutContainer
void setWidget2(const Widget2 *const widget) override final;
- int getItemByIndex(const int index);
+ int getItemByIndex(const int index) const A_WARN_UNUSED;
private:
SpellPopup *mSpellPopup;
diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp
index 1795fd03e..331101209 100644
--- a/src/gui/widgets/tabs/chattab.cpp
+++ b/src/gui/widgets/tabs/chattab.cpp
@@ -418,15 +418,8 @@ void ChatTab::clearText()
void ChatTab::handleInput(const std::string &msg)
{
- if (chatWindow)
- {
- Net::getChatHandler()->talk(chatWindow->doReplace(msg),
- mChannelName);
- }
- else
- {
- Net::getChatHandler()->talk(msg, mChannelName);
- }
+ Net::getChatHandler()->talk(ChatWindow::doReplace(msg),
+ mChannelName);
}
void ChatTab::handleCommand(const std::string &msg)
diff --git a/src/gui/widgets/tabs/guildchattab.cpp b/src/gui/widgets/tabs/guildchattab.cpp
index 364b83968..8de95991f 100644
--- a/src/gui/widgets/tabs/guildchattab.cpp
+++ b/src/gui/widgets/tabs/guildchattab.cpp
@@ -107,11 +107,7 @@ void GuildChatTab::handleInput(const std::string &msg)
{
if (!guildManager)
return;
-
- if (chatWindow)
- guildManager->chat(chatWindow->doReplace(msg));
- else
- guildManager->chat(msg);
+ guildManager->chat(ChatWindow::doReplace(msg));
}
void GuildChatTab::showHelp()
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp
index 2ce99d971..9ce6fd616 100644
--- a/src/gui/widgets/tabs/setup_input.cpp
+++ b/src/gui/widgets/tabs/setup_input.cpp
@@ -270,7 +270,7 @@ void Setup_Input::action(const gcn::ActionEvent &event)
else if (id == "resetkeys")
{
inputManager.resetKeys();
- inputManager.update();
+ InputManager::update();
refreshKeys();
}
else if (id == "default")
@@ -378,8 +378,9 @@ void Setup_Input::keyUnresolved()
}
void Setup_Input::fixTranslation(SetupActionData *const actionDatas,
- const int actionStart, const int actionEnd,
- const std::string &text) const
+ const int actionStart,
+ const int actionEnd,
+ const std::string &text)
{
int k = 0;
@@ -397,7 +398,7 @@ void Setup_Input::fixTranslation(SetupActionData *const actionDatas,
}
}
-void Setup_Input::fixTranslations() const
+void Setup_Input::fixTranslations()
{
fixTranslation(setupActionData1, static_cast<int>(Input::KEY_SHORTCUT_1),
static_cast<int>(Input::KEY_SHORTCUT_20), "Item Shortcut %d");
diff --git a/src/gui/widgets/tabs/setup_input.h b/src/gui/widgets/tabs/setup_input.h
index cb2e5cac0..135cb3339 100644
--- a/src/gui/widgets/tabs/setup_input.h
+++ b/src/gui/widgets/tabs/setup_input.h
@@ -82,11 +82,12 @@ class Setup_Input final : public SetupTab
std::string keyToString(const int index) const A_WARN_UNUSED;
private:
- void fixTranslations() const;
+ static void fixTranslations();
- void fixTranslation(SetupActionData *const actionDatas,
- const int actionStart, const int actionEnd,
- const std::string &text) const;
+ static void fixTranslation(SetupActionData *const actionDatas,
+ const int actionStart,
+ const int actionEnd,
+ const std::string &text);
KeyListModel *mKeyListModel;
ListBox *mKeyList;
diff --git a/src/gui/widgets/tabs/setuptabscroll.h b/src/gui/widgets/tabs/setuptabscroll.h
index e3d495690..fb7de574d 100644
--- a/src/gui/widgets/tabs/setuptabscroll.h
+++ b/src/gui/widgets/tabs/setuptabscroll.h
@@ -60,7 +60,7 @@ class SetupTabScroll : public SetupTab
override final
{ }
- int getPreferredFirstItemSize() A_WARN_UNUSED
+ int getPreferredFirstItemSize() const A_WARN_UNUSED
{ return mPreferredFirstItemSize; }
void widgetResized(const gcn::Event &event) override final;
diff --git a/src/gui/widgets/tabs/whispertab.cpp b/src/gui/widgets/tabs/whispertab.cpp
index 659704638..2d1e2969a 100644
--- a/src/gui/widgets/tabs/whispertab.cpp
+++ b/src/gui/widgets/tabs/whispertab.cpp
@@ -52,10 +52,7 @@ WhisperTab::~WhisperTab()
void WhisperTab::handleInput(const std::string &msg)
{
std::string newMsg;
- if (chatWindow)
- newMsg = chatWindow->doReplace(msg);
- else
- newMsg = msg;
+ newMsg = ChatWindow::doReplace(msg);
Net::getChatHandler()->privateMessage(mNick, newMsg);
if (player_node)
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 41084c867..269ace775 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -116,7 +116,7 @@ TextField::~TextField()
if (theme)
{
theme->unload(mSkin);
- theme->unloadRect(skin);
+ Theme::unloadRect(skin);
}
}
}
@@ -745,7 +745,7 @@ void TextField::mousePressed(gcn::MouseEvent &mouseEvent)
{
int x = 0;
int y = 0;
- gui->getMouseState(&x, &y);
+ Gui::getMouseState(&x, &y);
mPopupMenu->showTextFieldPopup(x, y, this);
}
}
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 6af18ff06..955171bea 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -452,7 +452,7 @@ ChatTab *ChatWindow::getFocused() const
return static_cast<ChatTab*>(mChatTabs->getSelectedTab());
}
-void ChatWindow::clearTab(ChatTab *const tab) const
+void ChatWindow::clearTab(ChatTab *const tab)
{
if (tab)
tab->clearText();
@@ -1386,7 +1386,7 @@ void ChatWindow::autoComplete()
}
std::string ChatWindow::autoComplete(StringVect &names,
- std::string partName) const
+ std::string partName)
{
StringVectCIter i = names.begin();
const StringVectCIter i_end = names.end();
@@ -1770,7 +1770,7 @@ void ChatWindow::saveState() const
}
}
-std::string ChatWindow::doReplace(const std::string &msg) const
+std::string ChatWindow::doReplace(const std::string &msg)
{
std::string str = msg;
replaceSpecialChars(str);
@@ -1918,7 +1918,7 @@ void ChatWindow::updateVisibility()
int mouseY = 0;
int x = 0;
int y = 0;
- gui->getMouseState(&mouseX, &mouseY);
+ Gui::getMouseState(&mouseX, &mouseY);
getAbsolutePosition(x, y);
if (mChatInput->isVisible())
{
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index c000215f1..3093c52e9 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -109,7 +109,7 @@ class ChatWindow final : public Window,
/**
* Clear the given tab.
*/
- void clearTab(ChatTab *const tab) const;
+ static void clearTab(ChatTab *const tab);
/**
* Clear the current tab.
@@ -253,7 +253,7 @@ class ChatWindow final : public Window,
void loadGMCommands();
- std::string doReplace(const std::string &msg) const A_WARN_UNUSED;
+ static std::string doReplace(const std::string &msg) A_WARN_UNUSED;
void adjustTabSize();
@@ -328,8 +328,8 @@ class ChatWindow final : public Window,
std::string autoComplete(const std::string &partName,
History *const words) const;
- std::string autoComplete(StringVect &names,
- std::string partName) const;
+ static std::string autoComplete(StringVect &names,
+ std::string partName);
/** Used for showing item popup on clicking links **/
ItemLinkHandler *mItemLinkHandler;
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 621f5e537..dcc4c9d77 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -552,7 +552,7 @@ void EquipmentWindow::loadSlot(const XmlNodePtr slotNode,
mMaxY = y + mBoxSize;
}
-int EquipmentWindow::parseSlotName(const std::string &name) const
+int EquipmentWindow::parseSlotName(const std::string &name)
{
int id = -1;
if (name == "shoes" || name == "boot" || name == "boots")
diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h
index d291a5f81..7387fb249 100644
--- a/src/gui/windows/equipmentwindow.h
+++ b/src/gui/windows/equipmentwindow.h
@@ -122,7 +122,7 @@ class EquipmentWindow final : public Window, public gcn::ActionListener
void loadSlot(const XmlNodePtr slotNode,
const ImageSet *const imageset);
- int parseSlotName(const std::string &name) const A_WARN_UNUSED;
+ static int parseSlotName(const std::string &name) A_WARN_UNUSED;
Equipment *mEquipment;
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index c5df4b652..d686056ac 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -524,7 +524,7 @@ void OutfitWindow::unequipNotInOutfit(const int outfit) const
}
}
-std::string OutfitWindow::keyName(const int number) const
+std::string OutfitWindow::keyName(const int number)
{
if (number < 0 || number >= SHORTCUT_EMOTES)
return "";
diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h
index 4f6e5c0bf..eeedc2ec6 100644
--- a/src/gui/windows/outfitwindow.h
+++ b/src/gui/windows/outfitwindow.h
@@ -89,7 +89,7 @@ class OutfitWindow final : public Window,
void showCurrentOutfit();
- std::string keyName(const int number) const A_WARN_UNUSED;
+ static std::string keyName(const int number) A_WARN_UNUSED;
void clearCurrentOutfit();
diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp
index 48bfedb06..a940e4cdb 100644
--- a/src/gui/windows/shopwindow.cpp
+++ b/src/gui/windows/shopwindow.cpp
@@ -632,7 +632,7 @@ void ShopWindow::sendMessage(const std::string &nick,
chatWindow->addWhisper(nick, data, BY_PLAYER);
}
-void ShopWindow::showList(const std::string &nick, std::string data) const
+void ShopWindow::showList(const std::string &nick, std::string data)
{
BuyDialog *buyDialog = nullptr;
SellDialog *sellDialog = nullptr;
diff --git a/src/gui/windows/shopwindow.h b/src/gui/windows/shopwindow.h
index 590a05dcc..95eee1e05 100644
--- a/src/gui/windows/shopwindow.h
+++ b/src/gui/windows/shopwindow.h
@@ -121,7 +121,7 @@ class ShopWindow final : public Window,
void sendMessage(const std::string &nick, std::string data,
const bool random = false);
- void showList(const std::string &nick, std::string data) const;
+ static void showList(const std::string &nick, std::string data);
void processRequest(const std::string &nick, std::string data,
const int mode);
diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp
index 567460927..8d78447a7 100644
--- a/src/gui/windows/statuswindow.cpp
+++ b/src/gui/windows/statuswindow.cpp
@@ -606,7 +606,7 @@ void StatusWindow::updateJobBar(ProgressBar *const bar, const bool percent)
}
void StatusWindow::updateProgressBar(ProgressBar *const bar, const int id,
- const bool percent) const
+ const bool percent)
{
const std::pair<int, int> exp = PlayerInfo::getStatExperience(id);
updateProgressBar(bar, exp.first, exp.second, percent);
diff --git a/src/gui/windows/statuswindow.h b/src/gui/windows/statuswindow.h
index 414449df0..94f1aaa65 100644
--- a/src/gui/windows/statuswindow.h
+++ b/src/gui/windows/statuswindow.h
@@ -79,8 +79,9 @@ class StatusWindow final : public Window,
const bool percent = true);
static void updateProgressBar(ProgressBar *const bar, const int value,
const int max, const bool percent);
- void updateProgressBar(ProgressBar *const bar, const int id,
- const bool percent = true) const;
+ static void updateProgressBar(ProgressBar *const bar,
+ const int id,
+ const bool percent = true);
void action(const gcn::ActionEvent &event) override;
diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h
index 1057f1898..10a8be4b5 100644
--- a/src/gui/windows/whoisonline.h
+++ b/src/gui/windows/whoisonline.h
@@ -153,7 +153,7 @@ public:
void readFromWeb();
- void setNeutralColor(OnlinePlayer *const player);
+ static void setNeutralColor(OnlinePlayer *const player);
void getPlayerNames(StringVect &names);