Jump to content




GUI File Browser

lua

  • You cannot reply to this topic
51 replies to this topic

#21 ETHANATOR360

  • Members
  • 423 posts
  • Locationyour hardrive

Posted 15 July 2012 - 11:34 PM

wow im using this in my OS thats amazing,and how lond did the ascii art take?

#22 inventor2514

  • Members
  • 63 posts

Posted 16 July 2012 - 12:03 AM

The ASCII art took about five minutes, but the actual coding was fairly time consuming.

#23 ETHANATOR360

  • Members
  • 423 posts
  • Locationyour hardrive

Posted 16 July 2012 - 12:48 AM

i cant find where the code is to change what it does when you hit the x in the corner

#24 inventor2514

  • Members
  • 63 posts

Posted 16 July 2012 - 01:37 AM

At lines 349-351, it detects that cancel was "clicked" and ends the main program loop. At lines 639-End, it deletes the temporary copy file and clears the screen.

#25 ETHANATOR360

  • Members
  • 423 posts
  • Locationyour hardrive

Posted 16 July 2012 - 02:39 PM

thanks, you should take this further in to a full OS it could be like windows in a way :P/>

#26 inventor2514

  • Members
  • 63 posts

Posted 16 July 2012 - 04:02 PM

I've been thinking about that, but I'm still figuring out co-routines for multitasking.

#27 ETHANATOR360

  • Members
  • 423 posts
  • Locationyour hardrive

Posted 16 July 2012 - 06:56 PM

can you modify it so it opens to a differnt directory then the main one?

#28 inventor2514

  • Members
  • 63 posts

Posted 16 July 2012 - 10:33 PM

View PostETHANATOR360, on 16 July 2012 - 06:56 PM, said:

can you modify it so it opens to a differnt directory then the main one?
I just added a configuration variable for that. Also, the current shell directory is the default start directory now.

#29 Exerro

  • Members
  • 801 posts

Posted 17 July 2012 - 04:45 PM

i have an os so if youre interested it wud be great for you to work with me and my os...but anyway i basically want O's around the edge instead of
+---+
| |
+---+

#30 Darky_Alan

  • Members
  • 89 posts
  • LocationPuerto Rico

Posted 17 July 2012 - 07:41 PM

I'm curious, how come the color of the text in the screen is different, is that a custom addition to the mod, or is there an acctual command I can use for that?

#31 KevinW1998

  • Members
  • 93 posts
  • LocationAustria(German)

Posted 17 July 2012 - 08:11 PM

You can change the color in the config but you can't use multiple colors at the same time!

#32 inventor2514

  • Members
  • 63 posts

Posted 19 July 2012 - 08:39 PM

Another minor update. This one is for those who are trying to use/modify parts of my code.

#33 makerimages

  • Members
  • 236 posts

Posted 13 August 2012 - 10:33 AM

how do you display that ascii art gui??

#34 inventor2514

  • Members
  • 63 posts

Posted 13 August 2012 - 12:44 PM

I use term.setCursorPos() and term.write() to draw the ASCII art. Take a look at the functions drawIcon() and drawBorder() in my code for more detail.

#35 Laserman34170

  • New Members
  • 34 posts
  • LocationProgramming Land

Posted 17 August 2012 - 04:38 PM

Where should I edit the code if I want to use mutiple icons?

#36 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 17 August 2012 - 04:44 PM

Wow, this is REALLY nice! I love it!

#37 inventor2514

  • Members
  • 63 posts

Posted 17 August 2012 - 05:18 PM

View PostLaserman34170, on 17 August 2012 - 04:38 PM, said:

Where should I edit the code if I want to use mutiple icons?
Right now, I can only distinguish between files and directories, so I only have one icon for each. I declare them at lines 23&24. If you wanted to, you could declare your own icons in the same style and use them as arguments for drawIcon(), but you would need a way to recognize different types of files.

View Postcraniumkid22, on 17 August 2012 - 04:44 PM, said:

Wow, this is REALLY nice! I love it!
Thank you; I appreciate the appreciation.

#38 Laserman34170

  • New Members
  • 34 posts
  • LocationProgramming Land

Posted 20 August 2012 - 01:53 PM

View Postinventor2514, on 17 August 2012 - 05:18 PM, said:

View PostLaserman34170, on 17 August 2012 - 04:38 PM, said:

Where should I edit the code if I want to use mutiple icons?
Right now, I can only distinguish between files and directories, so I only have one icon for each. I declare them at lines 23&24. If you wanted to, you could declare your own icons in the same style and use them as arguments for drawIcon(), but you would need a way to recognize different types of files.
Yes, actually I'm thinking on finding a string inside the filename for an extension.

#39 inventor2514

  • Members
  • 63 posts

Posted 20 August 2012 - 04:24 PM

View PostLaserman34170, on 20 August 2012 - 01:53 PM, said:

Yes, actually I'm thinking on finding a string inside the filename for an extension.
In that case, make the following changes to my functions; they should be around line 104. You should be able to check for file extensions and draw your custom icons.
-- Draws an icon at the specified position
local function drawIcon(x, y, tIcon, sName)
local tIcon = tIcon
for i, s in ipairs(tIcon) do
  output(x, y+i-1, s)
end
if sName then output(x, y+#tIcon, string.sub(sName, 1, 8)) end
end
-- Draws icons to represent file data
local function drawIcons()
local pos = 1 + maxCol*(row-1)
local limit = pos-1+maxCol*maxRow
if #tData < limit then limit = #tData end
local icon = 1
for i = pos, limit do
  local x, y, sName = tOrigins[icon][1], tOrigins[icon][2], tData[i][1]
  if tData[i][2] then
   drawIcon(x, y, tDirIcon, sName)
  else
   drawIcon(x, y, tFileIcon, sName) -- replace this with your code
  end
  icon = icon + 1
end
end


#40 makerimages

  • Members
  • 236 posts

Posted 26 September 2012 - 12:12 PM

how do you distinguish between files and directorys?





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users