Jump to content

تصحيح اكود


Recommended Posts

  
GUIEditor = { 
    button = {}, 
    gridlist = {}, 
} 
  

ضيف هذي بأول السكربت وبيشتغل

معلومة بسيطة : لما ماتحط قيمة للزر او اي عنصر من عناصر الجي يو أي لازم تحط له مثل الجدول الي فوق

على شان مايحصل اختلاط

يعني شوف انت حاط زر وحاط قريد ليست

وحاطهم بدون قيم يعني كذا

GUIEditor.button[1]

GUIEditor.gridlist[1]

اذا بتكتبهم كذا لازم تحط جدول على شان مايصير إختلاط ومايشتغل المود

اما لو حاطهم كذا

CoR = guiCreateButton(381, 588, 104, 42, "", false)

Ahmad Ly = guiCreateGridList(398, 266, 316, 302, false)

مايحتاج تحط جدول على شان انت حاط قيم لعناصر ال جي يو اي

بالتوفيق

Link to comment

انت ناسي تحط

guiGridListSetItemData 
  

:wink:

كودك قبل التعديل

  
for i,v in pairs(xmlNodeGetChildren(xmlFindChild(xmlLoadFile("Xml.xml"),"Ahmed",0))) do 
local row = guiGridListAddRow (GUIEditor.gridlist[1] ) 
guiGridListSetItemText (GUIEditor.gridlist[1], row, 1,i..'-', false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,name,xmlNodeGetAttribute(v, "name"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row, x1,xmlNodeGetAttribute(v, "x"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,y1,xmlNodeGetAttribute(v, "y"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,z1,xmlNodeGetAttribute(v, "z"), false, false) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,x1,255,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,y1,0,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,z1,255,0,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,name,0,0,255) 
  
end 
  

بعد التعديل

  
for i,v in pairs(xmlNodeGetChildren(xmlFindChild(xmlLoadFile("Xml.xml"),"Ahmed",0))) do 
local row = guiGridListAddRow (GUIEditor.gridlist[1] ) 
guiGridListSetItemText (GUIEditor.gridlist[1], row, 1,i..'-', false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,name,xmlNodeGetAttribute(v, "name"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row, x1,xmlNodeGetAttribute(v, "x"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,y1,xmlNodeGetAttribute(v, "y"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,z1,xmlNodeGetAttribute(v, "z"), false, false) 
guiGridListSetItemData (GUIEditor.gridlist[1] , row, x1,xmlNodeGetAttribute(v, "x"), false, false) 
guiGridListSetItemData  (GUIEditor.gridlist[1] , row,y1,xmlNodeGetAttribute(v, "y"), false, false) 
guiGridListSetItemData  (GUIEditor.gridlist[1] , row,z1,xmlNodeGetAttribute(v, "z"), false, false) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,x1,255,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,y1,0,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,z1,255,0,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,name,0,0,255) 
  
end 
  

وتم التجربة وشغال

موفق #

Link to comment
انت ناسي تحط
guiGridListSetItemData 
  

كودك قبل التعديل

  
for i,v in pairs(xmlNodeGetChildren(xmlFindChild(xmlLoadFile("Xml.xml"),"Ahmed",0))) do 
local row = guiGridListAddRow (GUIEditor.gridlist[1] ) 
guiGridListSetItemText (GUIEditor.gridlist[1], row, 1,i..'-', false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,name,xmlNodeGetAttribute(v, "name"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row, x1,xmlNodeGetAttribute(v, "x"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,y1,xmlNodeGetAttribute(v, "y"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,z1,xmlNodeGetAttribute(v, "z"), false, false) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,x1,255,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,y1,0,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,z1,255,0,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,name,0,0,255) 
  
end 
  

بعد التعديل

  
for i,v in pairs(xmlNodeGetChildren(xmlFindChild(xmlLoadFile("Xml.xml"),"Ahmed",0))) do 
local row = guiGridListAddRow (GUIEditor.gridlist[1] ) 
guiGridListSetItemText (GUIEditor.gridlist[1], row, 1,i..'-', false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,name,xmlNodeGetAttribute(v, "name"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row, x1,xmlNodeGetAttribute(v, "x"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,y1,xmlNodeGetAttribute(v, "y"), false, false) 
guiGridListSetItemText (GUIEditor.gridlist[1] , row,z1,xmlNodeGetAttribute(v, "z"), false, false) 
guiGridListSetItemData (GUIEditor.gridlist[1] , row, x1,xmlNodeGetAttribute(v, "x"), false, false) 
guiGridListSetItemData  (GUIEditor.gridlist[1] , row,y1,xmlNodeGetAttribute(v, "y"), false, false) 
guiGridListSetItemData  (GUIEditor.gridlist[1] , row,z1,xmlNodeGetAttribute(v, "z"), false, false) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,x1,255,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,y1,0,255,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,z1,255,0,0) 
guiGridListSetItemColor(GUIEditor.gridlist[1] , row,name,0,0,255) 
  
end 
  

وتم التجربة وشغال

موفق #[/quot]

شكرا لك :fadein::fadein::fadein:

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...