[REL] In Game Timer v1.3.2 [61450]

Discussion in 'Mod Discussions' started by elitedanzel, October 10, 2013.

  1. elitedanzel

    elitedanzel Active Member

    Messages:
    151
    Likes Received:
    137
    Someone bugged me to make this, and I've been using a phone to do it until now, so enjoy :)

    Adds a timer to the bottom right of your screen that shows how long the game has been going on for.


    Installation
    Install using PAMM

    Usage
    At the start of the game, the timer will say "Sync", once the game has started, click it to sync the game time (This doesn't have to be done straight away, you can get your initial commands queued up first).

    You can also click the timer later in the game to resync it if it drifts (Drifted about 1 second for me in 6 minutes)

    Enjoy :)

    Attached Files:

    Last edited: February 22, 2014
  2. Clopse

    Clopse Post Master General

    Messages:
    2,524
    Likes Received:
    2,859
    Great work. I stand by my nagging. Thanks.
  3. elitedanzel

    elitedanzel Active Member

    Messages:
    151
    Likes Received:
    137
    You mean a mods forum? I haven't seen one, am I blind? :X
  4. Ringworm

    Ringworm Active Member

    Messages:
    245
    Likes Received:
    81
    If you are, there's no point in replying.
  5. Clopse

    Clopse Post Master General

    Messages:
    2,524
    Likes Received:
    2,859
    Lol edited before I seen your replies. Link you sent seemed strange. Ninja raevn for sure. Wonder if elitedanzel knows how to change log too? :p
  6. vipez

    vipez Member

    Messages:
    82
    Likes Received:
    13
    Doesn't the chronocam show you for how long you've been playing?
  7. Clopse

    Clopse Post Master General

    Messages:
    2,524
    Likes Received:
    2,859
    Yeah but you need to click it, and then close it. This can sometimes in its self cause issues with units.
  8. tatsujb

    tatsujb Post Master General

    Messages:
    12,878
    Likes Received:
    5,374
    can the tiler be auto-clicked on start?
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I've modified the mod a bit to do have it automatically start at the beginning of the game:

    Code:
    var syncFunc = function() {
        //console.log('sync');
        clearInterval(syncInterval);
        clearInterval(trySyncInterval);
    
        var startTime = model.currentTimeInSeconds();
        api.time.control();
        //if you set and unset immediately then current time doesn't work, so use a wait for time to change thingy
        var trySyncInterval = setInterval(function() {
            var newTime = model.currentTimeInSeconds();
            if (newTime == startTime) {
                //time hasn't changed, keep waiting...
                //console.log('waiting');
                return;
            }
           
            clearInterval(trySyncInterval);
            api.time.resume();
           
            timeOffset = newTime - (new Date().getTime() / 1000);
           
            //console.log('got it!' + newTime + ' ' + timeOffset);
           
            updateTime();
            syncInterval = setInterval(updateTime, 1000);
        }, 50);
    };
    
    element.click(syncFunc);
    
    var oldAck = model.ackMessage;
    model.ackMessage = function() {
        oldAck();
        syncFunc();
    };
    seems to work fine
  10. elitedanzel

    elitedanzel Active Member

    Messages:
    151
    Likes Received:
    137
    Awesome stuff colin. Will definitely add this in the next update.

    When is ackMessage called?
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    It's the function bound to the "Start Annihilation" button. I found it by searching for Start Annihilation in the live_game.html and looking at it's knockout bindings.
  12. elitedanzel

    elitedanzel Active Member

    Messages:
    151
    Likes Received:
    137

    Attached Files:

  13. Quitch

    Quitch Post Master General

    Messages:
    5,238
    Likes Received:
    5,977
    I updated to 1.1 but I still have to manually sync.
  14. elitedanzel

    elitedanzel Active Member

    Messages:
    151
    Likes Received:
    137
    Updated to 1.2 which fixes auto sync again, thanks to @cola_colin ! :)
    zaphodx, stormingkiwi and Quitch like this.
  15. xronize

    xronize New Member

    Messages:
    7
    Likes Received:
    4
    Made a video:

  16. wondible

    wondible Post Master General

    Messages:
    3,279
    Likes Received:
    2,084
    Covers up the PIP button in 61450.
  17. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Press v to open the pip.
  18. wondible

    wondible Post Master General

    Messages:
    3,279
    Likes Received:
    2,084
    Yeah, I still need to update all my keybindings.
  19. mishtakashi

    mishtakashi Active Member

    Messages:
    369
    Likes Received:
    217
    This tripped me up also, the new uber keybinds need to be worked around a bit or removed

    Edit: using hotkeys is a good enough workaround for me
    Last edited: February 22, 2014
  20. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    248
    A workaround is to add z-index: -1; to the CSS file for #in_game_timer. That will show under the PIP button. Even better would be to also move it a dozen pixels up.

Share This Page