Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 04-10-2007, 09:20 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Simple and neat, good job.
Reply With Quote
  #3  
Old 04-11-2007, 01:16 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Very nice, but what's the point of this rather than a GUPD? Or would this show anything downloaded?
__________________
Reply With Quote
  #4  
Old 04-11-2007, 02:43 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
This will popup for anything that is currently being downloaded I believe
Reply With Quote
  #5  
Old 04-11-2007, 02:47 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
I don't think you need a check for the filesize... I tried out the download variables and they won't even set for small files.
Reply With Quote
  #6  
Old 04-11-2007, 02:54 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
It only shows up for large files like when you press [F2] and it says 'Downloading Big File'
Reply With Quote
  #7  
Old 04-11-2007, 05:09 AM
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
Things above 1600 are shown I believe.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:02 PM.


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