Author Topic: TxtMan?  (Read 2171 times)

0 Members and 1 Guest are viewing this topic.

Offline Thor

  • Scripter
  • Lord
  • ******
  • Posts: 290
  • Karma: +45/-5
    • Hungarian Direct Connect Site
TxtMan?
« on: 26 June, 2009, 19:42:07 »
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.

PtokaX forum

TxtMan?
« on: 26 June, 2009, 19:42:07 »

Offline CrazyGuy

  • Viking
  • ****
  • Posts: 506
  • Karma: +83/-20
    • ?????=-_The NightHawk_-=?????
Re: TxtMan?
« Reply #1 on: 27 June, 2009, 01:34:02 »
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.

PtokaX forum

Re: TxtMan?
« Reply #1 on: 27 June, 2009, 01:34:02 »