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.
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.
Happiness incoming! Also, @raevn Could I have your permission to update this mod on PAMM once it's all fixed up?
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: 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. 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.
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.
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.
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?
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.
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.
Well it turns out that I missed something in my testing before. My panel isn't click-throughable so it stops all unit commands. 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....
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.
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 !
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.
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.