[WIP] Dual View

Discussion in 'Mod Discussions' started by Corang, February 22, 2014.

  1. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I am planning to update alerts manager to use its own pip for notifications. That way I can have it appear close to the mouse instead of wherever the other pip is.
  2. Corang

    Corang Well-Known Member

    Messages:
    772
    Likes Received:
    313
    okay, also I noticed an interesting bug, if you have no holodeck with the primary class generating planets does not go away.
  3. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Yeah, it's very tricky to get this all to work. You can use my mod as a starting point to get it working for you. I use a variation on cola_colin's autoit script to get it to go dual screen.

    cDualScreen.js
    Removes the extra holodeck and hack holodeck from the pip list
    Code:
    (function() {
        model.pips = [ model.pips[0] ];
    })();
    
    live_game.html
    Code:
    <holodeck class="primary"></holodeck>
    <holodeck class="pip" data-bind="visible: showPips" style="display:none"></holodeck>
    <div><holodeck class="pip2"></holodeck></div>
    <div><holodeck class="pip2"></holodeck></div>
    
    live_game.css
    Code:
    holodeck.primary{
        z-index: -2;
        width: 1680px;
        left: 1400px;
    }
    
    holodeck.pip2{
        position:absolute;
        left: 0;
        top: 0px;
        width: 1400px;
        height: 1050px;
        z-index: -1;
    }
    
    My css could live in its own file and I could be doing this in cDualScreen.js so I don't have to shadow any files.

    Code:
    $(".pip").after("<div><holodeck class=\"pip2\"></holodeck></div><div><holodeck class=\"pip2\"></holodeck></div>");
    
    *Edit*
    That change didn't work. Looks like holodecks can't be added through mods like that.

    Attached Files:

    Last edited: February 22, 2014
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    You need to add holodecks before live_game.js is executed. I am doing it in a global file now.
    Also something about your setup there is still borked. My 3 screen setup had 4 holodecks as well and worked.
    One less hack holodeck.
  5. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    It's three full holodecks and a pip. Your three-screen version didn't keep the pip, right? I thought you just stretched it over a whole screen.
  6. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    A okay.
    Yeah I just realized I got away like I did because I had the main holodeck strech all 3 screens. The planet/ui ended up in the middle, with 2 screens that cant work as good.
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    So I build this so far: https://github.com/pamods/ui-mod-nScreens
    It allows to configure multiple views and the UI location in a pretty simple manner.
    Tests succeeded with dual and triple screen:



    There may be some hidden quirks though and there may be some UI elements that are evil and use a fixed position.

    Oh and it does fix all important menu UI as well.
    cptconundrum likes this.
  8. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    This works amazingly well on my system! I'm going to look through it a little and see if I can get rid of some of the hacks. If I want to do two screens and a pip, it uses 5 holodecks. I had dual screen working with just 4 holodecks before, so I know it can be done. I'm also going to see if I can get it working with the draggable pip, but that will probably mean making a few changes to both mods.

    *Edit*
    That was easy! this does it with 4 holodecks instead of 5.
    Code:
    // dualscreen
        main: "top: 0px; left: 1400px; width: 1680px; height: 1050px;",// make sure to end in ;
        mainHolodeck: "top: 0px; left: 0px; margin-left: 1400px; width: 1680px; height: 1050px;",// make sure to end in ;
    
        views: [
            "top: 200px; right: 200px; width: 300px; height: 300px;",
            "top: 0px; left: 0px; width: 1400px; height: 1050px;",
            "top: 0px; left: 0px; width: 1400px; height: 1050px;"
        ],
            // index of views // if a view is not correctly showing try to add it's index here
            // this is expensive fps wise. Try to make it so the main holodeck is big enough to cover for one of the views
            hackForIndex: [],
            pipIndex: 0,
    
    I need to work on using pipIndex to set the id to "pip" and data-bind it to model.showPips()
    Last edited: February 23, 2014
  9. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    It's working great with draggable pip now (as long as the draggable pip stays over the primary holodeck, which is fine). I am still getting a ui problem with the build bar though. I know it was fine for you, so could this be related to my primary being on the right screen instead of the left?

    buildbar.jpg

    *Edit*
    It's my Draggable pip mod! OH NO!
    Yours actually works great.
    Last edited: February 23, 2014

Share This Page