Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-13-2010, 07:39 PM
Schetti Schetti is offline
SC2 Player
Schetti's Avatar
Join Date: Nov 2008
Location: Austria
Posts: 269
Schetti is on a distinguished road
Freezing when shown

I've got the following problem:
When I for example do this script
HTML Code:
//#CLIENTSIDE
function onWeaponFired() {
this.on = !this.on;
if (this.on) {
  new GuiWindowCtrl("Test") {
    profile = GuiBlueWindowProfile;
    clientrelative = true;
    clientextent = "320,240";

    canmove = true;
    canresize = true;
    closequery = false;
    destroyonhide = false;
    text = "Window 1";
    x = 666;
    y = 351;

  }
 }elseif ( !this.on) {
Test.destroy();
 }
}
And press D, the window will shop up, yea all ok, BUT I can't hit D again without klicking onto the screen before, else it wont destroy the window, I hope you know what I mean.
What I want to have, is that I can hit D again and again without having to klick onto the screen before.

Im sorry for this circumbendibus.
__________________
“Peace cannot be kept by force. It can only be achieved by understanding.” – Albert Einstein
Reply With Quote
  #2  
Old 01-13-2010, 07:51 PM
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
The window is stealing focus.

This might be of interest:
http://forums.graalonline.com/forums...96&postcount=9
Reply With Quote
  #3  
Old 01-13-2010, 09:32 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
You should be creating the GUI, then just toggling it's visibility like so:

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
  
showGUI();
}

function 
showGUI() {
  
// Check if the Window has been made.
  
if (isObject("Test")) {
    
// Toggle Visibility
    
Test.visible = !Test.visible;
    
// Exit Script
    
return;
  }
  
// Create GUI
  
new GuiWindowCtrl("Test") {
    
profile GuiBlueWindowProfile;
    
clientrelative true;
    
clientextent "320,240";

    
canmove true;
    
canresize true;
    
closequery false;
    
destroyonhide false;
    
text "Window 1";
    
666;
    
351;
  }
  
// Sets Focus to Graal
  
GraalControl.makefirstresponder(true);

__________________
Quote:
Reply With Quote
Reply


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


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