Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
Sign in to follow this  
Golgofinyanin

Включение/отключение кастомного дебаг монитора по клавише

 

Как реализовать включение/отключение кастомного дебаг монитора по клавише?

 

Побывал код ниже, не заработал.

fnc_debug = 
{
	while {debugMonitor} do
	{
		hintSilent parseText format ["<t size='0.95' font='Bitstream' align='left' >Debug Monitor Goes Here</t>"];
	};
};

fnc_debugTog = 
{
	if (isNil 'debugMonitor') then 
	{
		debugMonitor = true;
		[] spawn fnc_debug;
	}
	else
	{
		debugMonitor = !debugMonitor;
		hintSilent '';
		[] spawn fnc_debug;
	};
};

keyDownEvent = 
{
	_key = _this select 1;
	if (_key == 0xCF) then {[] spawn fnc_debugTog;};//0xCF is the END key go here for a list of key codes http://community.bistudio.com/wiki/DIK_KeyCodes
};
(findDisplay 46) displayAddEventHandler ['KeyUp','_this call keyDownEvent'];

 

 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

 if (isNil 'debugMonitor') then

   {

       debugMonitor = false;

   };

 

fnc_debugTog =

{

    if ('debugMonitor') then

     {

        debugMonitor = false;

        hintSilent '';

     }

    else

     {

        debugMonitor = true;

     };

};

 

VK_END = (findDisplay 46) displayAddEventHandler ["KeyUp","if ((_this select 1) == 0xCF) then {call fnc_debugTog;};"];

 

while {debugMonitor} do

  {

     hintSilent parseText format ["<t size='0.95' font='Bitstream' align='left' >Debug Monitor Goes Here</t>"];

     sleep 1;

   };

 

Share this post


Link to post
Share on other sites



  • 0

Ты проверь,  - у тебя хоть событие то вешается на кнопку. Хотя бы так -

 

VK_END = (findDisplay 46) displayAddEventHandler ["KeyUp","if ((_this select 1) == 0xCF) then

{

titleText ["Нажатие кнопки END.","PLAIN DOWN"]; titleFadeOut 8;

};"];

Share this post


Link to post
Share on other sites
  • 0
 

Решил вопрос так.

 

в кастом compiles.cqf

 

//dayz_spaceInterrupt =            compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\dayz_spaceInterrupt.sqf";
    dayz_spaceInterrupt     = compile preprocessFileLineNumbers "custom\dayz_spaceInterrupt.sqf";

 

В dayz_spaceInterrupt.sqf Заменяем

 

 

if (_dikCode == 210) then {
        _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};

 

На 

 

if (_dikCode == 210) then {
    if (isNil 'debugMonitor') then
    {
        debugMonitor = true;
        _nill = execvm "custom\debug.sqf";
    }
    else
    {
        debugMonitor = !debugMonitor;
        hintSilent '';
        _nill = execvm "custom\debug.sqf";
    };
};

if (_dikCode == 210) then {
    if (isNil 'debugMonitor') then
    {
        debugMonitor = true;
        _nill = execvm "custom\debug.sqf";
    }
    else
    {
        debugMonitor = !debugMonitor;
        hintSilent '';
        _nill = execvm "custom\debug.sqf";
    };
};

 

Удаляем 

 

 

if (_dikCode in actionKeys "User20" and (diag_tickTime - dayz_lastCheckBit > 5)) then {
    dayz_lastCheckBit = diag_tickTime;
    _nill = execvm "\z\addons\dayz_code\actions\playerstats.sqf";
};

 

В фаел debug.sqf

 

 

while {debugMonitor} do
{
//Тут вставляем код дебаг монитора.
    sleep 1;
};

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you automaticly agree to our Guidelines and Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.