forked from oerkki/voxelands
ui prettying up
This commit is contained in:
parent
a5d71176e6
commit
501c631395
|
@ -435,23 +435,21 @@ void GUICharDefMenu::drawMenu()
|
|||
video::IVideoDriver* driver = Environment->getVideoDriver();
|
||||
|
||||
core::rect<s32> left(
|
||||
AbsoluteRect.UpperLeftCorner.X,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.UpperLeftCorner.X+250,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
0,
|
||||
0,
|
||||
250,
|
||||
m_screensize.Y
|
||||
);
|
||||
core::rect<s32> right(
|
||||
AbsoluteRect.LowerRightCorner.X-230,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.LowerRightCorner.X,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
m_screensize.X-230,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
|
||||
driver->draw2DRectangle(left, GUI_BG_TOP, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangleOutline(left, GUI_BORDER);
|
||||
|
||||
driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangleOutline(right, GUI_BORDER);
|
||||
|
||||
if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) {
|
||||
video::ITexture *texture = driver->getTexture(buff);
|
||||
|
|
|
@ -60,7 +60,8 @@ GUIFormSpecMenu::GUIFormSpecMenu(gui::IGUIEnvironment* env,
|
|||
m_selected_item(NULL),
|
||||
m_selected_amount(0),
|
||||
m_selected_dragging(false),
|
||||
m_tooltip_element(NULL)
|
||||
m_tooltip_element(NULL),
|
||||
m_screensize(1024,600)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -104,6 +105,8 @@ void GUIFormSpecMenu::regenerateGui(v2u32 screensize)
|
|||
// Remove children
|
||||
removeChildren();
|
||||
|
||||
m_screensize = screensize;
|
||||
|
||||
v2s32 size(100,100);
|
||||
s32 helptext_h = 15;
|
||||
core::rect<s32> rect;
|
||||
|
@ -598,8 +601,13 @@ void GUIFormSpecMenu::drawMenu()
|
|||
return;
|
||||
video::IVideoDriver* driver = Environment->getVideoDriver();
|
||||
|
||||
driver->draw2DRectangle(AbsoluteRect,GUI_BG_TOP, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangleOutline(AbsoluteRect, GUI_BORDER);
|
||||
core::rect<s32> rect(
|
||||
0,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
driver->draw2DRectangle(rect, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, NULL);
|
||||
|
||||
m_tooltip_element->setVisible(false);
|
||||
|
||||
|
|
|
@ -225,6 +225,7 @@ protected:
|
|||
|
||||
v2s32 m_pointer;
|
||||
gui::IGUIStaticText *m_tooltip_element;
|
||||
v2u32 m_screensize;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -245,20 +245,13 @@ void GUIMainMenu::drawMenu()
|
|||
|
||||
{
|
||||
char buff[1024];
|
||||
core::rect<s32> left(
|
||||
AbsoluteRect.UpperLeftCorner.X,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.LowerRightCorner.X-550,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
core::rect<s32> rect(
|
||||
0,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
core::rect<s32> right(
|
||||
AbsoluteRect.UpperLeftCorner.X+250,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.LowerRightCorner.X,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
);
|
||||
driver->draw2DRectangle(left, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangle(rect, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, NULL);
|
||||
if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) {
|
||||
video::ITexture *texture = driver->getTexture(buff);
|
||||
if (texture != 0) {
|
||||
|
|
|
@ -43,7 +43,8 @@ GUIMessageMenu::GUIMessageMenu(gui::IGUIEnvironment* env,
|
|||
):
|
||||
GUIModalMenu(env, parent, id, menumgr),
|
||||
m_message_text(message_text),
|
||||
m_status(false)
|
||||
m_status(false),
|
||||
m_screensize(1024,600)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -71,6 +72,7 @@ void GUIMessageMenu::regenerateGui(v2u32 screensize)
|
|||
/*
|
||||
Remove stuff
|
||||
*/
|
||||
m_screensize = screensize;
|
||||
removeChildren();
|
||||
|
||||
/*
|
||||
|
@ -120,9 +122,13 @@ void GUIMessageMenu::drawMenu()
|
|||
if (!skin)
|
||||
return;
|
||||
video::IVideoDriver* driver = Environment->getVideoDriver();
|
||||
|
||||
driver->draw2DRectangle(AbsoluteRect, GUI_BG_TOP, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangleOutline(AbsoluteRect, GUI_BORDER);
|
||||
core::rect<s32> rect(
|
||||
0,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
driver->draw2DRectangle(rect, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, NULL);
|
||||
|
||||
gui::IGUIElement::draw();
|
||||
}
|
||||
|
|
|
@ -61,6 +61,7 @@ public:
|
|||
private:
|
||||
std::wstring m_message_text;
|
||||
bool m_status;
|
||||
v2u32 m_screensize;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -330,20 +330,13 @@ void GUIMultiplayerMenu::drawMenu()
|
|||
|
||||
{
|
||||
char buff[1024];
|
||||
core::rect<s32> left(
|
||||
AbsoluteRect.UpperLeftCorner.X,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.LowerRightCorner.X-550,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
core::rect<s32> rect(
|
||||
0,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
core::rect<s32> right(
|
||||
AbsoluteRect.UpperLeftCorner.X+250,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.LowerRightCorner.X,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
);
|
||||
driver->draw2DRectangle(left, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangle(rect, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, NULL);
|
||||
|
||||
if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) {
|
||||
video::ITexture *texture = driver->getTexture(buff);
|
||||
|
|
|
@ -51,7 +51,8 @@ GUIPasswordChange::GUIPasswordChange(gui::IGUIEnvironment* env,
|
|||
Client* client
|
||||
):
|
||||
GUIModalMenu(env, parent, id, menumgr),
|
||||
m_client(client)
|
||||
m_client(client),
|
||||
m_screensize(1024,600)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -78,6 +79,7 @@ void GUIPasswordChange::regenerateGui(v2u32 screensize)
|
|||
Remove stuff
|
||||
*/
|
||||
removeChildren();
|
||||
m_screensize = screensize;
|
||||
|
||||
/*
|
||||
Calculate new sizes and positions
|
||||
|
@ -175,9 +177,13 @@ void GUIPasswordChange::drawMenu()
|
|||
if (!skin)
|
||||
return;
|
||||
video::IVideoDriver* driver = Environment->getVideoDriver();
|
||||
|
||||
driver->draw2DRectangle(AbsoluteRect, GUI_BG_TOP, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangleOutline(AbsoluteRect, GUI_BORDER);
|
||||
core::rect<s32> rect(
|
||||
0,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
driver->draw2DRectangle(rect, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, NULL);
|
||||
|
||||
gui::IGUIElement::draw();
|
||||
}
|
||||
|
|
|
@ -56,6 +56,7 @@ public:
|
|||
|
||||
private:
|
||||
Client* m_client;
|
||||
v2u32 m_screensize;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env,
|
|||
m_gamecallback = gamecallback;
|
||||
this->env = env;
|
||||
this->parent = parent;
|
||||
this->m_screensize = v2u32(1024,600);
|
||||
this->id = id;
|
||||
this->menumgr = menumgr;
|
||||
}
|
||||
|
@ -76,6 +77,8 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
|
|||
*/
|
||||
removeChildren();
|
||||
|
||||
m_screensize = screensize;
|
||||
|
||||
/*
|
||||
Calculate new sizes and positions
|
||||
*/
|
||||
|
@ -168,9 +171,13 @@ void GUIPauseMenu::drawMenu()
|
|||
if (!skin)
|
||||
return;
|
||||
video::IVideoDriver* driver = Environment->getVideoDriver();
|
||||
|
||||
driver->draw2DRectangle(AbsoluteRect, GUI_BG_TOP, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangleOutline(AbsoluteRect, GUI_BORDER);
|
||||
core::rect<s32> rect(
|
||||
0,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
driver->draw2DRectangle(rect, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, NULL);
|
||||
|
||||
gui::IGUIElement::draw();
|
||||
}
|
||||
|
|
|
@ -62,6 +62,7 @@ private:
|
|||
|
||||
gui::IGUIEnvironment* env;
|
||||
gui::IGUIElement* parent;
|
||||
v2u32 m_screensize;
|
||||
s32 id;
|
||||
IMenuManager *menumgr;
|
||||
};
|
||||
|
|
|
@ -366,7 +366,7 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize)
|
|||
if (m_data.selected_tab == TAB_SETTINGS_CONTROLS) {
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 550, 20);
|
||||
rect += topleft_content + v2s32(0, 20);
|
||||
rect += topleft_content + v2s32(0, 0);
|
||||
gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Controls")).c_str(), rect, false, true, this, -1);
|
||||
t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
|
||||
}
|
||||
|
@ -397,7 +397,7 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize)
|
|||
}else if (m_data.selected_tab == TAB_SETTINGS_GRAPHICS) {
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 550, 20);
|
||||
rect += topleft_content + v2s32(0, 20);
|
||||
rect += topleft_content + v2s32(0, 0);
|
||||
gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Graphics")).c_str(), rect, false, true, this, -1);
|
||||
t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize)
|
|||
}else if (m_data.selected_tab == TAB_SETTINGS_VIDEO) {
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 550, 20);
|
||||
rect += topleft_content + v2s32(0, 20);
|
||||
rect += topleft_content + v2s32(0, 0);
|
||||
gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Video")).c_str(), rect, false, true, this, -1);
|
||||
t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ void GUISettingsMenu::regenerateGui(v2u32 screensize)
|
|||
}else if (m_data.selected_tab == TAB_SETTINGS_SOUND) {
|
||||
{
|
||||
core::rect<s32> rect(0, 0, 550, 20);
|
||||
rect += topleft_content + v2s32(0, 20);
|
||||
rect += topleft_content + v2s32(0, 0);
|
||||
gui::IGUIStaticText *t = Environment->addStaticText(narrow_to_wide(gettext("Sound")).c_str(), rect, false, true, this, -1);
|
||||
t->setTextAlignment(gui::EGUIA_CENTER, gui::EGUIA_UPPERLEFT);
|
||||
}
|
||||
|
@ -596,20 +596,13 @@ void GUISettingsMenu::drawMenu()
|
|||
|
||||
{
|
||||
char buff[1024];
|
||||
core::rect<s32> left(
|
||||
AbsoluteRect.UpperLeftCorner.X,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.LowerRightCorner.X-550,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
core::rect<s32> rect(
|
||||
0,
|
||||
0,
|
||||
m_screensize.X,
|
||||
m_screensize.Y
|
||||
);
|
||||
core::rect<s32> right(
|
||||
AbsoluteRect.UpperLeftCorner.X+250,
|
||||
AbsoluteRect.UpperLeftCorner.Y,
|
||||
AbsoluteRect.LowerRightCorner.X,
|
||||
AbsoluteRect.LowerRightCorner.Y
|
||||
);
|
||||
driver->draw2DRectangle(left, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangle(right, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, &AbsoluteClippingRect);
|
||||
driver->draw2DRectangle(rect, GUI_BG_TOP, GUI_BG_BTM, GUI_BG_TOP, GUI_BG_BTM, NULL);
|
||||
|
||||
if (path_get((char*)"texture",(char*)"menulogo.png",1,buff,1024)) {
|
||||
video::ITexture *texture = driver->getTexture(buff);
|
||||
|
|
|
@ -3,35 +3,35 @@
|
|||
|
||||
#include "common_irrlicht.h"
|
||||
|
||||
#define GUI_BG_TOP video::SColor(240,50,50,70)
|
||||
#define GUI_BG_BTM video::SColor(240,30,30,50)
|
||||
#define GUI_BORDER video::SColor(245,60,60,80)
|
||||
#define GUI_BG_TOP video::SColor(128,0,0,0)
|
||||
#define GUI_BG_BTM video::SColor(128,0,0,0)
|
||||
#define GUI_BORDER video::SColor(0,0,0,0)
|
||||
|
||||
#define GUI_BG_DEATH video::SColor(180,50,0,0)
|
||||
|
||||
#define GUI_BG_TT video::SColor(200,30,30,50)
|
||||
#define GUI_BG_TT video::SColor(200,70,130,30)
|
||||
#define GUI_TT_TEXT video::SColor(255,255,255,255)
|
||||
|
||||
#define GUI_INV_BORDER video::SColor(245,60,60,80)
|
||||
#define GUI_INV_HIGHLIGHT video::SColor(240,255,0,0)
|
||||
#define GUI_INV_BG video::SColor(240,30,30,50)
|
||||
#define GUI_INV_BORDER video::SColor(128,60,60,60)
|
||||
#define GUI_INV_HIGHLIGHT video::SColor(240,170,30,30)
|
||||
#define GUI_INV_BG video::SColor(128,60,60,60)
|
||||
|
||||
#define GUI_3D_HIGH_LIGHT video::SColor(255,0,0,0)
|
||||
#define GUI_3D_HIGH_LIGHT video::SColor(128,70,130,30)
|
||||
#define GUI_HIGH_LIGHT video::SColor(255,70,100,50)
|
||||
#define GUI_HIGH_LIGHT_TEXT video::SColor(255,255,255,255)
|
||||
#define GUI_BUTTON_TEXT video::SColor(255,255,255,255)
|
||||
|
||||
#if (IRRLICHT_VERSION_MAJOR >= 1 && IRRLICHT_VERSION_MINOR >= 8) || IRRLICHT_VERSION_MAJOR >= 2
|
||||
// Irrlicht 1.8 input colours
|
||||
#define GUI_3D_FACE video::SColor(255,60,60,80)
|
||||
#define GUI_3D_SHADOW video::SColor(255,60,60,80)
|
||||
#define GUI_3D_DARK_SHADOW video::SColor(255,30,30,50)
|
||||
#define GUI_EDITABLE video::SColor(255,60,60,80)
|
||||
#define GUI_FOCUSED_EDITABLE video::SColor(255,60,60,80)
|
||||
#define GUI_3D_FACE video::SColor(255,70,130,30)
|
||||
#define GUI_3D_SHADOW video::SColor(255,70,130,30)
|
||||
#define GUI_3D_DARK_SHADOW video::SColor(255,70,130,30)
|
||||
#define GUI_EDITABLE video::SColor(128,70,130,30)
|
||||
#define GUI_FOCUSED_EDITABLE video::SColor(192,70,130,30)
|
||||
|
||||
#else
|
||||
|
||||
#define GUI_3D_SHADOW video::SColor(255,0,0,0)
|
||||
#define GUI_3D_SHADOW video::SColor(255,70,130,30)
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3241,10 +3241,6 @@ void ClientMap::renderPostFx()
|
|||
post_effect_color = video::SColor(255, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
if (m_client->getFormState()) {
|
||||
if (post_effect_color.getAlpha() < 128)
|
||||
post_effect_color = video::SColor(128,0,0,0);
|
||||
}
|
||||
if (post_effect_color.getAlpha() != 0) {
|
||||
// Draw a full-screen rectangle
|
||||
video::IVideoDriver* driver = SceneManager->getVideoDriver();
|
||||
|
|
Loading…
Reference in New Issue