From 5b4928e07c8bcc877bfc2a8c0268ea9601cf699b Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Tue, 5 Apr 2011 11:46:17 +0300 Subject: [PATCH] forgot the furnace menu files! --- src/guiFurnaceMenu.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++ src/guiFurnaceMenu.h | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 src/guiFurnaceMenu.cpp create mode 100644 src/guiFurnaceMenu.h diff --git a/src/guiFurnaceMenu.cpp b/src/guiFurnaceMenu.cpp new file mode 100644 index 00000000..9a998ce7 --- /dev/null +++ b/src/guiFurnaceMenu.cpp @@ -0,0 +1,58 @@ +/* +Minetest-c55 +Copyright (C) 2010 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 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 General Public License for more details. + +You should have received a copy of the GNU 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. +*/ + +#include "guiFurnaceMenu.h" +#include "client.h" + +GUIFurnaceMenu::GUIFurnaceMenu( + gui::IGUIEnvironment* env, + gui::IGUIElement* parent, s32 id, + IMenuManager *menumgr, + v3s16 nodepos, + Client *client + ): + GUIInventoryMenu(env, parent, id, menumgr, v2s16(8,9), + client->getInventoryContext(), client), + m_nodepos(nodepos), + m_client(client) +{ + std::string furnace_inv_id; + furnace_inv_id += "nodemeta:"; + furnace_inv_id += itos(nodepos.X); + furnace_inv_id += ","; + furnace_inv_id += itos(nodepos.Y); + furnace_inv_id += ","; + furnace_inv_id += itos(nodepos.Z); + + core::array draw_spec; + draw_spec.push_back(GUIInventoryMenu::DrawSpec( + "list", furnace_inv_id, "fuel", + v2s32(2, 3), v2s32(1, 1))); + draw_spec.push_back(GUIInventoryMenu::DrawSpec( + "list", furnace_inv_id, "src", + v2s32(2, 1), v2s32(1, 1))); + draw_spec.push_back(GUIInventoryMenu::DrawSpec( + "list", furnace_inv_id, "dst", + v2s32(5, 1), v2s32(2, 2))); + draw_spec.push_back(GUIInventoryMenu::DrawSpec( + "list", "current_player", "main", + v2s32(0, 5), v2s32(8, 4))); + setDrawSpec(draw_spec); +} + diff --git a/src/guiFurnaceMenu.h b/src/guiFurnaceMenu.h new file mode 100644 index 00000000..ccc2e9dc --- /dev/null +++ b/src/guiFurnaceMenu.h @@ -0,0 +1,44 @@ +/* +Minetest-c55 +Copyright (C) 2010 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 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 General Public License for more details. + +You should have received a copy of the GNU 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 GUIFURNACEMENU_HEADER +#define GUIFURNACEMENU_HEADER + +#include "guiInventoryMenu.h" + +class Client; + +class GUIFurnaceMenu : public GUIInventoryMenu +{ +public: + GUIFurnaceMenu( + gui::IGUIEnvironment* env, + gui::IGUIElement* parent, s32 id, + IMenuManager *menumgr, + v3s16 nodepos, + Client *client + ); +private: + + v3s16 m_nodepos; + Client *m_client; +}; + +#endif + -- 2.30.2