some improvements to the render options interface and checkboxes (icons and tooltips coming next)
This commit is contained in:
parent
5ee1c7ff80
commit
187a5189d5
1
.gitignore
vendored
1
.gitignore
vendored
@ -38,6 +38,7 @@ Makefile.me
|
|||||||
*.ipch
|
*.ipch
|
||||||
*.log
|
*.log
|
||||||
*.lastbuildstate
|
*.lastbuildstate
|
||||||
|
*.unsuccessfulbuild
|
||||||
*.pdb
|
*.pdb
|
||||||
*.sublime-*
|
*.sublime-*
|
||||||
*.project
|
*.project
|
||||||
|
@ -33,7 +33,7 @@ LuaCheckbox::LuaCheckbox(lua_State * l) :
|
|||||||
int sizeY = luaL_optinteger(l, 4, 10);
|
int sizeY = luaL_optinteger(l, 4, 10);
|
||||||
std::string text = luaL_optstring(l, 5, "");
|
std::string text = luaL_optstring(l, 5, "");
|
||||||
|
|
||||||
checkbox = new ui::Checkbox(ui::Point(posX, posY), ui::Point(sizeX, sizeY), text);
|
checkbox = new ui::Checkbox(ui::Point(posX, posY), ui::Point(sizeX, sizeY), text, "");
|
||||||
component = checkbox;
|
component = checkbox;
|
||||||
class ClickAction : public ui::CheckboxAction
|
class ClickAction : public ui::CheckboxAction
|
||||||
{
|
{
|
||||||
|
@ -1491,7 +1491,7 @@ void GameView::OnTick(float dt)
|
|||||||
{
|
{
|
||||||
toolTipPresence -= int(dt)>0?int(dt):1;
|
toolTipPresence -= int(dt)>0?int(dt):1;
|
||||||
if(toolTipPresence<0)
|
if(toolTipPresence<0)
|
||||||
toolTipPresence = 0;
|
toolTipPresence = 0;
|
||||||
}
|
}
|
||||||
c->Update();
|
c->Update();
|
||||||
if(lastLogEntry > -0.1f)
|
if(lastLogEntry > -0.1f)
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
|
|
||||||
using namespace ui;
|
using namespace ui;
|
||||||
|
|
||||||
Checkbox::Checkbox(ui::Point position, ui::Point size, std::string text):
|
Checkbox::Checkbox(ui::Point position, ui::Point size, std::string text, std::string toolTip):
|
||||||
Component(position, size),
|
Component(position, size),
|
||||||
text(text),
|
text(text),
|
||||||
|
toolTip(toolTip),
|
||||||
isMouseOver(false),
|
isMouseOver(false),
|
||||||
checked(false),
|
checked(false),
|
||||||
actionCallback(NULL)
|
actionCallback(NULL)
|
||||||
@ -30,6 +31,13 @@ std::string Checkbox::GetText()
|
|||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Checkbox::SetIcon(Icon icon)
|
||||||
|
{
|
||||||
|
Appearance.icon = icon;
|
||||||
|
iconPosition.X = 19;
|
||||||
|
iconPosition.Y = 3;
|
||||||
|
}
|
||||||
|
|
||||||
void Checkbox::OnMouseClick(int x, int y, unsigned int button)
|
void Checkbox::OnMouseClick(int x, int y, unsigned int button)
|
||||||
{
|
{
|
||||||
if(checked)
|
if(checked)
|
||||||
@ -53,6 +61,10 @@ void Checkbox::OnMouseUp(int x, int y, unsigned int button)
|
|||||||
void Checkbox::OnMouseEnter(int x, int y)
|
void Checkbox::OnMouseEnter(int x, int y)
|
||||||
{
|
{
|
||||||
isMouseOver = true;
|
isMouseOver = true;
|
||||||
|
if(toolTip.length()>0 && GetParentWindow())
|
||||||
|
{
|
||||||
|
GetParentWindow()->ToolTip(this, ui::Point(x, y), toolTip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Checkbox::OnMouseLeave(int x, int y)
|
void Checkbox::OnMouseLeave(int x, int y)
|
||||||
@ -71,12 +83,18 @@ void Checkbox::Draw(const Point& screenPos)
|
|||||||
{
|
{
|
||||||
g->drawrect(screenPos.X+2, screenPos.Y+2, 12, 12, 255, 255, 255, 255);
|
g->drawrect(screenPos.X+2, screenPos.Y+2, 12, 12, 255, 255, 255, 255);
|
||||||
g->fillrect(screenPos.X+5, screenPos.Y+5, 6, 6, 255, 255, 255, 170);
|
g->fillrect(screenPos.X+5, screenPos.Y+5, 6, 6, 255, 255, 255, 170);
|
||||||
g->drawtext(screenPos.X+18, screenPos.Y+4, text, 255, 255, 255, 255);
|
if (!Appearance.icon)
|
||||||
|
g->drawtext(screenPos.X+18, screenPos.Y+4, text, 255, 255, 255, 255);
|
||||||
|
else
|
||||||
|
g->draw_icon(screenPos.X+15, screenPos.Y+iconPosition.Y, Appearance.icon);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g->drawrect(screenPos.X+2, screenPos.Y+2, 12, 12, 255, 255, 255, 200);
|
g->drawrect(screenPos.X+2, screenPos.Y+2, 12, 12, 255, 255, 255, 200);
|
||||||
g->drawtext(screenPos.X+18, screenPos.Y+4, text, 255, 255, 255, 200);
|
if (!Appearance.icon)
|
||||||
|
g->drawtext(screenPos.X+18, screenPos.Y+4, text, 255, 255, 255, 200);
|
||||||
|
else
|
||||||
|
g->draw_icon(screenPos.X+15, screenPos.Y+iconPosition.Y, Appearance.icon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,13 +21,15 @@ public:
|
|||||||
};
|
};
|
||||||
class Checkbox: public ui::Component {
|
class Checkbox: public ui::Component {
|
||||||
std::string text;
|
std::string text;
|
||||||
|
std::string toolTip;
|
||||||
bool checked;
|
bool checked;
|
||||||
bool isMouseOver;
|
bool isMouseOver;
|
||||||
CheckboxAction * actionCallback;
|
CheckboxAction * actionCallback;
|
||||||
public:
|
public:
|
||||||
Checkbox(ui::Point position, ui::Point size, std::string text);
|
Checkbox(ui::Point position, ui::Point size, std::string text, std::string toolTip);
|
||||||
void SetText(std::string text);
|
void SetText(std::string text);
|
||||||
std::string GetText();
|
std::string GetText();
|
||||||
|
void SetIcon(Icon icon);
|
||||||
void Draw(const Point& screenPos);
|
void Draw(const Point& screenPos);
|
||||||
virtual void OnMouseEnter(int x, int y);
|
virtual void OnMouseEnter(int x, int y);
|
||||||
virtual void OnMouseLeave(int x, int y);
|
virtual void OnMouseLeave(int x, int y);
|
||||||
|
@ -27,7 +27,7 @@ OptionsView::OptionsView():
|
|||||||
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetHeatSimulation(sender->GetChecked()); }
|
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetHeatSimulation(sender->GetChecked()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
heatSimulation = new ui::Checkbox(ui::Point(8, 23), ui::Point(Size.X-6, 16), "Heat simulation \bgIntroduced in version 34");
|
heatSimulation = new ui::Checkbox(ui::Point(8, 23), ui::Point(Size.X-6, 16), "Heat simulation \bgIntroduced in version 34", "");
|
||||||
heatSimulation->SetActionCallback(new HeatSimulationAction(this));
|
heatSimulation->SetActionCallback(new HeatSimulationAction(this));
|
||||||
AddComponent(heatSimulation);
|
AddComponent(heatSimulation);
|
||||||
tempLabel = new ui::Label(ui::Point(24, heatSimulation->Position.Y+14), ui::Point(Size.X-28, 16), "\bgCan cause odd behaviour with very old saves");
|
tempLabel = new ui::Label(ui::Point(24, heatSimulation->Position.Y+14), ui::Point(Size.X-28, 16), "\bgCan cause odd behaviour with very old saves");
|
||||||
@ -42,7 +42,7 @@ OptionsView::OptionsView():
|
|||||||
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetAmbientHeatSimulation(sender->GetChecked()); }
|
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetAmbientHeatSimulation(sender->GetChecked()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
ambientHeatSimulation = new ui::Checkbox(ui::Point(8, 53), ui::Point(Size.X-6, 16), "Ambient heat simulation \bgIntroduced in version 50");
|
ambientHeatSimulation = new ui::Checkbox(ui::Point(8, 53), ui::Point(Size.X-6, 16), "Ambient heat simulation \bgIntroduced in version 50", "");
|
||||||
ambientHeatSimulation->SetActionCallback(new AmbientHeatSimulationAction(this));
|
ambientHeatSimulation->SetActionCallback(new AmbientHeatSimulationAction(this));
|
||||||
AddComponent(ambientHeatSimulation);
|
AddComponent(ambientHeatSimulation);
|
||||||
tempLabel = new ui::Label(ui::Point(24, ambientHeatSimulation->Position.Y+14), ui::Point(Size.X-28, 16), "\bgCan cause odd behaviour with old saves");
|
tempLabel = new ui::Label(ui::Point(24, ambientHeatSimulation->Position.Y+14), ui::Point(Size.X-28, 16), "\bgCan cause odd behaviour with old saves");
|
||||||
@ -57,7 +57,7 @@ OptionsView::OptionsView():
|
|||||||
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetNewtonianGravity(sender->GetChecked()); }
|
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetNewtonianGravity(sender->GetChecked()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
newtonianGravity = new ui::Checkbox(ui::Point(8, 83), ui::Point(Size.X-6, 16), "Newtonian gravity \bgIntroduced in version 48");
|
newtonianGravity = new ui::Checkbox(ui::Point(8, 83), ui::Point(Size.X-6, 16), "Newtonian gravity \bgIntroduced in version 48", "");
|
||||||
newtonianGravity->SetActionCallback(new NewtonianGravityAction(this));
|
newtonianGravity->SetActionCallback(new NewtonianGravityAction(this));
|
||||||
AddComponent(newtonianGravity);
|
AddComponent(newtonianGravity);
|
||||||
tempLabel = new ui::Label(ui::Point(24, newtonianGravity->Position.Y+14), ui::Point(Size.X-28, 16), "\bgMay cause poor performance on older computers");
|
tempLabel = new ui::Label(ui::Point(24, newtonianGravity->Position.Y+14), ui::Point(Size.X-28, 16), "\bgMay cause poor performance on older computers");
|
||||||
@ -72,7 +72,7 @@ OptionsView::OptionsView():
|
|||||||
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetWaterEqualisation(sender->GetChecked()); }
|
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetWaterEqualisation(sender->GetChecked()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
waterEqualisation = new ui::Checkbox(ui::Point(8, 113), ui::Point(Size.X-6, 16), "Water equalisation \bgIntroduced in version 61");
|
waterEqualisation = new ui::Checkbox(ui::Point(8, 113), ui::Point(Size.X-6, 16), "Water equalisation \bgIntroduced in version 61", "");
|
||||||
waterEqualisation->SetActionCallback(new WaterEqualisationAction(this));
|
waterEqualisation->SetActionCallback(new WaterEqualisationAction(this));
|
||||||
AddComponent(waterEqualisation);
|
AddComponent(waterEqualisation);
|
||||||
tempLabel = new ui::Label(ui::Point(24, waterEqualisation->Position.Y+14), ui::Point(Size.X-28, 16), "\bgMay cause poor performance with a lot of water");
|
tempLabel = new ui::Label(ui::Point(24, waterEqualisation->Position.Y+14), ui::Point(Size.X-28, 16), "\bgMay cause poor performance with a lot of water");
|
||||||
@ -144,7 +144,7 @@ OptionsView::OptionsView():
|
|||||||
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetScale(sender->GetChecked()); }
|
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetScale(sender->GetChecked()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
scale = new ui::Checkbox(ui::Point(8, 210), ui::Point(Size.X-6, 16), "Large screen");
|
scale = new ui::Checkbox(ui::Point(8, 210), ui::Point(Size.X-6, 16), "Large screen", "");
|
||||||
scale->SetActionCallback(new ScaleAction(this));
|
scale->SetActionCallback(new ScaleAction(this));
|
||||||
AddComponent(scale);
|
AddComponent(scale);
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ OptionsView::OptionsView():
|
|||||||
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetFullscreen(sender->GetChecked()); }
|
virtual void ActionCallback(ui::Checkbox * sender){ v->c->SetFullscreen(sender->GetChecked()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
fullscreen = new ui::Checkbox(ui::Point(8, 230), ui::Point(Size.X-6, 16), "Fullscreen");
|
fullscreen = new ui::Checkbox(ui::Point(8, 230), ui::Point(Size.X-6, 16), "Fullscreen", "");
|
||||||
fullscreen->SetActionCallback(new FullscreenAction(this));
|
fullscreen->SetActionCallback(new FullscreenAction(this));
|
||||||
AddComponent(fullscreen);
|
AddComponent(fullscreen);
|
||||||
|
|
||||||
|
@ -69,96 +69,98 @@ public:
|
|||||||
|
|
||||||
RenderView::RenderView():
|
RenderView::RenderView():
|
||||||
ui::Window(ui::Point(0, 0), ui::Point(XRES, YRES+MENUSIZE)),
|
ui::Window(ui::Point(0, 0), ui::Point(XRES, YRES+MENUSIZE)),
|
||||||
|
toolTip(""),
|
||||||
|
toolTipPresence(0),
|
||||||
ren(NULL)
|
ren(NULL)
|
||||||
{
|
{
|
||||||
ui::Checkbox * tCheckbox;
|
ui::Checkbox * tCheckbox;
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(1, YRES+4), ui::Point(55, 16), "Effects");
|
tCheckbox = new ui::Checkbox(ui::Point(1, YRES+4), ui::Point(55, 16), "Effects", "");
|
||||||
renderModes.push_back(tCheckbox);
|
renderModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_EFFE));
|
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_EFFE));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(1, YRES+4+18), ui::Point(55, 16), "Fire");
|
tCheckbox = new ui::Checkbox(ui::Point(1, YRES+4+18), ui::Point(55, 16), "Fire", "");
|
||||||
renderModes.push_back(tCheckbox);
|
renderModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_FIRE));
|
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_FIRE));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(61, YRES+4), ui::Point(55, 16), "Glow");
|
tCheckbox = new ui::Checkbox(ui::Point(61, YRES+4), ui::Point(55, 16), "Glow", "");
|
||||||
renderModes.push_back(tCheckbox);
|
renderModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_GLOW));
|
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_GLOW));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(61, YRES+4+18), ui::Point(55, 16), "Blur");
|
tCheckbox = new ui::Checkbox(ui::Point(61, YRES+4+18), ui::Point(55, 16), "Blur", "");
|
||||||
renderModes.push_back(tCheckbox);
|
renderModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_BLUR));
|
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_BLUR));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(121, YRES+4), ui::Point(55, 16), "Blob");
|
tCheckbox = new ui::Checkbox(ui::Point(121, YRES+4), ui::Point(55, 16), "Blob", "");
|
||||||
renderModes.push_back(tCheckbox);
|
renderModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_BLOB));
|
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_BLOB));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(121, YRES+4+18), ui::Point(55, 16), "Point");
|
tCheckbox = new ui::Checkbox(ui::Point(121, YRES+4+18), ui::Point(55, 16), "Point", "");
|
||||||
renderModes.push_back(tCheckbox);
|
renderModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_BASC));
|
tCheckbox->SetActionCallback(new RenderModeAction(this, RENDER_BASC));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(186, YRES+4), ui::Point(70, 16), "Alt. Air");
|
tCheckbox = new ui::Checkbox(ui::Point(186, YRES+4), ui::Point(70, 16), "Alt. Air", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRC));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRC));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(186, YRES+4+18), ui::Point(70, 16), "Pressure");
|
tCheckbox = new ui::Checkbox(ui::Point(186, YRES+4+18), ui::Point(70, 16), "Pressure", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRP));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRP));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(261, YRES+4), ui::Point(70, 16), "Velocity");
|
tCheckbox = new ui::Checkbox(ui::Point(261, YRES+4), ui::Point(70, 16), "Velocity", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRV));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRV));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(261, YRES+4+18), ui::Point(70, 16), "Air-heat");
|
tCheckbox = new ui::Checkbox(ui::Point(261, YRES+4+18), ui::Point(70, 16), "Air-heat", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRH));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIRH));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
/*tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4), ui::Point(70, 16), "Air");
|
/*tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4), ui::Point(70, 16), "Air", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIR));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_AIR));
|
||||||
AddComponent(tCheckbox);*/
|
AddComponent(tCheckbox);*/
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4+18), ui::Point(70, 16), "Warp");
|
tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4+18), ui::Point(70, 16), "Warp", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_WARP));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_WARP));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(411, YRES+4), ui::Point(70, 16), "Persistent");
|
tCheckbox = new ui::Checkbox(ui::Point(411, YRES+4), ui::Point(70, 16), "Persistent", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_PERS));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_PERS));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4), ui::Point(70, 16), "Effect");
|
tCheckbox = new ui::Checkbox(ui::Point(336, YRES+4), ui::Point(70, 16), "Effect", "");
|
||||||
displayModes.push_back(tCheckbox);
|
displayModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_EFFE));
|
tCheckbox->SetActionCallback(new DisplayModeAction(this, DISPLAY_EFFE));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(486, YRES+4), ui::Point(50, 16), "Heat");
|
tCheckbox = new ui::Checkbox(ui::Point(486, YRES+4), ui::Point(50, 16), "Heat", "");
|
||||||
colourModes.push_back(tCheckbox);
|
colourModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_HEAT));
|
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_HEAT));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(486, YRES+4+18), ui::Point(50, 16), "Life");
|
tCheckbox = new ui::Checkbox(ui::Point(486, YRES+4+18), ui::Point(50, 16), "Life", "");
|
||||||
colourModes.push_back(tCheckbox);
|
colourModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_LIFE));
|
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_LIFE));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(536, YRES+4+18), ui::Point(50, 16), "H-Gradient");
|
tCheckbox = new ui::Checkbox(ui::Point(536, YRES+4+18), ui::Point(50, 16), "H-Gradient", "");
|
||||||
colourModes.push_back(tCheckbox);
|
colourModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_GRAD));
|
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_GRAD));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
|
|
||||||
tCheckbox = new ui::Checkbox(ui::Point(536, YRES+4), ui::Point(50, 16), "Basic");
|
tCheckbox = new ui::Checkbox(ui::Point(536, YRES+4), ui::Point(50, 16), "Basic", "");
|
||||||
colourModes.push_back(tCheckbox);
|
colourModes.push_back(tCheckbox);
|
||||||
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_BASC));
|
tCheckbox->SetActionCallback(new ColourModeAction(this, COLOUR_BASC));
|
||||||
AddComponent(tCheckbox);
|
AddComponent(tCheckbox);
|
||||||
@ -236,18 +238,38 @@ void RenderView::NotifyColourChanged(RenderModel * sender)
|
|||||||
void RenderView::OnDraw()
|
void RenderView::OnDraw()
|
||||||
{
|
{
|
||||||
Graphics * g = ui::Engine::Ref().g;
|
Graphics * g = ui::Engine::Ref().g;
|
||||||
g->clearrect(0, 0, XRES, YRES+MENUSIZE);
|
g->clearrect(-1, -1, XRES+BARSIZE+1, YRES+MENUSIZE+1);
|
||||||
if(ren)
|
if(ren)
|
||||||
{
|
{
|
||||||
ren->clearScreen(1.0f);
|
ren->clearScreen(1.0f);
|
||||||
ren->RenderBegin();
|
ren->RenderBegin();
|
||||||
ren->RenderEnd();
|
ren->RenderEnd();
|
||||||
}
|
}
|
||||||
g->draw_line(0, YRES, XRES-1, YRES, 255, 255, 255, XRES+BARSIZE);
|
g->draw_line(0, YRES, XRES-1, YRES, 200, 200, 200, 255);
|
||||||
g->draw_line(180, YRES, 180, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE);
|
g->draw_line(180, YRES, 180, YRES+MENUSIZE, 200, 200, 200, 255);
|
||||||
g->draw_line(330, YRES, 330, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE);
|
g->draw_line(330, YRES, 330, YRES+MENUSIZE, 200, 200, 200, 255);
|
||||||
g->draw_line(480, YRES, 480, YRES+MENUSIZE, 200, 200, 200, XRES+BARSIZE);
|
g->draw_line(480, YRES, 480, YRES+MENUSIZE, 200, 200, 200, 255);
|
||||||
g->draw_line(XRES-1, 0, XRES-1, YRES+MENUSIZE, 255, 255, 255, XRES+BARSIZE);
|
g->draw_line(XRES, 0, XRES, YRES+MENUSIZE, 255, 255, 255, 255);
|
||||||
|
if(toolTipPresence && toolTip.length())
|
||||||
|
{
|
||||||
|
g->drawtext(6, Size.Y-MENUSIZE-10, (char*)toolTip.c_str(), 255, 255, 255, toolTipPresence>51?255:toolTipPresence*5);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderView::OnTick(float dt)
|
||||||
|
{
|
||||||
|
if(toolTipPresence>0)
|
||||||
|
{
|
||||||
|
toolTipPresence -= int(dt)>0?int(dt):1;
|
||||||
|
if(toolTipPresence<0)
|
||||||
|
toolTipPresence = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RenderView::ToolTip(ui::Component * sender, ui::Point mousePosition, std::string toolTip)
|
||||||
|
{
|
||||||
|
this->toolTip = toolTip;
|
||||||
|
toolTipPresence = 160;
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderView::~RenderView() {
|
RenderView::~RenderView() {
|
||||||
|
@ -24,6 +24,8 @@ class RenderView: public ui::Window {
|
|||||||
std::vector<ui::Checkbox*> renderModes;
|
std::vector<ui::Checkbox*> renderModes;
|
||||||
std::vector<ui::Checkbox*> displayModes;
|
std::vector<ui::Checkbox*> displayModes;
|
||||||
std::vector<ui::Checkbox*> colourModes;
|
std::vector<ui::Checkbox*> colourModes;
|
||||||
|
std::string toolTip;
|
||||||
|
int toolTipPresence;
|
||||||
public:
|
public:
|
||||||
class RenderModeAction;
|
class RenderModeAction;
|
||||||
class DisplayModeAction;
|
class DisplayModeAction;
|
||||||
@ -36,6 +38,8 @@ public:
|
|||||||
void AttachController(RenderController * c_) { c = c_; }
|
void AttachController(RenderController * c_) { c = c_; }
|
||||||
void OnMouseDown(int x, int y, unsigned button);
|
void OnMouseDown(int x, int y, unsigned button);
|
||||||
virtual void OnDraw();
|
virtual void OnDraw();
|
||||||
|
virtual void OnTick(float dt);
|
||||||
|
virtual void ToolTip(ui::Component * sender, ui::Point mousePosition, std::string toolTip);
|
||||||
virtual ~RenderView();
|
virtual ~RenderView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ ServerSaveActivity::ServerSaveActivity(SaveInfo save, ServerSaveActivity::SaveUp
|
|||||||
descriptionField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
descriptionField->Appearance.HorizontalAlign = ui::Appearance::AlignLeft;
|
||||||
AddComponent(descriptionField);
|
AddComponent(descriptionField);
|
||||||
|
|
||||||
publishedCheckbox = new ui::Checkbox(ui::Point(8, 45), ui::Point((Size.X/2)-16, 16), "Publish");
|
publishedCheckbox = new ui::Checkbox(ui::Point(8, 45), ui::Point((Size.X/2)-16, 16), "Publish", "");
|
||||||
if(Client::Ref().GetAuthUser().Username != save.GetUserName())
|
if(Client::Ref().GetAuthUser().Username != save.GetUserName())
|
||||||
{
|
{
|
||||||
//Save is not owned by the user, disable by default
|
//Save is not owned by the user, disable by default
|
||||||
|
Loading…
Reference in New Issue
Block a user