Allow theming of powerup/attachment icons (#4258)
* Allow theming of powerup/attachment icons Icons were optimized with `pngquant` then `optimize_data.sh` * Change help screens to use icons from icons folder rather than `models`
BIN
data/gui/icons/anchor-attach-icon.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
data/gui/icons/anchor-icon.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
data/gui/icons/bomb-attach-icon.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
data/gui/icons/bowling-icon.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
data/gui/icons/bubblegum-icon.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
data/gui/icons/cake-icon.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
data/gui/icons/parachute-attach-icon.png
Normal file
After Width: | Height: | Size: 6.2 KiB |
BIN
data/gui/icons/parachute-icon.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
data/gui/icons/plunger-icon.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
BIN
data/gui/icons/rubber_ball-icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
data/gui/icons/shield-icon.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
data/gui/icons/swatter-icon.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
BIN
data/gui/icons/zipper_collect.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
@ -32,57 +32,57 @@
|
||||
<spacer height="2%" width="10"/>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/bubblegum_icon.png" alt_icon="models/bubblegum-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/bubblegum-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%" text="BubbleGum - protect yourself with a shield, or use while looking back to leave a sticky pink puddle behind you."/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/zipper_collect.png" alt_icon="models/zipper_collect.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/zipper_collect.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%" text="Zipper - will give you a strong speed boost. But beware of not losing control of your kart!"/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/cake_icon.png" alt_icon="models/cake-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/cake-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%"
|
||||
text="Cake - thrown at the closest rival, best on short ranges and long straights. It also affects other karts close to the explosion."/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/plunger_icon.png" alt_icon="models/plunger-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/plunger-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%" text="Plunger - throw straight to pull an opponent back, or throw while looking back to make one lose sight."/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/bowling_icon.png" alt_icon="models/bowling-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/bowling-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%"
|
||||
text="Bowling Ball - goes straight until it strikes, it can bounce off walls. If you are looking back, it will be thrown backwards."/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/parachute_icon.png" alt_icon="models/parachute-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/parachute-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%" text="Parachute - slows down all karts in a better position."/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/swap_icon.png" alt_icon="models/swap-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/swap-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%" text="Swapper - gift boxes are transformed into bananas, nitro cans into bubblegums, and vice versa for a short time."/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/rubber_ball_icon.png" alt_icon="models/rubber_ball-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/rubber_ball-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%" text="Basket Ball - bounces after the leader, and might squash and slow down karts down on the way."/>
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="1" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/swatter_icon.png" alt_icon="models/swatter-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/swatter-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%" text="Swatter - will squash karts close by, slowing them down. Can also be used to remove parachutes and bombs."/>
|
||||
</div>
|
||||
|
@ -32,7 +32,7 @@
|
||||
<spacer height="2%" width="10"/>
|
||||
|
||||
<div width="100%" proportion="2" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/anchor_icon.png" alt_icon="models/anchor-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/anchor-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%"
|
||||
I18N="In the help menu"
|
||||
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
|
||||
<div width="100%" proportion="2" layout="horizontal-row">
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/parachute_icon.png" alt_icon="models/parachute-icon.png"/>
|
||||
<icon align="center" width="8%" height="100%" icon="gui/icons/parachute-icon.png"/>
|
||||
<spacer width="3%" height="100%"/>
|
||||
<bubble proportion="1" height="100%"
|
||||
I18N="In the help menu"
|
||||
|
@ -2416,14 +2416,14 @@ void Skin::drawBadgeOn(const Widget* widget, const core::recti& rect)
|
||||
if (widget->m_badges & ZIPPER_BADGE)
|
||||
{
|
||||
float max_icon_size = 0.43f;
|
||||
video::ITexture* texture = irr_driver->getTexture(FileManager::MODEL,
|
||||
video::ITexture* texture = irr_driver->getTexture(FileManager::GUI_ICON,
|
||||
"zipper_collect.png");
|
||||
doDrawBadge(texture, rect, max_icon_size, false);
|
||||
}
|
||||
if (widget->m_badges & ANCHOR_BADGE)
|
||||
{
|
||||
float max_icon_size = 0.43f;
|
||||
video::ITexture* texture = irr_driver->getTexture(FileManager::MODEL,
|
||||
video::ITexture* texture = irr_driver->getTexture(FileManager::GUI_ICON,
|
||||
"anchor-icon.png");
|
||||
doDrawBadge(texture, rect, max_icon_size, false);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "graphics/sp/sp_base.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/skin.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
|
||||
AttachmentManager *attachment_manager = 0;
|
||||
@ -93,7 +94,8 @@ void AttachmentManager::loadModels()
|
||||
if(iat[i].icon_file)
|
||||
{
|
||||
std::string full_icon_path =
|
||||
file_manager->getAsset(FileManager::MODEL, iat[i].icon_file);
|
||||
GUIEngine::getSkin()->getThemedIcon(std::string("gui/icons/")
|
||||
+ iat[i].icon_file);
|
||||
m_all_icons[iat[i].attachment] =
|
||||
material_manager->getMaterial(full_icon_path,
|
||||
/* full_path */ true,
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "graphics/material.hpp"
|
||||
#include "graphics/material_manager.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/skin.hpp"
|
||||
#include "io/file_manager.hpp"
|
||||
#include "io/xml_node.hpp"
|
||||
#include "items/bowling.hpp"
|
||||
@ -453,6 +454,7 @@ void PowerupManager::loadPowerup(PowerupType type, const XMLNode &node)
|
||||
{
|
||||
std::string icon_file("");
|
||||
node.get("icon", &icon_file);
|
||||
icon_file = GUIEngine::getSkin()->getThemedIcon("gui/icons/" + icon_file);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (icon_file.size() == 0)
|
||||
@ -464,7 +466,7 @@ void PowerupManager::loadPowerup(PowerupType type, const XMLNode &node)
|
||||
#endif
|
||||
|
||||
m_all_icons[type] = material_manager->getMaterial(icon_file,
|
||||
/* full_path */ false,
|
||||
/* full_path */ true,
|
||||
/*make_permanent */ true);
|
||||
|
||||
|
||||
|