1 //**************************************************************************
3 //** ## ## ## ## ## #### #### ### ###
4 //** ## ## ## ## ## ## ## ## ## ## #### ####
5 //** ## ## ## ## ## ## ## ## ## ## ## ## ## ##
6 //** ## ## ######## ## ## ## ## ## ## ## ### ##
7 //** ### ## ## ### ## ## ## ## ## ##
8 //** # ## ## # #### #### ## ##
10 //** Copyright (C) 1999-2006 Jānis Legzdiņš
11 //** Copyright (C) 2018-2023 Ketmar Dark
13 //** This program is free software: you can redistribute it and/or modify
14 //** it under the terms of the GNU General Public License as published by
15 //** the Free Software Foundation, version 3 of the License ONLY.
17 //** This program is distributed in the hope that it will be useful,
18 //** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 //** GNU General Public License for more details.
22 //** You should have received a copy of the GNU General Public License
23 //** along with this program. If not, see <http://www.gnu.org/licenses/>.
25 //**************************************************************************
36 static TILine
w_chat(80);
37 static VCvarS
ChatMacro0("Chatmacro0", "No", "Chat macro #0.", CVAR_Archive
|CVAR_NoShadow
);
38 static VCvarS
ChatMacro1("Chatmacro1", "I'm ready to kick butt!", "Chat macro #1.", CVAR_Archive
|CVAR_NoShadow
);
39 static VCvarS
ChatMacro2("Chatmacro2", "I'm OK.", "Chat macro #2.", CVAR_Archive
|CVAR_NoShadow
);
40 static VCvarS
ChatMacro3("Chatmacro3", "I'm not looking too good!", "Chat macro #3.", CVAR_Archive
|CVAR_NoShadow
);
41 static VCvarS
ChatMacro4("Chatmacro4", "Help!", "Chat macro #4.", CVAR_Archive
|CVAR_NoShadow
);
42 static VCvarS
ChatMacro5("Chatmacro5", "You suck!", "Chat macro #5.", CVAR_Archive
|CVAR_NoShadow
);
43 static VCvarS
ChatMacro6("Chatmacro6", "Next time, scumbag...", "Chat macro #6.", CVAR_Archive
|CVAR_NoShadow
);
44 static VCvarS
ChatMacro7("Chatmacro7", "Come here!", "Chat macro #7.", CVAR_Archive
|CVAR_NoShadow
);
45 static VCvarS
ChatMacro8("Chatmacro8", "I'll take care of it.", "Chat macro #8.", CVAR_Archive
|CVAR_NoShadow
);
46 static VCvarS
ChatMacro9("Chatmacro9", "Yes", "Chat macro #9.", CVAR_Archive
|CVAR_NoShadow
);
47 static VCvarS
*chat_macros
[10] = {
61 //===========================================================================
65 // Initialise chat mode data
67 //===========================================================================
69 w_chat
.SetVisChars(42);
74 //===========================================================================
78 //===========================================================================
79 static void CT_Stop () {
84 //===========================================================================
88 //===========================================================================
89 bool CT_Responder (event_t
*ev
) {
90 if (!chatmodeon
) return false;
92 if (GInput
->AltDown
) {
93 if (ev
->type
!= ev_keyup
) return true;
94 if (ev
->keycode
>= '0' && ev
->keycode
<= '9') {
95 GCmdBuf
<< "Say " << VStr(chat_macros
[ev
->keycode
-'0']->asStr()).quote() << "\n";
101 if (ev
->keycode
== K_ENTER
|| ev
->keycode
== K_PADENTER
) {
102 if (ev
->type
!= ev_keyup
) return true;
103 if (w_chat
.length() != 0) {
104 GCmdBuf
<< "Say " << VStr(w_chat
.getCStr()).quote(true) << "\n";
110 if (ev
->keycode
== K_ESCAPE
) {
111 if (ev
->type
!= ev_keyup
) return true;
116 if (ev
->type
!= ev_keydown
) return true;
117 return w_chat
.Key(*ev
);
121 //==========================================================================
125 //==========================================================================
132 //===========================================================================
136 //===========================================================================
139 T_SetFont(SmallFont
);
140 T_SetAlign(hleft
, vtop
);
141 w_chat
.DrawAt(25, 92, /*CR_UNTRANSLATED*/CR_GREEN
);