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";
    
screenheight/2;
    
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;
      
225;
      
5;
    }
    new 
GuiBitmapButtonCtrl("QuestMenu_Button1") {
      
text "   JOIN";
         
width 48;
         
heigh 24;
      
462;
      
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;
      
515;
      
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;
      
367;
      
46;
    }
    new 
GuiTextCtrl("QuestMenu_Text3") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "RANK: ";
      
width 74;
      
268;
      
46;
    }
    new 
GuiTextCtrl("QuestMenu_Text4") {
      
profile GuiBlueTextProfile;
      
height 20;
      
text "Quest: " serverr.quest1_questname;
      
width 206;
      
35;
      
46;
    }
    new 
GuiBitmapCtrl("QuestMenu_Bitmap1") {
      
profile GuiDefaultProfile;
      
bitmap "gh_icon_health-potion.png";
      
fullbitmap false;
      
height 62;
      
7;
      
43;
    }
}
}
function 
QuestMenu_Button1.onAction() {
 if (
serverr.available_quests != serverr.maxquests) {
triggerserver("gui"this.namenull);
}

}

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