Перейти к контенту

[CoP] Ковыряемся в файлах


Halford

Рекомендуемые сообщения

Wookie, в моде подсветки сетки Винтаря автор отлавливал нажатие клавиши так(оригинальный код):

 tabpress = false
zoom = false
prefov = 55
cl = true

function new_crosshair()    
  local as = device().fov
  if as < prefov-2 then zoom = true end
  if as > prefov+2 then zoom = false end
  prefov = as
  local hud = get_hud()  
  local active_item = db.actor:active_item() 

  if (zoom) and (active_item) and (active_item:section() == "wpn_vintorez") then     
    if hud:GetCustomStatic("main_task") then
      hud:RemoveCustomStatic("main_task")
      tabpress = true
    else tabpress = false end
    if hud:GetCustomStatic("secondary_task") then hud:RemoveCustomStatic("secondary_task") end
    if tabpress then if cl then cl = false else cl = true end end

    if hud:GetCustomStatic("pso-1-1") == nil and cl then
      hud:AddCustomStatic("pso-1-1", true)
      if hud:GetCustomStatic("pso-1-1_light") then hud:RemoveCustomStatic("pso-1-1_light") end    
    end        
    if hud:GetCustomStatic("pso-1-1_light") == nil and cl == false then
      hud:AddCustomStatic("pso-1-1_light", true)
      if hud:GetCustomStatic("pso-1-1") then hud:RemoveCustomStatic("pso-1-1") end  
    end                  
  end

  if zoom == false then                 
    if hud:GetCustomStatic("pso-1-1") then hud:RemoveCustomStatic("pso-1-1") end  
    if hud:GetCustomStatic("pso-1-1_light") then hud:RemoveCustomStatic("pso-1-1_light") end                        
  end
end

 

Изменено пользователем dragunof

  ▲

▲ ▲

Поделиться этим сообщением


Ссылка на сообщение
  • Недавно просматривали   0 пользователей

    • Ни один зарегистрированный пользователь не просматривает эту страницу.
×
×
  • Создать...