From be5d25a7b10a4034a8de352c428690a1360238c7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 28 Oct 2020 07:18:23 +0100 Subject: [PATCH] - moved all shareable script sources to their own folder in gzdoom.pk3. --- wadsrc/static/zscript.txt | 50 ++-- wadsrc/static/zscript/{ => engine}/base.zs | 0 .../static/zscript/{ => engine}/dictionary.zs | 0 .../static/zscript/{ => engine}/dynarrays.zs | 0 wadsrc/static/zscript/engine/inputevents.zs | 233 ++++++++++++++++++ .../{ => engine}/ui/menu/colorpickermenu.zs | 0 .../{ => engine}/ui/menu/imagescroller.zs | 0 .../{ => engine}/ui/menu/joystickmenu.zs | 0 .../zscript/{ => engine}/ui/menu/listmenu.zs | 34 +++ .../{ => engine}/ui/menu/listmenuitems.zs | 0 .../{ => engine}/ui/menu/loadsavemenu.zs | 0 .../zscript/{ => engine}/ui/menu/menu.zs | 34 +++ .../{ => engine}/ui/menu/menucustomize.zs | 0 .../{ => engine}/ui/menu/menuitembase.zs | 0 .../{ => engine}/ui/menu/messagebox.zs | 0 .../{ => engine}/ui/menu/optionmenu.zs | 0 .../{ => engine}/ui/menu/optionmenuitems.zs | 0 .../{ => engine}/ui/menu/reverbedit.zs | 0 .../ui/menu/search/anyoralloption.zs | 0 .../{ => engine}/ui/menu/search/menu.zs | 0 .../{ => engine}/ui/menu/search/query.zs | 0 .../ui/menu/search/searchfield.zs | 0 .../{ => engine}/ui/menu/textentermenu.zs | 0 wadsrc/static/zscript/events.zs | 233 ------------------ wadsrc/static/zscript/zscript_license.txt | 41 ++- 25 files changed, 367 insertions(+), 258 deletions(-) rename wadsrc/static/zscript/{ => engine}/base.zs (100%) rename wadsrc/static/zscript/{ => engine}/dictionary.zs (100%) rename wadsrc/static/zscript/{ => engine}/dynarrays.zs (100%) create mode 100644 wadsrc/static/zscript/engine/inputevents.zs rename wadsrc/static/zscript/{ => engine}/ui/menu/colorpickermenu.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/imagescroller.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/joystickmenu.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/listmenu.zs (81%) rename wadsrc/static/zscript/{ => engine}/ui/menu/listmenuitems.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/loadsavemenu.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/menu.zs (83%) rename wadsrc/static/zscript/{ => engine}/ui/menu/menucustomize.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/menuitembase.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/messagebox.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/optionmenu.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/optionmenuitems.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/reverbedit.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/search/anyoralloption.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/search/menu.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/search/query.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/search/searchfield.zs (100%) rename wadsrc/static/zscript/{ => engine}/ui/menu/textentermenu.zs (100%) diff --git a/wadsrc/static/zscript.txt b/wadsrc/static/zscript.txt index 8f39bcca9..79a89557a 100644 --- a/wadsrc/static/zscript.txt +++ b/wadsrc/static/zscript.txt @@ -1,15 +1,40 @@ version "4.5" -#include "zscript/base.zs" + +// Generic engine code +#include "zscript/engine/base.zs" +#include "zscript/engine/dynarrays.zs" +#include "zscript/engine/dictionary.zs" +#include "zscript/engine/inputevents.zs" + +#include "zscript/engine/ui/menu/colorpickermenu.zs" +#include "zscript/engine/ui/menu/joystickmenu.zs" +#include "zscript/engine/ui/menu/listmenu.zs" +#include "zscript/engine/ui/menu/listmenuitems.zs" +#include "zscript/engine/ui/menu/loadsavemenu.zs" +#include "zscript/engine/ui/menu/menu.zs" +#include "zscript/engine/ui/menu/menucustomize.zs" +#include "zscript/engine/ui/menu/menuitembase.zs" +#include "zscript/engine/ui/menu/messagebox.zs" +#include "zscript/engine/ui/menu/optionmenu.zs" +#include "zscript/engine/ui/menu/optionmenuitems.zs" +#include "zscript/engine/ui/menu/reverbedit.zs" +#include "zscript/engine/ui/menu/textentermenu.zs" +#include "zscript/engine/ui/menu/imagescroller.zs" + +#include "zscript/engine/ui/menu/search/menu.zs" +#include "zscript/engine/ui/menu/search/searchfield.zs" +#include "zscript/engine/ui/menu/search/query.zs" +#include "zscript/engine/ui/menu/search/anyoralloption.zs" + +// GZDoom exclusive. #include "zscript/doombase.zs" #include "zscript/sounddata.zs" #include "zscript/mapdata.zs" -#include "zscript/dynarrays.zs" #include "zscript/constants.zs" #include "zscript/events.zs" #include "zscript/destructible.zs" #include "zscript/level_postprocessor.zs" #include "zscript/level_compatibility.zs" -#include "zscript/dictionary.zs" #include "zscript/actors/actor.zs" #include "zscript/actors/checks.zs" @@ -239,32 +264,13 @@ version "4.5" #include "zscript/actors/chex/chexdecorations.zs" #include "zscript/actors/chex/chexplayer.zs" -#include "zscript/ui/menu/colorpickermenu.zs" #include "zscript/ui/menu/conversationmenu.zs" -#include "zscript/ui/menu/joystickmenu.zs" -#include "zscript/ui/menu/listmenu.zs" -#include "zscript/ui/menu/listmenuitems.zs" -#include "zscript/ui/menu/loadsavemenu.zs" -#include "zscript/ui/menu/menu.zs" -#include "zscript/ui/menu/menuitembase.zs" -#include "zscript/ui/menu/messagebox.zs" -#include "zscript/ui/menu/optionmenu.zs" -#include "zscript/ui/menu/optionmenuitems.zs" #include "zscript/ui/menu/doommenus.zs" #include "zscript/ui/menu/newplayermenu.zs" #include "zscript/ui/menu/playercontrols.zs" #include "zscript/ui/menu/playerdisplay.zs" #include "zscript/ui/menu/playermenu.zs" #include "zscript/ui/menu/readthis.zs" -#include "zscript/ui/menu/reverbedit.zs" -#include "zscript/ui/menu/textentermenu.zs" -#include "zscript/ui/menu/menucustomize.zs" -#include "zscript/ui/menu/imagescroller.zs" - -#include "zscript/ui/menu/search/menu.zs" -#include "zscript/ui/menu/search/searchfield.zs" -#include "zscript/ui/menu/search/query.zs" -#include "zscript/ui/menu/search/anyoralloption.zs" #include "zscript/ui/statscreen/statscreen.zs" #include "zscript/ui/statscreen/statscreen_coop.zs" diff --git a/wadsrc/static/zscript/base.zs b/wadsrc/static/zscript/engine/base.zs similarity index 100% rename from wadsrc/static/zscript/base.zs rename to wadsrc/static/zscript/engine/base.zs diff --git a/wadsrc/static/zscript/dictionary.zs b/wadsrc/static/zscript/engine/dictionary.zs similarity index 100% rename from wadsrc/static/zscript/dictionary.zs rename to wadsrc/static/zscript/engine/dictionary.zs diff --git a/wadsrc/static/zscript/dynarrays.zs b/wadsrc/static/zscript/engine/dynarrays.zs similarity index 100% rename from wadsrc/static/zscript/dynarrays.zs rename to wadsrc/static/zscript/engine/dynarrays.zs diff --git a/wadsrc/static/zscript/engine/inputevents.zs b/wadsrc/static/zscript/engine/inputevents.zs new file mode 100644 index 000000000..95a6d29ab --- /dev/null +++ b/wadsrc/static/zscript/engine/inputevents.zs @@ -0,0 +1,233 @@ +struct UiEvent native ui version("2.4") +{ + // d_gui.h + enum EGUIEvent + { + Type_None, + Type_KeyDown, + Type_KeyRepeat, + Type_KeyUp, + Type_Char, + Type_FirstMouseEvent, // ? + Type_MouseMove, + Type_LButtonDown, + Type_LButtonUp, + Type_LButtonClick, + Type_MButtonDown, + Type_MButtonUp, + Type_MButtonClick, + Type_RButtonDown, + Type_RButtonUp, + Type_RButtonClick, + Type_WheelUp, + Type_WheelDown, + Type_WheelRight, // ??? + Type_WheelLeft, // ??? + Type_BackButtonDown, // ??? + Type_BackButtonUp, // ??? + Type_FwdButtonDown, // ??? + Type_FwdButtonUp, // ??? + Type_LastMouseEvent + } + + // for KeyDown, KeyRepeat, KeyUp + enum ESpecialGUIKeys + { + Key_PgDn = 1, + Key_PgUp = 2, + Key_Home = 3, + Key_End = 4, + Key_Left = 5, + Key_Right = 6, + Key_Alert = 7, // ASCII bell + Key_Backspace = 8, // ASCII + Key_Tab = 9, // ASCII + Key_LineFeed = 10, // ASCII + Key_Down = 10, + Key_VTab = 11, // ASCII + Key_Up = 11, + Key_FormFeed = 12, // ASCII + Key_Return = 13, // ASCII + Key_F1 = 14, + Key_F2 = 15, + Key_F3 = 16, + Key_F4 = 17, + Key_F5 = 18, + Key_F6 = 19, + Key_F7 = 20, + Key_F8 = 21, + Key_F9 = 22, + Key_F10 = 23, + Key_F11 = 24, + Key_F12 = 25, + Key_Del = 26, + Key_Escape = 27, // ASCII + Key_Free1 = 28, + Key_Free2 = 29, + Key_Back = 30, // browser back key + Key_CEscape = 31 // color escape + } + + // + native readonly EGUIEvent Type; + // + native readonly String KeyString; + native readonly int KeyChar; + // + native readonly int MouseX; + native readonly int MouseY; + // + native readonly bool IsShift; + native readonly bool IsCtrl; + native readonly bool IsAlt; +} + +struct InputEvent native play version("2.4") +{ + enum EGenericEvent + { + Type_None, + Type_KeyDown, + Type_KeyUp, + Type_Mouse, + Type_GUI, // unused, kept for completeness + Type_DeviceChange + } + + // ew. + enum EDoomInputKeys + { + Key_Pause = 0xc5, // DIK_PAUSE + Key_RightArrow = 0xcd, // DIK_RIGHT + Key_LeftArrow = 0xcb, // DIK_LEFT + Key_UpArrow = 0xc8, // DIK_UP + Key_DownArrow = 0xd0, // DIK_DOWN + Key_Escape = 0x01, // DIK_ESCAPE + Key_Enter = 0x1c, // DIK_RETURN + Key_Space = 0x39, // DIK_SPACE + Key_Tab = 0x0f, // DIK_TAB + Key_F1 = 0x3b, // DIK_F1 + Key_F2 = 0x3c, // DIK_F2 + Key_F3 = 0x3d, // DIK_F3 + Key_F4 = 0x3e, // DIK_F4 + Key_F5 = 0x3f, // DIK_F5 + Key_F6 = 0x40, // DIK_F6 + Key_F7 = 0x41, // DIK_F7 + Key_F8 = 0x42, // DIK_F8 + Key_F9 = 0x43, // DIK_F9 + Key_F10 = 0x44, // DIK_F10 + Key_F11 = 0x57, // DIK_F11 + Key_F12 = 0x58, // DIK_F12 + Key_Grave = 0x29, // DIK_GRAVE + + Key_Backspace = 0x0e, // DIK_BACK + + Key_Equals = 0x0d, // DIK_EQUALS + Key_Minus = 0x0c, // DIK_MINUS + + Key_LShift = 0x2A, // DIK_LSHIFT + Key_LCtrl = 0x1d, // DIK_LCONTROL + Key_LAlt = 0x38, // DIK_LMENU + + Key_RShift = Key_LSHIFT, + Key_RCtrl = Key_LCTRL, + Key_RAlt = Key_LALT, + + Key_Ins = 0xd2, // DIK_INSERT + Key_Del = 0xd3, // DIK_DELETE + Key_End = 0xcf, // DIK_END + Key_Home = 0xc7, // DIK_HOME + Key_PgUp = 0xc9, // DIK_PRIOR + Key_PgDn = 0xd1, // DIK_NEXT + + Key_Mouse1 = 0x100, + Key_Mouse2 = 0x101, + Key_Mouse3 = 0x102, + Key_Mouse4 = 0x103, + Key_Mouse5 = 0x104, + Key_Mouse6 = 0x105, + Key_Mouse7 = 0x106, + Key_Mouse8 = 0x107, + + Key_FirstJoyButton = 0x108, + Key_Joy1 = (Key_FirstJoyButton+0), + Key_Joy2 = (Key_FirstJoyButton+1), + Key_Joy3 = (Key_FirstJoyButton+2), + Key_Joy4 = (Key_FirstJoyButton+3), + Key_Joy5 = (Key_FirstJoyButton+4), + Key_Joy6 = (Key_FirstJoyButton+5), + Key_Joy7 = (Key_FirstJoyButton+6), + Key_Joy8 = (Key_FirstJoyButton+7), + Key_LastJoyButton = 0x187, + Key_JoyPOV1_Up = 0x188, + Key_JoyPOV1_Right = 0x189, + Key_JoyPOV1_Down = 0x18a, + Key_JoyPOV1_Left = 0x18b, + Key_JoyPOV2_Up = 0x18c, + Key_JoyPOV3_Up = 0x190, + Key_JoyPOV4_Up = 0x194, + + Key_MWheelUp = 0x198, + Key_MWheelDown = 0x199, + Key_MWheelRight = 0x19A, + Key_MWheelLeft = 0x19B, + + Key_JoyAxis1Plus = 0x19C, + Key_JoyAxis1Minus = 0x19D, + Key_JoyAxis2Plus = 0x19E, + Key_JoyAxis2Minus = 0x19F, + Key_JoyAxis3Plus = 0x1A0, + Key_JoyAxis3Minus = 0x1A1, + Key_JoyAxis4Plus = 0x1A2, + Key_JoyAxis4Minus = 0x1A3, + Key_JoyAxis5Plus = 0x1A4, + Key_JoyAxis5Minus = 0x1A5, + Key_JoyAxis6Plus = 0x1A6, + Key_JoyAxis6Minus = 0x1A7, + Key_JoyAxis7Plus = 0x1A8, + Key_JoyAxis7Minus = 0x1A9, + Key_JoyAxis8Plus = 0x1AA, + Key_JoyAxis8Minus = 0x1AB, + Num_JoyAxisButtons = 8, + + Key_Pad_LThumb_Right = 0x1AC, + Key_Pad_LThumb_Left = 0x1AD, + Key_Pad_LThumb_Down = 0x1AE, + Key_Pad_LThumb_Up = 0x1AF, + + Key_Pad_RThumb_Right = 0x1B0, + Key_Pad_RThumb_Left = 0x1B1, + Key_Pad_RThumb_Down = 0x1B2, + Key_Pad_RThumb_Up = 0x1B3, + + Key_Pad_DPad_Up = 0x1B4, + Key_Pad_DPad_Down = 0x1B5, + Key_Pad_DPad_Left = 0x1B6, + Key_Pad_DPad_Right = 0x1B7, + Key_Pad_Start = 0x1B8, + Key_Pad_Back = 0x1B9, + Key_Pad_LThumb = 0x1BA, + Key_Pad_RThumb = 0x1BB, + Key_Pad_LShoulder = 0x1BC, + Key_Pad_RShoulder = 0x1BD, + Key_Pad_LTrigger = 0x1BE, + Key_Pad_RTrigger = 0x1BF, + Key_Pad_A = 0x1C0, + Key_Pad_B = 0x1C1, + Key_Pad_X = 0x1C2, + Key_Pad_Y = 0x1C3, + + Num_Keys = 0x1C4 + } + + // + native readonly EGenericEvent Type; + // + native readonly int KeyScan; // as in EDoomInputKeys enum + native readonly String KeyString; + native readonly int KeyChar; // ASCII char (if any) + // + native readonly int MouseX; + native readonly int MouseY; +} + diff --git a/wadsrc/static/zscript/ui/menu/colorpickermenu.zs b/wadsrc/static/zscript/engine/ui/menu/colorpickermenu.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/colorpickermenu.zs rename to wadsrc/static/zscript/engine/ui/menu/colorpickermenu.zs diff --git a/wadsrc/static/zscript/ui/menu/imagescroller.zs b/wadsrc/static/zscript/engine/ui/menu/imagescroller.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/imagescroller.zs rename to wadsrc/static/zscript/engine/ui/menu/imagescroller.zs diff --git a/wadsrc/static/zscript/ui/menu/joystickmenu.zs b/wadsrc/static/zscript/engine/ui/menu/joystickmenu.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/joystickmenu.zs rename to wadsrc/static/zscript/engine/ui/menu/joystickmenu.zs diff --git a/wadsrc/static/zscript/ui/menu/listmenu.zs b/wadsrc/static/zscript/engine/ui/menu/listmenu.zs similarity index 81% rename from wadsrc/static/zscript/ui/menu/listmenu.zs rename to wadsrc/static/zscript/engine/ui/menu/listmenu.zs index c8ba63eb1..6a2c9c1b0 100644 --- a/wadsrc/static/zscript/ui/menu/listmenu.zs +++ b/wadsrc/static/zscript/engine/ui/menu/listmenu.zs @@ -1,3 +1,37 @@ +/* +** listmenu.zs +** The main menu class +** +**--------------------------------------------------------------------------- +** Copyright 2010-2020 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. +**--------------------------------------------------------------------------- +** +*/ + class ListMenuDescriptor : MenuDescriptor native diff --git a/wadsrc/static/zscript/ui/menu/listmenuitems.zs b/wadsrc/static/zscript/engine/ui/menu/listmenuitems.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/listmenuitems.zs rename to wadsrc/static/zscript/engine/ui/menu/listmenuitems.zs diff --git a/wadsrc/static/zscript/ui/menu/loadsavemenu.zs b/wadsrc/static/zscript/engine/ui/menu/loadsavemenu.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/loadsavemenu.zs rename to wadsrc/static/zscript/engine/ui/menu/loadsavemenu.zs diff --git a/wadsrc/static/zscript/ui/menu/menu.zs b/wadsrc/static/zscript/engine/ui/menu/menu.zs similarity index 83% rename from wadsrc/static/zscript/ui/menu/menu.zs rename to wadsrc/static/zscript/engine/ui/menu/menu.zs index a9a7a01b8..b40c10f0c 100644 --- a/wadsrc/static/zscript/ui/menu/menu.zs +++ b/wadsrc/static/zscript/engine/ui/menu/menu.zs @@ -1,3 +1,37 @@ +/* +** menu.zs +** The menu engine core +** +**--------------------------------------------------------------------------- +** Copyright 2010-2020 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. +**--------------------------------------------------------------------------- +** +*/ + struct KeyBindings native version("2.4") { diff --git a/wadsrc/static/zscript/ui/menu/menucustomize.zs b/wadsrc/static/zscript/engine/ui/menu/menucustomize.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/menucustomize.zs rename to wadsrc/static/zscript/engine/ui/menu/menucustomize.zs diff --git a/wadsrc/static/zscript/ui/menu/menuitembase.zs b/wadsrc/static/zscript/engine/ui/menu/menuitembase.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/menuitembase.zs rename to wadsrc/static/zscript/engine/ui/menu/menuitembase.zs diff --git a/wadsrc/static/zscript/ui/menu/messagebox.zs b/wadsrc/static/zscript/engine/ui/menu/messagebox.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/messagebox.zs rename to wadsrc/static/zscript/engine/ui/menu/messagebox.zs diff --git a/wadsrc/static/zscript/ui/menu/optionmenu.zs b/wadsrc/static/zscript/engine/ui/menu/optionmenu.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/optionmenu.zs rename to wadsrc/static/zscript/engine/ui/menu/optionmenu.zs diff --git a/wadsrc/static/zscript/ui/menu/optionmenuitems.zs b/wadsrc/static/zscript/engine/ui/menu/optionmenuitems.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/optionmenuitems.zs rename to wadsrc/static/zscript/engine/ui/menu/optionmenuitems.zs diff --git a/wadsrc/static/zscript/ui/menu/reverbedit.zs b/wadsrc/static/zscript/engine/ui/menu/reverbedit.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/reverbedit.zs rename to wadsrc/static/zscript/engine/ui/menu/reverbedit.zs diff --git a/wadsrc/static/zscript/ui/menu/search/anyoralloption.zs b/wadsrc/static/zscript/engine/ui/menu/search/anyoralloption.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/search/anyoralloption.zs rename to wadsrc/static/zscript/engine/ui/menu/search/anyoralloption.zs diff --git a/wadsrc/static/zscript/ui/menu/search/menu.zs b/wadsrc/static/zscript/engine/ui/menu/search/menu.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/search/menu.zs rename to wadsrc/static/zscript/engine/ui/menu/search/menu.zs diff --git a/wadsrc/static/zscript/ui/menu/search/query.zs b/wadsrc/static/zscript/engine/ui/menu/search/query.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/search/query.zs rename to wadsrc/static/zscript/engine/ui/menu/search/query.zs diff --git a/wadsrc/static/zscript/ui/menu/search/searchfield.zs b/wadsrc/static/zscript/engine/ui/menu/search/searchfield.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/search/searchfield.zs rename to wadsrc/static/zscript/engine/ui/menu/search/searchfield.zs diff --git a/wadsrc/static/zscript/ui/menu/textentermenu.zs b/wadsrc/static/zscript/engine/ui/menu/textentermenu.zs similarity index 100% rename from wadsrc/static/zscript/ui/menu/textentermenu.zs rename to wadsrc/static/zscript/engine/ui/menu/textentermenu.zs diff --git a/wadsrc/static/zscript/events.zs b/wadsrc/static/zscript/events.zs index 26989b8ef..6db6fb1e2 100644 --- a/wadsrc/static/zscript/events.zs +++ b/wadsrc/static/zscript/events.zs @@ -49,239 +49,6 @@ struct PlayerEvent native play version("2.4") native readonly bool IsReturn; } -struct UiEvent native ui version("2.4") -{ - // d_gui.h - enum EGUIEvent - { - Type_None, - Type_KeyDown, - Type_KeyRepeat, - Type_KeyUp, - Type_Char, - Type_FirstMouseEvent, // ? - Type_MouseMove, - Type_LButtonDown, - Type_LButtonUp, - Type_LButtonClick, - Type_MButtonDown, - Type_MButtonUp, - Type_MButtonClick, - Type_RButtonDown, - Type_RButtonUp, - Type_RButtonClick, - Type_WheelUp, - Type_WheelDown, - Type_WheelRight, // ??? - Type_WheelLeft, // ??? - Type_BackButtonDown, // ??? - Type_BackButtonUp, // ??? - Type_FwdButtonDown, // ??? - Type_FwdButtonUp, // ??? - Type_LastMouseEvent - } - - // for KeyDown, KeyRepeat, KeyUp - enum ESpecialGUIKeys - { - Key_PgDn = 1, - Key_PgUp = 2, - Key_Home = 3, - Key_End = 4, - Key_Left = 5, - Key_Right = 6, - Key_Alert = 7, // ASCII bell - Key_Backspace = 8, // ASCII - Key_Tab = 9, // ASCII - Key_LineFeed = 10, // ASCII - Key_Down = 10, - Key_VTab = 11, // ASCII - Key_Up = 11, - Key_FormFeed = 12, // ASCII - Key_Return = 13, // ASCII - Key_F1 = 14, - Key_F2 = 15, - Key_F3 = 16, - Key_F4 = 17, - Key_F5 = 18, - Key_F6 = 19, - Key_F7 = 20, - Key_F8 = 21, - Key_F9 = 22, - Key_F10 = 23, - Key_F11 = 24, - Key_F12 = 25, - Key_Del = 26, - Key_Escape = 27, // ASCII - Key_Free1 = 28, - Key_Free2 = 29, - Key_Back = 30, // browser back key - Key_CEscape = 31 // color escape - } - - // - native readonly EGUIEvent Type; - // - native readonly String KeyString; - native readonly int KeyChar; - // - native readonly int MouseX; - native readonly int MouseY; - // - native readonly bool IsShift; - native readonly bool IsCtrl; - native readonly bool IsAlt; -} - -struct InputEvent native play version("2.4") -{ - enum EGenericEvent - { - Type_None, - Type_KeyDown, - Type_KeyUp, - Type_Mouse, - Type_GUI, // unused, kept for completeness - Type_DeviceChange - } - - // ew. - enum EDoomInputKeys - { - Key_Pause = 0xc5, // DIK_PAUSE - Key_RightArrow = 0xcd, // DIK_RIGHT - Key_LeftArrow = 0xcb, // DIK_LEFT - Key_UpArrow = 0xc8, // DIK_UP - Key_DownArrow = 0xd0, // DIK_DOWN - Key_Escape = 0x01, // DIK_ESCAPE - Key_Enter = 0x1c, // DIK_RETURN - Key_Space = 0x39, // DIK_SPACE - Key_Tab = 0x0f, // DIK_TAB - Key_F1 = 0x3b, // DIK_F1 - Key_F2 = 0x3c, // DIK_F2 - Key_F3 = 0x3d, // DIK_F3 - Key_F4 = 0x3e, // DIK_F4 - Key_F5 = 0x3f, // DIK_F5 - Key_F6 = 0x40, // DIK_F6 - Key_F7 = 0x41, // DIK_F7 - Key_F8 = 0x42, // DIK_F8 - Key_F9 = 0x43, // DIK_F9 - Key_F10 = 0x44, // DIK_F10 - Key_F11 = 0x57, // DIK_F11 - Key_F12 = 0x58, // DIK_F12 - Key_Grave = 0x29, // DIK_GRAVE - - Key_Backspace = 0x0e, // DIK_BACK - - Key_Equals = 0x0d, // DIK_EQUALS - Key_Minus = 0x0c, // DIK_MINUS - - Key_LShift = 0x2A, // DIK_LSHIFT - Key_LCtrl = 0x1d, // DIK_LCONTROL - Key_LAlt = 0x38, // DIK_LMENU - - Key_RShift = Key_LSHIFT, - Key_RCtrl = Key_LCTRL, - Key_RAlt = Key_LALT, - - Key_Ins = 0xd2, // DIK_INSERT - Key_Del = 0xd3, // DIK_DELETE - Key_End = 0xcf, // DIK_END - Key_Home = 0xc7, // DIK_HOME - Key_PgUp = 0xc9, // DIK_PRIOR - Key_PgDn = 0xd1, // DIK_NEXT - - Key_Mouse1 = 0x100, - Key_Mouse2 = 0x101, - Key_Mouse3 = 0x102, - Key_Mouse4 = 0x103, - Key_Mouse5 = 0x104, - Key_Mouse6 = 0x105, - Key_Mouse7 = 0x106, - Key_Mouse8 = 0x107, - - Key_FirstJoyButton = 0x108, - Key_Joy1 = (Key_FirstJoyButton+0), - Key_Joy2 = (Key_FirstJoyButton+1), - Key_Joy3 = (Key_FirstJoyButton+2), - Key_Joy4 = (Key_FirstJoyButton+3), - Key_Joy5 = (Key_FirstJoyButton+4), - Key_Joy6 = (Key_FirstJoyButton+5), - Key_Joy7 = (Key_FirstJoyButton+6), - Key_Joy8 = (Key_FirstJoyButton+7), - Key_LastJoyButton = 0x187, - Key_JoyPOV1_Up = 0x188, - Key_JoyPOV1_Right = 0x189, - Key_JoyPOV1_Down = 0x18a, - Key_JoyPOV1_Left = 0x18b, - Key_JoyPOV2_Up = 0x18c, - Key_JoyPOV3_Up = 0x190, - Key_JoyPOV4_Up = 0x194, - - Key_MWheelUp = 0x198, - Key_MWheelDown = 0x199, - Key_MWheelRight = 0x19A, - Key_MWheelLeft = 0x19B, - - Key_JoyAxis1Plus = 0x19C, - Key_JoyAxis1Minus = 0x19D, - Key_JoyAxis2Plus = 0x19E, - Key_JoyAxis2Minus = 0x19F, - Key_JoyAxis3Plus = 0x1A0, - Key_JoyAxis3Minus = 0x1A1, - Key_JoyAxis4Plus = 0x1A2, - Key_JoyAxis4Minus = 0x1A3, - Key_JoyAxis5Plus = 0x1A4, - Key_JoyAxis5Minus = 0x1A5, - Key_JoyAxis6Plus = 0x1A6, - Key_JoyAxis6Minus = 0x1A7, - Key_JoyAxis7Plus = 0x1A8, - Key_JoyAxis7Minus = 0x1A9, - Key_JoyAxis8Plus = 0x1AA, - Key_JoyAxis8Minus = 0x1AB, - Num_JoyAxisButtons = 8, - - Key_Pad_LThumb_Right = 0x1AC, - Key_Pad_LThumb_Left = 0x1AD, - Key_Pad_LThumb_Down = 0x1AE, - Key_Pad_LThumb_Up = 0x1AF, - - Key_Pad_RThumb_Right = 0x1B0, - Key_Pad_RThumb_Left = 0x1B1, - Key_Pad_RThumb_Down = 0x1B2, - Key_Pad_RThumb_Up = 0x1B3, - - Key_Pad_DPad_Up = 0x1B4, - Key_Pad_DPad_Down = 0x1B5, - Key_Pad_DPad_Left = 0x1B6, - Key_Pad_DPad_Right = 0x1B7, - Key_Pad_Start = 0x1B8, - Key_Pad_Back = 0x1B9, - Key_Pad_LThumb = 0x1BA, - Key_Pad_RThumb = 0x1BB, - Key_Pad_LShoulder = 0x1BC, - Key_Pad_RShoulder = 0x1BD, - Key_Pad_LTrigger = 0x1BE, - Key_Pad_RTrigger = 0x1BF, - Key_Pad_A = 0x1C0, - Key_Pad_B = 0x1C1, - Key_Pad_X = 0x1C2, - Key_Pad_Y = 0x1C3, - - Num_Keys = 0x1C4 - } - - // - native readonly EGenericEvent Type; - // - native readonly int KeyScan; // as in EDoomInputKeys enum - native readonly String KeyString; - native readonly int KeyChar; // ASCII char (if any) - // - native readonly int MouseX; - native readonly int MouseY; -} - struct ConsoleEvent native version("2.4") { // for net events, this will be the activator. diff --git a/wadsrc/static/zscript/zscript_license.txt b/wadsrc/static/zscript/zscript_license.txt index 4ab1812d3..80e69ad52 100644 --- a/wadsrc/static/zscript/zscript_license.txt +++ b/wadsrc/static/zscript/zscript_license.txt @@ -1,8 +1,8 @@ -Unless noted differently in the file, the following license applies to all ZScript sources: +Unless noted differently in the file, the following license applies to all ZScript sources *outside* the 'engine' folder: //----------------------------------------------------------------------------- // -// Copyright 1993-2019 id Software, Randy Heit, Christoph Oelckers et.al. +// Copyright 1993-2020 id Software, Randy Heit, Christoph Oelckers et.al. // // 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 @@ -18,4 +18,39 @@ Unless noted differently in the file, the following license applies to all ZScri // along with this program. If not, see http://www.gnu.org/licenses/ // //----------------------------------------------------------------------------- -// \ No newline at end of file +// + +Unless noted differently in the file, the following license applies to all ZScript sources *inside* the 'engine' folder: + +/* +** +**--------------------------------------------------------------------------- +** Copyright 2005-2020 Randy Heit, Christoph Oelckers et.al. +** 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. +**--------------------------------------------------------------------------- +** +*/ +