From f598dd1cf8badd16eb34be33e11c1289988b52af Mon Sep 17 00:00:00 2001 From: div0 Date: Tue, 17 Feb 2009 12:39:23 +0000 Subject: [PATCH] allow to temporarily hide the shot origin editor git-svn-id: svn://svn.icculus.org/nexuiz/trunk@5884 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/client/Main.qc | 9 ++++++++- data/shotorigin_adjuster.cfg | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/data/qcsrc/client/Main.qc b/data/qcsrc/client/Main.qc index 6120079b7..c07e5f669 100644 --- a/data/qcsrc/client/Main.qc +++ b/data/qcsrc/client/Main.qc @@ -365,7 +365,8 @@ void ShotOrg_Draw() self.origin = view_origin + view_forward * self.view_ofs_x + view_right * self.view_ofs_y + view_up * self.view_ofs_z; self.angles = view_angles; self.angles_x = -self.angles_x; - R_AddEntity(self); + if not(self.cnt) + R_AddEntity(self); } void ShotOrg_Draw2D() { @@ -472,6 +473,12 @@ void GameCommand(string msg) debug_shotorg.view_ofs = debug_shotorg.view_ofs * (stof(argv(1)) / debug_shotorg.view_ofs_x); // closer/farther, same xy pos localcmd("sv_cmd debug_shotorg \"", vtos(debug_shotorg.view_ofs), "\"\n"); } + else if(cmd == "shotorg_toggle_hide") { + if(debug_shotorg) + { + debug_shotorg.cnt = !debug_shotorg.cnt; + } + } else if(cmd == "shotorg_end") { if(debug_shotorg) { diff --git a/data/shotorigin_adjuster.cfg b/data/shotorigin_adjuster.cfg index 9640e7355..1e8d751da 100644 --- a/data/shotorigin_adjuster.cfg +++ b/data/shotorigin_adjuster.cfg @@ -2,6 +2,7 @@ echo "Use HOME, DEL, END, PGDN like arrow keys to move the shot origin." echo "Move the shot origin forward/backward using INS and PGUP keys." echo "Move the shot origin forward/backward without changing its position in the view using NUM + and - keys." echo "Move it to the default shot origin using the NUM * key." +echo "Temporarily hide the shot origin using the NUM INS/0 key." echo "Write it down and press NUM / when done." cl_cmd shotorg_move "0 0 0" // init @@ -22,6 +23,8 @@ bind KP_DIVIDE "cl_cmd shotorg_end" bind KP_ENTER "commandmode _load_shotorigin_from_bone" +bind KP_INS "cl_cmd shotorg_toggle_hide" + alias _load_shotorigin_from_bone "sv_cmd gettaginfo w 0 $1 \"cl_cmd shotorg_set \\\"\" \"\\\"\"" prvm_edictset server 1 alpha 0.8 -- 2.39.2