mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
revertt
This commit is contained in:
parent
484ece088f
commit
bc981a2e29
6 changed files with 8 additions and 15 deletions
|
@ -235,7 +235,7 @@ local style_fs = [[
|
|||
style[one_btn15;border=false;bgcolor=#1cc;bgimg=testformspec_bg.png;bgimg_hovered=testformspec_bg_hovered.png;bgimg_pressed=testformspec_bg_pressed.png]
|
||||
item_image_button[1.25,9.6;1,1;testformspec:item;one_btn15;Bg]
|
||||
|
||||
style[one_btn16;bgimg=testformspec_bg_9slice.png;bgimg_middle=4,6;padding=5,7;fgimg=testformspec_bg.png;fgimg_middle=1]
|
||||
style[one_btn16;border=false;bgimg=testformspec_bg_9slice.png;bgimg_middle=4,6;padding=5,7;fgimg=testformspec_bg.png;fgimg_middle=1]
|
||||
style[one_btn16:hovered;bgimg=testformspec_bg_9slice_hovered.png;fgimg=testformspec_bg_hovered.png]
|
||||
style[one_btn16:pressed;bgimg=testformspec_bg_9slice_pressed.png;fgimg=testformspec_bg_pressed.png]
|
||||
style[one_btn16:focused;bgimg=testformspec_bg_9slice_focused.png;fgimg=testformspec_bg_focused.png]
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
class StyleSpec;
|
||||
|
||||
using StyleSpecMap = std::unordered_map<std::string, std::vector<StyleSpec>>;
|
||||
|
||||
class StyleSpec
|
||||
{
|
||||
|
|
|
@ -255,10 +255,9 @@ void GUIButton::draw()
|
|||
|
||||
video::IVideoDriver* driver = Environment->getVideoDriver();
|
||||
IGUISkin *skin = Environment->getSkin();
|
||||
const bool is_9_slice_border = BgMiddle.getArea() > 0;
|
||||
// END PATCH
|
||||
|
||||
if (DrawBorder && !is_9_slice_border)
|
||||
if (DrawBorder)
|
||||
{
|
||||
if (!Pressed)
|
||||
{
|
||||
|
@ -307,14 +306,14 @@ void GUIButton::draw()
|
|||
// FIXME: Vertices can only be darkened because [0, 255] is normalized to [0, 1]
|
||||
// For reference: irr/src/OpenGL/Driver.cpp -> `vt2DImage`
|
||||
video::SColor image_colors[] = { BgColor, BgColor, BgColor, BgColor };
|
||||
if (!is_9_slice_border) {
|
||||
if (BgMiddle.getArea() == 0) {
|
||||
// Regular image button
|
||||
driver->draw2DImage(texture,
|
||||
ScaleImage? AbsoluteRect : core::rect<s32>(pos, sourceRect.getSize()),
|
||||
sourceRect, &AbsoluteClippingRect,
|
||||
image_colors, UseAlphaChannel);
|
||||
} else if (DrawBorder) {
|
||||
// The background image is 9-slice --> use as new border style
|
||||
} else {
|
||||
// This is generally used to replace the default border style
|
||||
draw2DImage9Slice(driver, texture,
|
||||
ScaleImage ? AbsoluteRect : core::rect<s32>(pos, sourceRect.getSize()),
|
||||
sourceRect, BgMiddle, &AbsoluteClippingRect, image_colors);
|
||||
|
|
|
@ -24,11 +24,6 @@ GUIButtonImage::GUIButtonImage(gui::IGUIEnvironment *environment,
|
|||
sendToBack(m_image.get());
|
||||
}
|
||||
|
||||
void GUIButtonImage::draw()
|
||||
{
|
||||
GUIButton::draw();
|
||||
}
|
||||
|
||||
void GUIButtonImage::setForegroundImage(irr_ptr<video::ITexture> image,
|
||||
const core::rect<s32> &middle)
|
||||
{
|
||||
|
|
|
@ -19,9 +19,6 @@ public:
|
|||
s32 id, core::rect<s32> rectangle, ISimpleTextureSource *tsrc,
|
||||
bool noclip = false);
|
||||
|
||||
//! draws the element and its children
|
||||
virtual void draw() override;
|
||||
|
||||
void setForegroundImage(irr_ptr<video::ITexture> image = nullptr,
|
||||
const core::rect<s32> &middle = core::rect<s32>());
|
||||
|
||||
|
|
|
@ -302,7 +302,6 @@ protected:
|
|||
bool precheckElement(const std::string &name, const std::string &element,
|
||||
size_t args_min, size_t args_max, std::vector<std::string> &parts);
|
||||
|
||||
using StyleSpecMap = std::unordered_map<std::string, std::vector<StyleSpec>>;
|
||||
StyleSpecMap theme_by_type, theme_by_name;
|
||||
std::unordered_set<std::string> property_warned;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue