Jump to content

Feature request: Use the position of Viewports.Center to calculate the default position of viewport(Kneeboard, controller indicator)


Fsea

Recommended Posts

In current version 2.6, the default position of kneeboard, controller indicator and crew status is calculate by LockOn_Options.screen.width & LockOn_Option.screen.height.

//DCS World OpenBeta\Scripts\Aircrafts\_Common\Cockpit\ViewportHandling.lua

function update_screenspace_diplacement(aspect,is_left,zoom_value)
    local w = LockOn_Options.screen.width;
    local h = LockOn_Options.screen.height;
    
    if LockOn_Options.screen.oculus_rift then 
        local ui_x,ui_y,ui_w,ui_h = get_UIMainView()
        w = ui_w;
        h = ui_h;
    end 

    local x0 = 0
    local w0 = 0.5 * h
    
    local aspect     =     aspect or 1
    local zoom_value = zoom_value or 0
    local default_width  = w0 + (64 * zoom_value)

    if default_width > h then
       default_width = h
    end
    
    if default_width > 0.5 * w then
       default_width = 0.5 * w
    end
        
    local default_height = default_width / aspect
    local default_y      = h - default_height
    local default_x      = w - default_width - x0
    if  is_left then
        default_x   = x0
    end
    dedicated_viewport        = {default_x,default_y,default_width,default_height}
    dedicated_viewport_arcade = {default_x, 0       ,default_width,default_height}
end

If I use multiple monitors to display MDF and main screen(Viewports.center) , the view port of kneeboard, controller indicator, crew status may not be displayed properly.  For example, when I  use Helios, the kneeboard and crew status( UH-1H) will be displayed on the second screen and blocked by the Helios panel.

 

 


Edited by Fsea
Link to comment
Share on other sites

  • Fsea changed the title to Feature request: Use the position of Viewports.Center to calculate the default position of viewport(Kneeboard, controller indicator)
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...