Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-10-2007, 06:57 PM
middo middo is offline
VHE Monkey
middo's Avatar
Join Date: Aug 2002
Location: California
Posts: 327
middo is on a distinguished road
Send a message via AIM to middo
A Simple Download Dialog

Something I whipped up real quickly. It works.

It sits discretely in the bottom left corner. Takes up little space.

PHP Code:
//#CLIENTSIDE

function onCreated()
{
  new 
GuiBitmapBorderCtrl("progressWin") {
    
useownprofile true;
    
profile.bitmap "defalutborder.png"/* I have a own profile here since my server uses it's own images for the GUIS. I made it the default for here*/
    
profile.transparency=.8;
    
width 160;
    
height 100;
    
canmove=false;
    
canresize=false;
    
visible false;
    
10;
    
screenheight-height-40;
    
thiso.textFields={"filename","progress"};
    
thiso.textPos={20,45};

    new 
GuiProgressCtrl("fileProgress") {
      
profile GuiBlueProgressProfile;
      
10;
      
45;
      
width 140;
      
height 24;
      
progress 0;
      
layer=5;
    }    
    
    for (
;thiso.textFields.size();i++) //generate
    
{
      new 
GuiTextCtrl("text_"@thiso.textFields[i]) {
        
useownprofile=true;
        
profile.fontcolor={0,0,0};
        
profile.fontcolorhl={0,0,0};        
        
profile.fontsize=16;
        
profile.align="center";
        
profile.justify="center";
        
justify "center";
        
align "center";

        
width140;
        
height=20;
        
x=5;        
        
y=thiso.textPos[i];
        
text thiso.textFields[i];
        
layer=6;
      }
    }
  } 
}

function 
onTimeout()
{
  if (
downloadsize 1600
  {
    
progressWin.show();
    
text_filename.text   downloadfile;
    
text_progress.text   int((downloadpos/downloadsize)*100)@"%";
    
text_progress.bringtofront();
    
fileProgress.progress=(downloadpos/downloadsize); 
  } else {
  
progressWin.hide();
  }
}

setTimer(.05); 

Last edited by middo; 04-10-2007 at 07:12 PM..
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:11 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.