View Single Post
  #1  
Old 09-02-2013, 09:06 AM
Trakan Trakan is offline
It's all about cats!
Trakan's Avatar
Join Date: Sep 2010
Location: France
Posts: 64
Trakan is an unknown quantity at this point
leftmousebutton problem

So i'm doing a kind of panel, basically i want to show it when you click on the panel image:


But when i click, (everywhere else, don't matter if its on the image or not), it shows correctly.

How can i make it show only if i click on the image?

Class:
PHP Code:
// Scripted by *Trakan

function onActionServerSide(null) {
  
serverr.available_quests += 1;
}
//#CLIENTSIDE
  
if (leftmousebutton) {
QuestMenu_Window1.show();
}
function 
onCreated() {
  
onTimeout();


  new 
GuiWindowCtrl("QuestMenu_Window1") {
    
clientrelative = true;
    
clientextent = "570,374";
    
canmaximize = false;
    
profile = GuiBlueWindowProfile;
    
useOwnProfile = true;
    
canmove = true;
    
canresize = false;
    
closequery = false;
    
destroyonhide = false;
    
text = "Available Quests";
    
x = screenheight/2;
    
y = 50;
    
profile.bitmap = "gh_gui-general.png";
    
profile.fillColor = {58,63,37};

    new 
GuiTextCtrl("QuestMenu_Text1") {
      
profile = GuiBlueTextProfile;
      
height = 25;
      
horizsizing = "center";
      
text = "Available Quests (" @ serverr.available_quests @ "/" @ serverr.maxquests @ ")";
      
width = 140;
      
x = 225;
      
y = 5;
    }
    new 
GuiBitmapButtonCtrl("QuestMenu_Button1") {
      
text = "   JOIN";
         
width = 48;
         
heigh = 24;
      
x = 462;
      
y = 40;
   
normalbitmap = "gh_gui-button.png";
   
mouseoverbitmap = "gh_gui-button.png";
   
pressedbitmap = "gh_gui-button.png";
    }

        new 
GuiBitmapButtonCtrl("QuestMenu_Button2") {
      
text = "  INFO+";
         
width = 48;
         
heigh = 24;
      
x = 515;
      
y = 40;
   
normalbitmap = "gh_gui-button.png";
   
mouseoverbitmap = "gh_gui-button.png";
   
pressedbitmap = "gh_gui-button.png";
    }
    new 
GuiTextCtrl("QuestMenu_Text2") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
text = "Type: Recolte";
      
width = 80;
      
x = 367;
      
y = 46;
    }
    new 
GuiTextCtrl("QuestMenu_Text3") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
text = "RANK: ";
      
width = 74;
      
x = 268;
      
y = 46;
    }
    new 
GuiTextCtrl("QuestMenu_Text4") {
      
profile = GuiBlueTextProfile;
      
height = 20;
      
text = "Quest: " @ serverr.quest1_questname;
      
width = 206;
      
x = 35;
      
y = 46;
    }
    new 
GuiBitmapCtrl("QuestMenu_Bitmap1") {
      
profile = GuiDefaultProfile;
      
bitmap = "gh_icon_health-potion.png";
      
fullbitmap = false;
      
height = 62;
      
x = 7;
      
y = 43;
    }
}
}
function 
QuestMenu_Button1.onAction() {
 if (
serverr.available_quests != serverr.maxquests) {
triggerserver("gui", this.name, null);
}

}

function 
onTimeout()
  {
if (
serverr.quest1_available == true) {
QuestMenu_Button1.hide();
QuestMenu_Button2.hide();
QuestMenu_Text2.hide();
QuestMenu_Text3.hide();
QuestMenu_Text4.hide();
QuestMenu_Bitmap1.hide();
} else if (
serverr.quest1_available == false) {
QuestMenu_Button1.show();
QuestMenu_Button2.show();
QuestMenu_Text2.show();
QuestMenu_Text3.show();
QuestMenu_Text4.show();
QuestMenu_Bitmap1.show();
}

  
QuestMenu_Text1.text = "Available Quests (" @ serverr.available_quests @ "/" @ serverr.maxquests @ " )";
  
setTimer(0.1);
} 

Last edited by Trakan; 09-02-2013 at 09:27 AM..
Reply With Quote