Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   showimg on top of gui window (https://forums.graalonline.com/forums/showthread.php?t=134265626)

Pelikano 01-26-2012 12:02 AM

Quote:

Originally Posted by Pelikano (Post 1682684)
Controls are only added to GraalControl by default if you do:

PHP Code:

  new GuiShowImgCtrl("SomeImg") {
    
50;
    
50;
    
width 71;
    
height 96;
    
image "era_sam_hiddencard.png";
    
visible true;
  } 

But, if you do it like the OP and create a GuiShowImgCtrl object first, then set it's attributes you have to add it to GraalControl manually:

PHP Code:

  temp.guiImage = new GuiShowImgCtrl("SomeImg");
  
guiImage.50;
  
guiImage.50;
  
guiImage.width 71;
  
guiImage.height 96;
  
guiImage.image "era_sam_hiddencard.png";
  
guiImage.visible true;
  
// Will not show! 


nothing at all, same thing

Crow 01-26-2012 12:12 AM

Quote:

Originally Posted by Pelikano (Post 1682702)
Oh yeah you are NOT setting a variable to the object, which means your code is the same thing as:

That doesn't matter at all. Creating the control returns an object reference. Whether I use that directly or store it in a variable first doesn't matter. The outcome will be the same.


Quote:

Originally Posted by Pelikano (Post 1682702)
It's just sad how ignorant some people can be and instead of apologizing for claiming people have no idea they won't admit that for once it's them doing something wrong lol

You're trying too hard.

Pelikano 01-26-2012 12:24 AM

Quote:

Originally Posted by Crow (Post 1682710)
That doesn't matter at all. Creating the control returns an object reference. Whether I use that directly or store it in a variable first doesn't matter. The outcome will be the same.




You're trying too hard.

The outcome is obviously the same, because several people have now tried it and the output wasn't the same.

But I'm sure with your uber skills you're never wrong.

Crow 01-26-2012 12:30 AM

Quote:

Originally Posted by Pelikano (Post 1682711)
The outcome is obviously the same, because several people have now tried it and the output wasn't the same.

But I'm sure with your uber skills you're never wrong.

The conversation ends here because of several reasons:
  • I don't even know what you're talking about anymore because you don't make much sense at all. You're just blabbering about some "outcome" without saying what you're referring to right now.
  • You're arguing like a child.
  • I really don't care.

I don't gain anything from doing this, either. I tried both ways, and either works for me. You say they don't. Now what? Seriously, what's the matter with this bull****? It's up to the coders to decide how to write their code. Whatever works. If this doesn't for you, that's cool with me.

Pelikano 01-26-2012 01:57 AM

Quote:

Originally Posted by Crow (Post 1682712)
The conversation ends here because of several reasons:
  • I don't even know what you're talking about anymore because you don't make much sense at all. You're just blabbering about some "outcome" without saying what you're referring to right now.
  • You're arguing like a child.
  • I really don't care.

I don't gain anything from doing this, either. I tried both ways, and either works for me. You say they don't. Now what? Seriously, what's the matter with this bull****? It's up to the coders to decide how to write their code. Whatever works. If this doesn't for you, that's cool with me.

you should reread the thread, try both variants supplied by me and you will see that both don't work

you are just very arrogant and ignorant to an extend that you can't see the fact of you not being right

but ok I'm obviously the child "who doesn't know jack about what he's talking about", I agree with ending the conversation here

sssssssssss 01-26-2012 05:55 AM

Alright, so I'm using:
PHP Code:

new GuiShowImgCtrl("Arm_Inventory_IconBox_" temp.v) { 
          
new_x_position
          
new_y_position 10
          
image "armageddon_inventory-iconbox.gif";
          
mode 1;
          new 
GuiShowImgCtrl("Arm_Inventory_Icon_" temp.v) { 
            
image search_list[temp.v].image
            
0// Since it's a child of 'IconBox' it's x/y will be relative. 
            
22// It should also draw above the icon box as well. 
            
mode 1;
          } 
      } 

but anything like this will not make it go away later in a different function. :(
And yes, I know I don't need 99999.
PHP Code:

for (v=0;v<99999;v++) {
    
Arm_Inventory_IconBox_(@temp.v).hide();
    
Arm_Inventory_Icon_(@temp.v).hide();


PHP Code:

for (v=0;v<99999;v++) {
    
"Arm_Inventory_IconBox_"(@temp.v).hide();
    
"Arm_Inventory_Icon_"(@temp.v).hide();


PHP Code:

for (v=0;v<99999;v++) {
    (
"Arm_Inventory_IconBox_"@temp.v).hide();
    (
"Arm_Inventory_Icon_"@temp.v).hide();


destroy() is what I really want, but it doesn't work either in a diff funciton.

Also tried doing it OP way with addcontrol, and setting them as this commands to call destroy later, but also didnt work.

PHP Code:

for (v=0;v<player.weapons.size();v++) {
    
this.("weapon"@temp.v).clearControls();
    
this.("shadow"@temp.v).clearControls();


I tried destroy and hide as well. Was just hoping with clearControls.

P.S.
The way I was doing it in my OP, I did have to add addcontrol for it to work like that. After adding that, it showed up fine. I just changed it to this way thinking it would be easier to make it disappear in a different function. :/

fowlplay4 01-26-2012 06:14 AM

Put it in a GUIControl. I.e:

PHP Code:

new GuiControl("Arm_Inventory") { // Assuming it's your inventory...
  
0;
  
0;
  
width 200// You'll probably have to adjust this to fit your GUI...
  
height 200;
  
// pay attention to the use of thiso
  
for (temp.thiso.selected_num2temp.thiso.selected_num2 91temp.++) { 
    
//new GuiShowImgCtrl(); stuff
  
}


Then you can do: Arm_Inventory.clearcontrols();

To destroy all the controls or just hide().

I'm not sure what your original script's purpose is but I feel like it's getting really complicated when it doesn't need to be.

sssssssssss 01-26-2012 06:16 AM

It's just a stupid inventory with tabs in a gui, I think I am making it much worse as well. :/ All on my own though and this is the only way I could think to do it. :x

sssssssssss 01-26-2012 06:18 AM

LOLOLOLOLOLOLOLOLOLOLOLOL

Instead of GraalControl.addcontrol(), it needed windowname.addcontrol() HAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaa thanks guys. Man I'm dense when I'm tired.

fowlplay4 01-26-2012 06:23 AM

Quote:

Originally Posted by sssssssssss (Post 1682751)
it needed windowname.addcontrol()

Your snippets didn't indicate there was a 'windowname' object!

For future threads please provide more information about your problem. I.e: Purpose of the code, a general idea of what it does (or is supposed to do).

sssssssssss 01-26-2012 06:27 AM

I'm sorry. I do still have the issue of trying to edit the zoom or hint using it as a temp.var holding the object and addcontrol to parent window. It's just not doing it which is odd because setting the x,y,image,ect initially works fine.

PHP Code:

("weapon"@temp.v).hint temp.tokens[tokens.size() - 1]; 


Crow 01-26-2012 02:49 PM

There's a good chance that hints do not work correctly if the control is not focused. I'm not 100% sure if that's still the case, but I believe it was a problem before.

fowlplay4 01-26-2012 04:29 PM

Try giving the GUI Object width and height.

sssssssssss 01-29-2012 05:31 AM

Gave the gui image width and height, but editting the hint later still isn't working.

how would I set focus?

fowlplay4 01-29-2012 06:28 AM

Quote:

Originally Posted by sssssssssss (Post 1683042)
Gave the gui image width and height, but editting the hint later still isn't working.

how would I set focus?

Use onMouseEnter, onMouseLeave and see if they work. If they do you might as well make your own hint system.

GuiName.makefirstresponder(true);


All times are GMT +2. The time now is 06:16 AM.

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