Menu Icons

Does anyone know why menu icons take so long to load when using the URL type? They will load when grabbed from a URL, but it takes forever. I am also having issues with loading an icon from a file, it only shows the black/purple image (The same one that is displayed on a map when it is waiting to render) when attempting from a local path.

JavaScript:
                String path = button_data.getString("icon");
                File image = new File(this.getDataFolder().getPath()+"/"+path);
                String type = ElementButtonImageData.IMAGE_DATA_TYPE_URL;

                if(image.exists()){
                    type =  ElementButtonImageData.IMAGE_DATA_TYPE_PATH;
                    path = image.getPath();
                }

                button.addImage(new ElementButtonImageData(type, path));
                button.setText(button_data.getString("text"));
I have noticed if I reload the server while the menu is open, the icons served from my back end server will be displayed instantly. The same happens if I run
JavaScript:
player.showFormWindow(menu);
twice, it will obviously show 2 menus on top of each other. The first will still be loading the icons but if I close that one, the second will already have them loaded. I have tried all different size images from 10px to 500px along with loading icons from other sources than just my back end server. Any ideas?
 
Last edited:
Top