?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. -- Brush Test.lua
  2.  
  3. function main ()
  4.  local w = mappy.getValue(mappy.MAPWIDTH)
  5.  
  6.  if (w == 0) then
  7.   mappy.msgBox ("Brush Test", "You need to load or create a map first", mappy.MMB_OK, mappy.MMB_ICONINFO)
  8.  else
  9.  
  10.   bnum = mappy.getValue (mappy.NUMBRUSHES)
  11.   mappy.msgBox ("Brush Test", "This will create a new brush and rename it.\nMap name: "..mappy.getValue(mappy.MAPFILENAME).."\n\nNumber of brushes = "..bnum, mappy.MMB_OK, mappy.MMB_ICONINFO)
  12.  
  13. -- This will create a brush and copy the area described
  14.   mappy.createBrush (bnum, 0, 0, 16, 16)
  15.   mappy.renameBrush (bnum, "Brush Test");
  16.   mappy.msgBox ("Brush Test", "New brush created, "..mappy.getBrushValue (bnum, mappy.BRUSHNAME), mappy.MMB_OK, mappy.MMB_ICONINFO)
  17.  
  18.   mappy.updateScreen ()
  19.  
  20.  end
  21. end
  22.  
  23. test, errormsg = pcall( main )
  24. if not test then
  25.     mappy.msgBox("Error ...", errormsg, mappy.MMB_OK, mappy.MMB_ICONEXCLAMATION)
  26. end
  27.