[REL] Floating Framework v1.2.1 [58197]

Discussion in 'Released Mods' started by Raevn, December 9, 2013.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    If you are going to go the one big scene route - which Uber blames for most of the earlier input lag complaints - then I've seen other mods using the social bar, which is full screen but rarely updated.

    Would it be sufficient to work out how to make a panel draggable? It's probably possible, I just haven't investigated it yet.
  2. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Well I need a panel that is only active during the live game scene so I don't think the social panel would work. I could at least look at it's code though so thanks. I'll play around with it and see how the performance ends up working.

    As far as a draggable panel goes I'm not sure how possible it is since you'd have to load another mod's code into a panel created on demand.
  3. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Happiness incoming!
    upload_2014-10-14_23-35-45.png

    Also, @raevn
    Could I have your permission to update this mod on PAMM once it's all fixed up?
    proeleert likes this.
  4. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Ok, so good news and bad news. First the good. As seen above I now have floating frames working perfectly fine in live_game by using a custom panel created in live_game. (Thanks a ton @wondible! Your guide and donation panel mod made this a ton more doable.)

    Now for the bad. In order for all this to work mods must now run their live_game code under my LiveGame_FloatZone which isn't really an accepted scene. So now I need either:
    1. A way for "LiveGame_FloatZone" to be recognized properly in mod's modinfo.json file so the js files in it can be run that way.
    2. A way to parse PAMM's mods_list.json and then pull out and run the js files listed in "LiveGame_FloatZone" items manually.
    I can figure out some code to do #2 given enough time but again any tips/shortcuts would be greatly appreciated! Thankfully it looks like I'll have some time tomorrow so hopefully I'll have it fixed by then.
  5. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    It should be just another scene? Assuming you have mod-loading code in your new scene, of course.
  6. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Exactly, just add this
    Code:
      // inject per scene mods
      if (scene_mod_list['ilikekittens'])
        loadMods(scene_mod_list['ilikekittens']);
    just before the registerWithCoherent thing:
    Code:
      // setup send/recv messages and signals
      app.registerWithCoherent(model, handlers);
    That will make a new scene called "ilikekittens".

    I use it to fix the bug where the gamestats.html isn't moddable because SOMEBODY (*cough* Uber *cough*), forgot to put it in gamestats.js.
  7. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    That sounds wonderful except I don't have a registerWithCoherent call. I think I know where to put it though once I have a few minutes I'll give it a try.
  8. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    For some reason
    Code:
    scene_mod_list['LiveGame_FloatZone']
    isn't turning up anything even though I have
    Code:
    "LiveGame_FloatZone": [
        "coui://ui/mods/rFloatFrame/test.js"
    ],
    in my modinfo.json. Any guesses?
    Last edited: October 15, 2014
  9. DeathByDenim

    DeathByDenim Post Master General

    Messages:
    4,328
    Likes Received:
    2,125
    Did you put that inside the "scenes": {} or did you use the old way of just plunking it in the root? You can check <PA Mod Dir>/PAMM/ui/mods/PAMM/ui/mods/ui_mod_list.js to see if it shows up there.
  10. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    OH! THAT'S WHY IT'S NOT SHOWING UP IN THERE!!!!! ok, let me try this real quick.
  11. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Sweet! Everything works fine now so once I've done a little more testing this should be good to go.

    The only remaining question is whether or not @raevn is ok with me updating this mod.

    Also, could you (raevn) edit the OP to match v1.3, build 72996, and these changes to the instructions?
    Add a part saying that all floating frames for live game must be added through the "LiveGame_FloatZone" scene like so:
    Code:
    "scenes": {
            "LiveGame_FloatZone": [
                "coui://ui/mods/PathToMod/code.js"
            ]
    }
    And then remove the settings notes since that isn't an option anymore.​
    Last edited: October 15, 2014
    proeleert likes this.
  12. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Well it turns out that I missed something in my testing before. My panel isn't click-throughable so it stops all unit commands. :eek: I'm looking for a solution but it doesn't look good. I may have to end up creating draggable panels on demand which would be a pain and probably not work to well for performance.

    Edit - display: flex and ignoreMouse seem to be doing the trick. Hopefully my final tests won't find anymore problems....
    Last edited: October 15, 2014
    proeleert likes this.
  13. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    ok, I think everything's working fine now. I probably will need some way to read and write values across panels though since my custom panel doesn't have access to most of the stuff in live_game. I've uploaded the zip of what I have currently in case anyone wants to play with it or test it out.

    @raevn don't publish this yet. I'd like to look into a thing or two on it and make sure that my float frame mods work fine with it first.

    Attached Files:

    proeleert likes this.
  14. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    Cool sending messages across panels isn't that hard.
    If this is released I'll revive hotbuild preview window again.
    Thanks for fixing this up !
  15. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Sure thing. It was mostly selfish though since two of my mods need this framework fixed. Could you post an example on how to do that? In order to make sure this is working perfectly I'm going to build an update for Commander HUD using it, and in order to do that I need a way to get the HP values over to my panel. Plus it would probably be helpful to have in the OP.
  16. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Mod in live_game; only live_game has api.panels.NAME because it's the parent panel. I'm just sending a single value here, but the payload is often a literal object {}

    Code:
          api.panels.missile_command.message('missile_command_attacked', selected)
    
    In my panel:

    Code:
      handlers.missile_command_attacked = function(selected) {
        registry.unready(selected)
        nextAttacker()
      }
    
    Panel back to live_game.

    Code:
          api.Panel.message(api.Panel.parentId, 'missile_command_hello');
    
    I'm using 'hello' to tell the parent that the panel has fully loaded and is ready to receive it's initial state message. This might be peculiar to MC because I don't create the panel until it's needed.
    LavaSnake likes this.
  17. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Thanks!
  18. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    I'm still working on this. Hopefully I'll get everything debugged and ready to go soon.
  19. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    edit, never mind - back to debugging
  20. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    in your own scene?

    var handlers = {};

Share This Page