aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/textures.lua
diff options
context:
space:
mode:
authorTim <t4im@openmailbox.org>2015-09-03 22:38:34 +0200
committerest31 <MTest31@outlook.com>2015-09-12 23:16:41 +0200
commitca32374ff7b558d705644b88520d4d29c15df961 (patch)
tree79fbecf0afebf7e9ac9a788b185909969495e48d /builtin/mainmenu/textures.lua
parent0d1b41f3800d17915c4cbac86f6fbdc282b27aa4 (diff)
downloadminetest-ca32374ff7b558d705644b88520d4d29c15df961.tar.gz
minetest-ca32374ff7b558d705644b88520d4d29c15df961.tar.bz2
minetest-ca32374ff7b558d705644b88520d4d29c15df961.zip
Translated using Weblate (Esperanto)
Currently translated at 44.8% (121 of 270 strings)
Diffstat (limited to 'builtin/mainmenu/textures.lua')
0 files changed, 0 insertions, 0 deletions
id='n125' href='#n125'>125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
/*
Minetest
Copyright (C) 2010-2013 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
Copyright (C) 2017 red-001 <red-001@outlook.ie>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef CLIENT_HUD_HEADER
#define CLIENT_HUD_HEADER

#include <vector>
#include <IGUIFont.h>
#include "irr_aabb3d.h"
#include "../hud.h"

class Client;
class ITextureSource;
class Inventory;
class InventoryList;
class LocalPlayer;
struct ItemStack;

class Hud
{
public:
	video::IVideoDriver *driver;
	scene::ISceneManager *smgr;
	gui::IGUIEnvironment *guienv;
	Client *client;
	LocalPlayer *player;
	Inventory *inventory;
	ITextureSource *tsrc;

	video::SColor crosshair_argb;
	video::SColor selectionbox_argb;
	bool use_crosshair_image = false;
	std::string hotbar_image = "";
	bool use_hotbar_image = false;
	std::string hotbar_selected_image = "";
	bool use_hotbar_selected_image = false;

	Hud(gui::IGUIEnvironment *guienv, Client *client, LocalPlayer *player,
			Inventory *inventory);
	~Hud();

	void drawHotbar(u16 playeritem);
	void resizeHotbar();
	void drawCrosshair();
	void drawSelectionMesh();
	void updateSelectionMesh(const v3s16 &camera_offset);

	std::vector<aabb3f> *getSelectionBoxes() { return &m_selection_boxes; }

	void setSelectionPos(const v3f &pos, const v3s16 &camera_offset);

	v3f getSelectionPos() const { return m_selection_pos; }

	void setSelectionMeshColor(const video::SColor &color)
	{
		m_selection_mesh_color = color;
	}

	void setSelectedFaceNormal(const v3f &face_normal)
	{
		m_selected_face_normal = face_normal;
	}

	void drawLuaElements(const v3s16 &camera_offset);

private:
	bool calculateScreenPos(const v3s16 &camera_offset, HudElement *e, v2s32 *pos);
	void drawStatbar(v2s32 pos, u16 corner, u16 drawdir,