#include <IGUIFont.h>
#include <IGUITabControl.h>
#include <IGUIComboBox.h>
+#include "client/renderingengine.h"
#include "log.h"
#include "client/tile.h" // ITextureSource
#include "hud.h" // drawItemStack
return font->getDimension(L"Ay").Height + font->getKerningHeight();
}
-GUIFormSpecMenu::GUIFormSpecMenu(irr::IrrlichtDevice* dev,
- JoystickController *joystick,
- gui::IGUIElement* parent, s32 id, IMenuManager *menumgr,
- Client *client,
- ISimpleTextureSource *tsrc, IFormSource* fsrc, TextDest* tdst,
+GUIFormSpecMenu::GUIFormSpecMenu(JoystickController *joystick,
+ gui::IGUIElement *parent, s32 id, IMenuManager *menumgr,
+ Client *client, ISimpleTextureSource *tsrc, IFormSource *fsrc, TextDest *tdst,
bool remap_dbl_click) :
- GUIModalMenu(dev->getGUIEnvironment(), parent, id, menumgr),
- m_device(dev),
+ GUIModalMenu(RenderingEngine::get_gui_env(), parent, id, menumgr),
m_invmgr(client),
m_tsrc(tsrc),
m_client(client),
if (mydata.explicit_size) {
// compute scaling for specified form size
if (m_lock) {
- v2u32 current_screensize = m_device->getVideoDriver()->getScreenSize();
+ v2u32 current_screensize = RenderingEngine::get_video_driver()->getScreenSize();
v2u32 delta = current_screensize - m_lockscreensize;
if (current_screensize.Y > m_lockscreensize.Y)
}
double gui_scaling = g_settings->getFloat("gui_scaling");
- double screen_dpi = porting::getDisplayDensity() * 96;
+ double screen_dpi = RenderingEngine::getDisplayDensity() * 96;
double use_imgsize;
if (m_lock) {
((5.0/4.0) * (0.5 + mydata.invsize.X));
double fity_imgsize = mydata.screensize.Y /
((15.0/13.0) * (0.85 * mydata.invsize.Y));
- double screen_dpi = porting::getDisplayDensity() * 96;
+ double screen_dpi = RenderingEngine::getDisplayDensity() * 96;
double min_imgsize = 0.3 * screen_dpi * gui_scaling;
use_imgsize = MYMAX(min_imgsize, MYMIN(prefer_imgsize,
MYMIN(fitx_imgsize, fity_imgsize)));
/* TODO find way to show tooltips on touchscreen */
#ifndef HAVE_TOUCHSCREENGUI
- m_pointer = m_device->getCursorControl()->getPosition();
+ m_pointer = RenderingEngine::get_raw_device()->getCursorControl()->getPosition();
#endif
/*
// Possibly send inventory action to server
if (move_amount > 0) {
- // Send IACTION_MOVE
+ // Send IAction::Move
assert(m_selected_item && m_selected_item->isValid());
assert(s.isValid());
m_selected_content_guess = ItemStack(); // Clear
}
- infostream << "Handing IACTION_MOVE to manager" << std::endl;
+ infostream << "Handing IAction::Move to manager" << std::endl;
IMoveAction *a = new IMoveAction();
a->count = move_amount;
a->from_inv = m_selected_item->inventoryloc;
ItemStack stack_from = list_from->getItem(s.i);
assert(shift_move_amount <= stack_from.count);
if (m_client->getProtoVersion() >= 25) {
- infostream << "Handing IACTION_MOVE to manager" << std::endl;
+ infostream << "Handing IAction::Move to manager" << std::endl;
IMoveAction *a = new IMoveAction();
a->count = shift_move_amount;
a->from_inv = s.inventoryloc;
&& shift_move_amount > 0; slot_to++) {
list_to->itemFits(slot_to, stack_from, &leftover);
if (leftover.count < stack_from.count) {
- infostream << "Handing IACTION_MOVE to manager" << std::endl;
+ infostream << "Handing IAction::Move to manager" << std::endl;
IMoveAction *a = new IMoveAction();
a->count = MYMIN(shift_move_amount,
(u32) (stack_from.count - leftover.count));
} else if (drop_amount > 0) {
m_selected_content_guess = ItemStack(); // Clear
- // Send IACTION_DROP
+ // Send IAction::Drop
assert(m_selected_item && m_selected_item->isValid());
assert(inv_selected);
assert(drop_amount > 0 && drop_amount <= m_selected_amount);
m_selected_amount -= drop_amount;
- infostream << "Handing IACTION_DROP to manager" << std::endl;
+ infostream << "Handing IAction::Drop to manager" << std::endl;
IDropAction *a = new IDropAction();
a->count = drop_amount;
a->from_inv = m_selected_item->inventoryloc;
} else if (craft_amount > 0) {
m_selected_content_guess = ItemStack(); // Clear
- // Send IACTION_CRAFT
+ // Send IAction::Craft
assert(s.isValid());
assert(inv_s);
- infostream << "Handing IACTION_CRAFT to manager" << std::endl;
+ infostream << "Handing IAction::Craft to manager" << std::endl;
ICraftAction *a = new ICraftAction();
a->count = craft_amount;
a->craft_inv = s.inventoryloc;