From de1e7661ebd16517d1329f3c67f6ae5b80fb36e9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Feb 2017 21:25:19 +0100 Subject: [PATCH] - removed all native remnants of TextEnterMenu. --- src/CMakeLists.txt | 1 - src/menu/menu.cpp | 1 + src/menu/menu.h | 26 +-------- src/menu/menuinput.cpp | 58 -------------------- wadsrc/static/zscript/menu/textentermenu.txt | 54 ++++++++++++++---- 5 files changed, 46 insertions(+), 94 deletions(-) delete mode 100644 src/menu/menuinput.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 04f2d0cd9..7619c6334 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -848,7 +848,6 @@ set( FASTMATH_PCH_SOURCES menu/loadsavemenu.cpp menu/menu.cpp menu/menudef.cpp - menu/menuinput.cpp menu/messagebox.cpp menu/optionmenu.cpp menu/playermenu.cpp diff --git a/src/menu/menu.cpp b/src/menu/menu.cpp index 50e07f5b2..54615f4e7 100644 --- a/src/menu/menu.cpp +++ b/src/menu/menu.cpp @@ -63,6 +63,7 @@ CVAR (Float, mouse_sensitivity, 1.f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, show_messages, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR (Bool, show_obituaries, true, CVAR_ARCHIVE) +CVAR(Bool, m_showinputgrid, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR (Float, snd_menuvolume, 0.6f, CVAR_ARCHIVE) diff --git a/src/menu/menu.h b/src/menu/menu.h index c9307a0ef..415e3dff6 100644 --- a/src/menu/menu.h +++ b/src/menu/menu.h @@ -348,34 +348,10 @@ extern FOptionMap OptionValues; //============================================================================= // -// Input some text +// // //============================================================================= -class DTextEnterMenu : public DMenu -{ - DECLARE_CLASS(DTextEnterMenu, DMenu) - -public: - FString mEnterString; - unsigned int mEnterSize; - unsigned int mEnterPos; - int mSizeMode; // 1: size is length in chars. 2: also check string width - bool mInputGridOkay; - - int InputGridX; - int InputGridY; - - // [TP] - bool AllowColors; - - - DTextEnterMenu() {} -}; - - - - struct event_t; void M_EnableMenu (bool on) ; bool M_Responder (event_t *ev); diff --git a/src/menu/menuinput.cpp b/src/menu/menuinput.cpp deleted file mode 100644 index 404b955a0..000000000 --- a/src/menu/menuinput.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* -** menuinput.cpp -** The string input code -** -**--------------------------------------------------------------------------- -** Copyright 2001-2010 Randy Heit -** Copyright 2010 Christoph Oelckers -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** 3. The name of the author may not be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**--------------------------------------------------------------------------- -** -*/ - -#include "menu/menu.h" -#include "v_video.h" -#include "c_cvars.h" -#include "d_event.h" -#include "d_gui.h" -#include "v_font.h" -#include "v_palette.h" -#include "cmdlib.h" -// [TP] New #includes -#include "v_text.h" - -IMPLEMENT_CLASS(DTextEnterMenu, false, false) - -CVAR(Bool, m_showinputgrid, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) - -DEFINE_FIELD(DTextEnterMenu, mEnterString); -DEFINE_FIELD(DTextEnterMenu, mEnterSize); -DEFINE_FIELD(DTextEnterMenu, mEnterPos); -DEFINE_FIELD(DTextEnterMenu, mSizeMode); // 1: size is length in chars. 2: also check string width -DEFINE_FIELD(DTextEnterMenu, mInputGridOkay); -DEFINE_FIELD(DTextEnterMenu, InputGridX); -DEFINE_FIELD(DTextEnterMenu, InputGridY); -DEFINE_FIELD(DTextEnterMenu, AllowColors); diff --git a/wadsrc/static/zscript/menu/textentermenu.txt b/wadsrc/static/zscript/menu/textentermenu.txt index c48f6854f..356eba1e6 100644 --- a/wadsrc/static/zscript/menu/textentermenu.txt +++ b/wadsrc/static/zscript/menu/textentermenu.txt @@ -1,20 +1,54 @@ +/* +** menuinput.cpp +** The string input code +** +**--------------------------------------------------------------------------- +** Copyright 2001-2010 Randy Heit +** Copyright 2010-2017 Christoph Oelckers +** All rights reserved. +** +** Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions +** are met: +** +** 1. Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** 2. Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in the +** documentation and/or other materials provided with the distribution. +** 3. The name of the author may not be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +**--------------------------------------------------------------------------- +** +*/ -// This is only the parts that are needed to make the menu fully work right now. More to come later. -class TextEnterMenu : Menu native + +class TextEnterMenu : Menu { const INPUTGRID_WIDTH = 13; const INPUTGRID_HEIGHT = 5; const Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-=.,!?@'\":;[]()<>^#$%&*/_ \b"; - native String mEnterString; - native int mEnterSize; - native int mEnterPos; - native int mSizeMode; // 1: size is length in chars. 2: also check string width - native bool mInputGridOkay; - native int InputGridX; - native int InputGridY; - native bool AllowColors; + String mEnterString; + int mEnterSize; + int mEnterPos; + int mSizeMode; // 1: size is length in chars. 2: also check string width + bool mInputGridOkay; + int InputGridX; + int InputGridY; + bool AllowColors; //============================================================================= //