Graal Forums  

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

View Poll Results: Was this useful to you?
Yeah 16 88.89%
No 2 11.11%
Voters: 18. You may not vote on this poll

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 10-02-2006, 09:20 AM
Skrobo2 Skrobo2 is offline
In the real world ogod.
Skrobo2's Avatar
Join Date: Dec 2005
Location: Refugio, Texas
Posts: 435
Skrobo2 is on a distinguished road
Quote:
Originally Posted by KuJi View Post
I tried everything I could think of with the transperency, wanna shed some light on it and I'll fix it up =o?
I don't know a whole lot about gui windows, but I think you'd need to edit that image for the window borders and such.
__________________


Quote:
Originally Posted by Darlene159 View Post
I would rather have dead forums.
Reply With Quote
  #17  
Old 10-02-2006, 10:15 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
It'd really be a lot better if I don't need to repost on revisions.. can you put a lil mod to allow forever-edit or something.

New Update: V 1.1

PHP Code:
// NPC Made by KuJi - V1.1
//#CLIENTSIDE
function onCreated()
{
  
requesttext("clientrc"1);
  
  new 
GuiMLTextEditProfile(TextEditorProfile)
  {
    
fontType        "Courier";
    
fontSize        10;
    
cursorColor     "0 0 0";
    
fillColorHL     "255 255 0";
    
fontColor       "0 0 0";
    
fontColorHL     "192 0 0"// control words like if, else etc.
    
fontColorSEL    "0 96 0"// identifiers
    
fontColorLink   "0 0 192"// strings
    
fontColorLinkHL "0 0 255"// numbers
  
}
  
  
onShowGUI();
}

function 
onShowGUI()

  if (
NC_Window != NULL)
  {
    
NC_Window.destroy();
  }
  
  new 
GuiWindowCtrl(NC_Window)
  {
    
height               460;
    
profile              GuiBlueWindowProfile;
    
text                 "NC Control (V1.0 by KuJi) ";
    
width                577;
    
x                    150;
    
y                    150;
    
    
visible              false;
    
    new 
GuiTabCtrl(NC_Tab)
    {
      
profile "GuiBlueTabProfile";
      
extent = {38025};
      
position = {18335};
      
      
horizSizing "width";
      
clearrows();
    }
    
    new 
GuiScrollCtrl(NC_Frame1)
    {
      
profile        GuiBlueScrollProfile;
      
extent         = {175431};
      
position       = {623};
      
      
hScrollBar     "dynamic";
      
vScrollBar     "dynamic";
      
vertSizing     "height";
      
      
useownprofile  true;
      
profile.opaque false;
      
      new 
GuiTreeViewCtrl(NC_Tree)
      {
        
profile GuiBlueTreeViewProfile;
        
0;
        
fitparentwidth true;
       
        
clearnodes();
        
addnodebypath("Classes""/");
        
addnodebypath("NPCS""/");
        
addnodebypath("Weapons""/");
      }
    }
    
    new 
GuiScrollCtrl(NC_Frame2)
    {
      
profile        GuiBlueScrollProfile;
      
extent         = {388355};
      
position       = {18260};
      
      
hScrollBar     "dynamic";
      
vScrollBar     "dynamic";
      
horizSizing    "width";
      
vertSizing     "height";
      
      
useownprofile  true;
      
profile.opaque false;
    }
    
    new 
GuiButtonCtrl(NC_Close)
    {
      
profile     GuiBlueButtonProfile;
      
extent      = {6525};
      
position    = {360423};
      
      
horizSizing "left";
      
vertSizing  "top";
      
text        "Close";
      
      
thiso.catchevent(this.name"onAction""onActionButton");
    }
    
    
    new 
GuiButtonCtrl(NC_Reload)
    {
      
profile     GuiBlueButtonProfile;
      
extent      = {6525};
      
position    = {430423};
      
      
horizSizing "left";
      
vertSizing  "top";
      
      
text        "Reload";
      
      
thiso.catchevent(this.name"onAction""onActionButton");
    }
    
    new 
GuiButtonCtrl(NC_Save)
    {
      
profile     GuiBlueButtonProfile;
      
extent      = {6525};
      
position    = {500423};
      
      
horizSizing "left";
      
vertSizing  "top";
      
      
text        "Save";
      
      
thiso.catchevent(this.name"onAction""onActionButton");
    }
  }
}

function 
NC_Tab.onSelect(tabidtabtexttabindex)
{
  for (
temp.var: NC_Tab.rows)
  {
    if (
temp.var.text == tabtext)
    {
      
temp.var.scriptedit.visible true;
    }
  }
}

function 
NC_Tab.onDeselect(tabidtabtexttabindex)
{
  for (
temp.var: NC_Tab.rows)
  {
    if (
temp.var.text == tabtext)
    {
      
temp.var.scriptedit.visible false;  
    }
  }
}


function 
NC_Tree.onDblClick(nodenodeslashpathnodedotpath)
{
  if (
nodeslashpath.starts("Classes/"))
  {
    
requesttext("class"nodeslashpath.substring(8));
  }
    elseif (
nodeslashpath.starts("Weapons/"))
  {
    
requesttext("weapon"nodeslashpath.substring(8));
  }
    elseif (
nodeslashpath.starts("NPCS/"))
  {
    
requesttext("npc"nodeslashpath.substring(5));
  }
}

function 
onReceiveText(texttypetextoptiontextlines)
{
  if (
texttype in {"classlist""npclist""weaponlist"})
  {
    
onAddScripts(textoptiontextlines);
  }
    elseif (
texttype in {"class""npc""weapon"})
  {
    
onViewScript(texttypetextoptiontextlines);
  }
}

function 
onAddScripts(temp.prefixtemp.textlines)
{
  if (
temp.prefix != NULL)
  {
    for (
temp.var: temp.textlines)
    {
      if (
temp.var != NULL)
      {
        
with (NC_Tree.addnodebypath(temp.prefix temp.var, "/"))
        {
          
image selectedimage 2;
        }
      }
    }
  }
}

function 
onViewScript(temp.texttypetemp.textoptiontemp.textlines)
{
  
temp.found NC_Tab.findtextid(temp.textoption);
  
  if (
temp.found >= 0)
  {
    
NC_Tab.setselectedbyid(temp.found);
    
    for (
temp.var: NC_Tab.rows)
    {
      if (
temp.var.id == temp.found)
      {
        
temp.var.scriptedit.setlines(temp.textlines);
      }
    }
    
    return 
true;
  }
    else
  {
    
    
with (NC_Frame2)
    {
      new 
GuiMLTextEditCtrl("NC_Edit_" temp.texttype "_" temp.textoption)
      {
        
profile            "TextEditorProfile";
        
extent             = {365225};
        
position           = {66};
        
        
horizSizing        "width";
        
vertSizing         "height";
        
        
syntaxHighlighting true;
        
wordwrap           false;
      
        
this.edittype      temp.texttype;
        
this.editoption    temp.textoption;

        
setlines(temp.textlines);
      }
    }
  
    
with (NC_Tab.addrow(this.tabid++, temp.textoption))
    {
      
this.scriptedit makevar("NC_Edit_" temp.texttype "_" temp.textoption);
      
NC_Tab.setselectedbyid(this.id);
    }
  } 
}

function 
onActionButton(obj)
{
  
temp.ncid NC_Tab.getselectedid();
  
  if (
temp.ncid <= -1)
  {
    return 
false;
  }
  
  switch (
obj.substring(3))
  {
    case 
"Close":
    {
      for (
temp.var: NC_Tab.rows)
      {
        if (
temp.var.id == temp.ncid)
        {
          
temp.var.scriptedit.destroy();
          
NC_Tab.removerowbyid(temp.ncid);
          
NC_Frame2.extent = {388355};
          
          break;
        }
      }
    
      break;
    }
    
    case 
"Reload":
    {
      for (
temp.var: NC_Tab.rows)
      {
        if (
temp.var.id == temp.ncid)
        {
          
requesttext(temp.var.scriptedit.edittypetemp.var.scriptedit.editoption);
          
          break;
        }
      }
      
      break;
    }
    
    case 
"Save":
    {
      for (
temp.var: NC_Tab.rows)
      {
        if (
temp.var.id == temp.ncid)
        {
          
sendtext(temp.var.scriptedit.edittypetemp.var.scriptedit.editoptiontemp.var.scriptedit.getLines());

          break;
        }
      }
    }
  }
}

function 
onKeyPressed(keycodekeychar)
{
  if (
keychar == '`')
  {
    
NC_Tree.clearnodes();
    
requesttext("classlist""Classes/");
    
requesttext("npclist""NPCS/");
    
requesttext("weaponlist""Weapons/");
    
    
NC_Window.visible = !NC_Window.visible;
  }

This fixes the colors for people who haven't used the texteditor yet.. it'll make them the colors I had in the pic. Sorry about that =o.

P.S. I did take those right out of texteditor =o
Reply With Quote
  #18  
Old 12-23-2006, 11:28 PM
TrueMOD TrueMOD is offline
Registered User
Join Date: Nov 2005
Posts: 3
TrueMOD is on a distinguished road
hi i am a noob in gui scripting so i ask here
i added an delete button but dont know how i can
delete a file can anyone help me please

(i tried it with requestfiledeletion(str); but it doesnt work)
Reply With Quote
  #19  
Old 12-23-2006, 11:45 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Too bad Joey's banned
Reply With Quote
  #20  
Old 12-23-2006, 11:45 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Needs more flag reading/editting, in my opinion.
Reply With Quote
  #21  
Old 12-23-2006, 11:52 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by excaliber7388 View Post
Too bad Joey's banned
He has an other account.
__________________
Reply With Quote
  #22  
Old 12-24-2006, 12:12 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Yen View Post
Needs more flag reading/editting, in my opinion.
There is already support for editing NPC's flag lists; my Scripted RC already uses it.
__________________
Skyld
Reply With Quote
  #23  
Old 12-24-2006, 12:16 AM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by Skyld View Post
There is already support for editing NPC's flag lists; my Scripted RC already uses it.
Sounds like fun *nudge*
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 05:48 PM.


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