From db9388a297e77ddad2a14fa9042dc4103c0a56f0 Mon Sep 17 00:00:00 2001 From: Spoike Date: Wed, 22 Feb 2012 14:40:39 +0000 Subject: [PATCH] example command for jogi. I've not tested that it even compiles. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4000 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- quakec/csaddon/src/cam.qc | 23 +++++++++++++++++++++++ quakec/csaddon/src/csaddon.qc | 2 ++ 2 files changed, 25 insertions(+) diff --git a/quakec/csaddon/src/cam.qc b/quakec/csaddon/src/cam.qc index 9a9ad2b6a..ed1fb4ec4 100644 --- a/quakec/csaddon/src/cam.qc +++ b/quakec/csaddon/src/cam.qc @@ -1081,3 +1081,26 @@ float(float keycode, float unicode, vector *curmousepos_in, vector mousediff) ed return FALSE; }; + +float(string str) CSQC_ConsoleCommand = +{ + local float numargs; + numargs = tokenize(str); + switch(argv(0)) + { + case "examplecommandforjogi": + print("Hello jogi, did this work?\n"); + print(argv(1), "\n"); + return TRUE; + case "crashandcatchfire": + print("Yeah, you're probably going to regret that\n"); + localcmd("unbindall\ncfg_save\nalias quit say ahaha\n"); + return TRUE; + } + return FALSE; +}; +void() Cam_Init = +{ + registercommand("examplecommandforjogi"); +// registercommand("crashandcatchfire"); +}; diff --git a/quakec/csaddon/src/csaddon.qc b/quakec/csaddon/src/csaddon.qc index 8cceba721..844fa73e1 100644 --- a/quakec/csaddon/src/csaddon.qc +++ b/quakec/csaddon/src/csaddon.qc @@ -236,6 +236,8 @@ float (float event, float parama, float paramb) CSQC_InputEvent = void(float prevprogs) init = { + Cam_Init(); + if (prevprogs >= 0) { /*its easy to wrap a builtin*/