ID:115615
 
Resolved
Images displayed in grids would sometimes not show until a full repaint, and would not trigger the grid to resize its columns and rows, if they came from a dynamic icon operation.
BYOND Version:487
Operating System:Windows 7 Pro 64-bit
Web Browser:Firefox 5.0
Applies to:Dream Seeker
Status: Resolved (488)

This issue has been resolved.
Descriptive Problem Summary:
If the game is hosted in Dream Daemon, and you send an icon that has been saved via fcopy_rsc to a grid using the output proc, then the icon doesn't appear right away.
Here is a sample project that recreates the bug.

Numbered Steps to Reproduce Problem:
1. Save icons for easy access using fcopy_rsc.
2. Make an image in a grid, using the <img> tag in html.
3. Make the src of the image be a \ref[] of the return value of a call to fcopy_rsc.
4. (Use output to send the image to the current-cell.)
If this instance of fcopy_rsc hasn't been downloaded previously, the grid cell will appear blank.
If you minimize the window of the grid, or call output again, the bug is fixed.
Clearing the BYOND Cache will cause it to reoccur.

Code Snippet (if applicable) to Reproduce Problem:
//This is all in the sample project
//The bug occurs with variables 'icon2' and 'icon3'
client
var
icon1 = 'icon.dmi'
icon2
icon3
verb
LoadGrid()
if (!icon3)
icon3 = fcopy_rsc(icon('icon.dmi', "b"))

winset(src, "gridwindow.grid", "current-cell=1,1")
src << output("<img src=\ref[icon1]>", "gridwindow.grid")

winset(src, "gridwindow.grid", "current-cell=2,1")
src << output("<img src=\ref[icon2]>", "gridwindow.grid")

winset(src, "gridwindow.grid", "current-cell=3,1")
src << output("<img src=\ref[icon3]>", "gridwindow.grid")

winset(src, "gridwindow.grid", "current-cell=4,1")
src << output("<img src=\ref['icon.dmi'] iconstate=c>", "gridwindow.grid")

New()
icon2 = fcopy_rsc(icon('icon.dmi', "a"))
return ..()


Expected Results:
The icon shows in the grid immediately after being sent the first time.

Actual Results:
It is blank to start with.

Does the problem occur:
Every time? Or how often? Every time the BYOND cache is cleared
In other games? Yes, this occurs in my other game
In other user accounts? Haven't tested
On other computers? Haven't tested

When does the problem NOT occur?
When it has already occurred once. Sometimes the bug occurs until you close Dream Seeker and log back in. That doesn't happen in the sample project. I assume because the resources are so small.

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? I believe it has existed since the advent of grids. I've certainly noticed it years ago.

Workarounds:
Maybe re-updating the cell with some sort of delay.
Also, minimizing and restoring the window with the grid.
I still have a similar problem when hosting with Linux. (Version 488)
However, a simple update or repaint of the grid doesn't fix it. You have to close Dream Seeker and rejoin the server for all of the images to appear. (It happens when there could be around 30 images loaded into the grid.)
Some of the images still appear, but not all of them.
I'm not sure if I can create a sample project.
Usually anything you see going on with the grid would be a client issue; the server can't be ruled out but we'd need more information to go on, and it should be a separate report because the issue you posted here is definitely fixed.