From 03b34cb3dd0647b3e378f00cdc7203e580c9dcc8 Mon Sep 17 00:00:00 2001 From: kilbith Date: Fri, 3 Feb 2017 14:53:43 +0100 Subject: Serverlist: Add ping indicators (#5164) --- textures/base/pack/server_ping_1.png | Bin 0 -> 251 bytes textures/base/pack/server_ping_2.png | Bin 0 -> 244 bytes textures/base/pack/server_ping_3.png | Bin 0 -> 245 bytes textures/base/pack/server_ping_4.png | Bin 0 -> 213 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 textures/base/pack/server_ping_1.png create mode 100644 textures/base/pack/server_ping_2.png create mode 100644 textures/base/pack/server_ping_3.png create mode 100644 textures/base/pack/server_ping_4.png (limited to 'textures') diff --git a/textures/base/pack/server_ping_1.png b/textures/base/pack/server_ping_1.png new file mode 100644 index 000000000..ba5bba1e3 Binary files /dev/null and b/textures/base/pack/server_ping_1.png differ diff --git a/textures/base/pack/server_ping_2.png b/textures/base/pack/server_ping_2.png new file mode 100644 index 000000000..8dca0be0d Binary files /dev/null and b/textures/base/pack/server_ping_2.png differ diff --git a/textures/base/pack/server_ping_3.png b/textures/base/pack/server_ping_3.png new file mode 100644 index 000000000..c2cab017e Binary files /dev/null and b/textures/base/pack/server_ping_3.png differ diff --git a/textures/base/pack/server_ping_4.png b/textures/base/pack/server_ping_4.png new file mode 100644 index 000000000..03b4b5b83 Binary files /dev/null and b/textures/base/pack/server_ping_4.png differ -- cgit v1.2.3 From f5d4494a51a4f38553c10efd51a5c423cd357c87 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 10 Feb 2017 08:19:31 +0100 Subject: Add textures for air and ignore items (#5196) --- builtin/game/register.lua | 8 ++++---- textures/base/pack/air.png | Bin 0 -> 225 bytes textures/base/pack/ignore.png | Bin 0 -> 234 bytes 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 textures/base/pack/air.png create mode 100644 textures/base/pack/ignore.png (limited to 'textures') diff --git a/builtin/game/register.lua b/builtin/game/register.lua index 90f095e9f..ec6f28097 100644 --- a/builtin/game/register.lua +++ b/builtin/game/register.lua @@ -331,8 +331,8 @@ core.register_item(":unknown", { core.register_node(":air", { description = "Air (you hacker you!)", - inventory_image = "unknown_node.png", - wield_image = "unknown_node.png", + inventory_image = "air.png", + wield_image = "air.png", drawtype = "airlike", paramtype = "light", sunlight_propagates = true, @@ -348,8 +348,8 @@ core.register_node(":air", { core.register_node(":ignore", { description = "Ignore (you hacker you!)", - inventory_image = "unknown_node.png", - wield_image = "unknown_node.png", + inventory_image = "ignore.png", + wield_image = "ignore.png", drawtype = "airlike", paramtype = "none", sunlight_propagates = false, diff --git a/textures/base/pack/air.png b/textures/base/pack/air.png new file mode 100644 index 000000000..e2c487214 Binary files /dev/null and b/textures/base/pack/air.png differ diff --git a/textures/base/pack/ignore.png b/textures/base/pack/ignore.png new file mode 100644 index 000000000..a73d2222d Binary files /dev/null and b/textures/base/pack/ignore.png differ -- cgit v1.2.3 From 2baa191a64c4a0f4475bfd12540672dc99405f4f Mon Sep 17 00:00:00 2001 From: kilbith Date: Fri, 10 Mar 2017 13:26:24 +0100 Subject: GUI: Convert loading screen's progress bar to image (#5362) --- src/drawscene.cpp | 48 ++++++++++++++++++--------------- textures/base/pack/progress_bar.png | Bin 0 -> 413 bytes textures/base/pack/progress_bar_bg.png | Bin 0 -> 354 bytes 3 files changed, 27 insertions(+), 21 deletions(-) create mode 100644 textures/base/pack/progress_bar.png create mode 100644 textures/base/pack/progress_bar_bg.png (limited to 'textures') diff --git a/src/drawscene.cpp b/src/drawscene.cpp index 32a078b8e..c4ef3cc51 100644 --- a/src/drawscene.cpp +++ b/src/drawscene.cpp @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/timetaker.h" #include "fontengine.h" #include "guiscalingfilter.h" +#include "filesys.h" typedef enum { LEFT = -1, @@ -590,30 +591,35 @@ void draw_load_screen(const std::wstring &text, IrrlichtDevice* device, driver->beginScene(true, true, video::SColor(255, 0, 0, 0)); // draw progress bar - if ((percent >= 0) && (percent <= 100)) - { - v2s32 barsize( - // 342 is (approximately) 256/0.75 to keep bar on same size as - // before with default settings - 342 * porting::getDisplayDensity() * - g_settings->getFloat("gui_scaling"), - g_fontengine->getTextHeight() * 2); - - core::rect barrect(center - barsize / 2, center + barsize / 2); - driver->draw2DRectangle(video::SColor(255, 255, 255, 255),barrect, NULL); // border - driver->draw2DRectangle(video::SColor(255, 64, 64, 64), core::rect ( - barrect.UpperLeftCorner + 1, - barrect.LowerRightCorner-1), NULL); // black inside the bar - driver->draw2DRectangle(video::SColor(255, 128, 128, 128), core::rect ( - barrect.UpperLeftCorner + 1, - core::vector2d( - barrect.LowerRightCorner.X - - (barsize.X - 1) + percent * (barsize.X - 2) / 100, - barrect.LowerRightCorner.Y - 1)), NULL); // the actual progress + if ((percent >= 0) && (percent <= 100)) { + std::string gamepath = fs::RemoveRelativePathComponents( + porting::path_share + DIR_DELIM + "textures"); + video::ITexture *progress_img = driver->getTexture( + (gamepath + "/base/pack/progress_bar.png").c_str()); + video::ITexture *progress_img_bg = driver->getTexture( + (gamepath + "/base/pack/progress_bar_bg.png").c_str()); + + const core::dimension2d &img_size = progress_img_bg->getSize(); + u32 imgW = MYMAX(208, img_size.Width); + u32 imgH = MYMAX(24, img_size.Height); + v2s32 img_pos((screensize.X - imgW) / 2, (screensize.Y - imgH) / 2); + + draw2DImageFilterScaled( + driver, progress_img_bg, + core::rect(img_pos.X, img_pos.Y, img_pos.X + imgW, img_pos.Y + imgH), + core::rect(0, 0, img_size.Width, img_size.Height), + 0, 0, true); + + draw2DImageFilterScaled( + driver, progress_img, + core::rect(img_pos.X, img_pos.Y, + img_pos.X + (percent * imgW) / 100, img_pos.Y + imgH), + core::rect(0, 0, ((percent * img_size.Width) / 100), img_size.Height), + 0, 0, true); } + guienv->drawAll(); driver->endScene(); - guitext->remove(); //return guitext; diff --git a/textures/base/pack/progress_bar.png b/textures/base/pack/progress_bar.png new file mode 100644 index 000000000..e80367191 Binary files /dev/null and b/textures/base/pack/progress_bar.png differ diff --git a/textures/base/pack/progress_bar_bg.png b/textures/base/pack/progress_bar_bg.png new file mode 100644 index 000000000..4e30ae889 Binary files /dev/null and b/textures/base/pack/progress_bar_bg.png differ -- cgit v1.2.3