determinate determinate

Author Topic: TxtMan?  (Read 741 times)

0 Members and 1 Guest are viewing this topic.

Offline Thor

  • Scripter
  • Lord
  • ******
  • Posts: 296
  • Karma: +43/-5
    • Hungarian Direct Connect Site
TxtMan?
« on: June 26, 2009, 07:42:07 pm »
The only thing I missing in PtokaX Lua interface is TxtMan for text file management. You were able to implement the same functions for the scripts, I ask you to do this for text files. What I want are:

TxtMan.GetFiles() - returns with an array which contains the text files from the texts folder. Optionally a hash, where the keys are the filenames, and the values are the sizes in bytes.
TxtMan.GetFile(string filename) - returns with a string which is the content of the given file or nil if it doesn't exists.
TxtMan.SetFile(string filename,string content) - updates the given textfile, returns true if succeed, else nil.
TxtMan.ReloadTexts() - Reloads the text files from the texts folder.

If you can do this, I can forget pxlfs, which can couse many headache to the users on linux... Also there is no call for reloading text files now... Hope you can (rather: want to) implement these. (By the way, ProfMan.Save() would be also a good call ;)) Thank you.
May the force be with you



Offline CrazyGuy

  • Global Moderator
  • Viking
  • *****
  • Posts: 533
  • Karma: +82/-20
    • ˜”°º•=-_The NightHawk_-=•º°”˜
Re: TxtMan?
« Reply #1 on: June 27, 2009, 01:34:02 am »
Yes I agree. TxtMan is a nice extra to be added in upcoming releases (and I know PPK has planned this, it's just not finished yet) :)

Side note: There is a way to reload textfiles by API. More of a work-around than an actual call but disabling and re-enabling textfiles, which can be done by script, does do a reload and updates changed files.

 

determinate determinate