Working on responsive miniwindows

Posted by Tamon on Wed 29 May 2019 03:21 AM — 9 posts, 29,636 views.

#0
It's still very experimental but figured i'd put it out there for anyone interested in some functionality like this.


https://github.com/thesmallbang/SimpleWindow
USA Global Moderator #1
It looks interesting. I hope you keep posting as you make progress.
USA Global Moderator #2
It's not quite clear to me though what a View is from the readme. Could you explain the concepts a bit? Also, are you thinking that a user should rewrite their output on every tick? That seems quite inefficient.
#3
Hi fiendish.

Everything so far came from another plugin I am working on. That plugin has different "views" such as session data, area data, fight stats etc. A view is essentially multiple windows stuffed in 1 where only 1 is displayed at a time and the user can switch between them. I may help to just think of them as tabs atm without a ui.

Currently i dont have the method in place to switch views unless you manually set the window__state.viewIndex via code.

As far as drawing on tick. The tick can be increased or decreased depending on your needs. I am currently thinking of friendly ways to invalidate the content cache and potentially redraw only when underlying data changes but I'm still on day 2-3 with this idea atm.

The overall goal right now is to provide something lesser but similar in functionality to a lot of the responsive css frameworks.
Amended on Wed 29 May 2019 04:40 PM by Tamon
USA Global Moderator #4
Quote:
I am currently thinking of friendly ways to invalidate the content cache and potentially redraw only when underlying data changes

I do something like this via my repaint buffering plugin, where calls to my plugin are like indicating a data change.

description at: https://github.com/fiendish/aardwolfclientpackage/wiki/Repaint-Buffer
plugin code at: https://github.com/fiendish/aardwolfclientpackage/blob/MUSHclient/MUSHclient/worlds/plugins/aard_repaint_buffer.xml
Amended on Wed 29 May 2019 07:07 PM by Fiendish
#5
Ah understood. Yes, to invalidate the entire cache this would be fairly straight forward but what i'm looking to do is add support on a per content basis.


(I'm only like a month into lua so please excuse the terminoligy atm.)

What I was thinking is to add callback on the content and then iterating the content to see if it changes since the last update.

Today: (Would keep existing)
AddContent {
Text = "Hello"
}

Idea: (support cache invalidating)
AddContent {
GetText = function()
return someref.value
end
}

Idea is just to store the GetText result on each content object when creating the content cache and then do a comparison and look for changes before repainting. I haven't done any benchmarks etc but i'd assume the saving on the repaint would more than make up for the need to compare the content.

thoughts? I really appreciate your feedback.
USA Global Moderator #6
That sounds like a neat idea. I think everyone would still benefit from globally coalescing repaint requests in the way that my plugin does. Honestly, Repaint should just do what my plugin does automatically, but until then we have the plugin.

One of the biggest real-world performance problems I've encountered comes from having multiple plugins nearly simultaneously wanting to refresh the display because they're all triggering on the same lines of text from the MUD. In those moments, you really don't want to allow Repaint to be called rapid fire because with enough plugins all calling it, it can very noticably slow down the client. And just using Redraw isn't a great option, because it drops frames and that leads to a worse user experience.
Amended on Wed 29 May 2019 11:08 PM by Fiendish
#7
Made some decent progress over the weekend.

Implemented css style classes and added a sample plugin now for anyone that wants to try it out.
USA Global Moderator #8
I like the new sample images.