OpenTTD

Tasklist

FS#5047 - View GS/AI textfiles

Attached to Project: OpenTTD
Opened by Charles Pigott (LordAro) - Sunday, 05 February 2012, 21:38 GMT
Last edited by Remko Bijker (Rubidium) - Sunday, 12 February 2012, 11:02 GMT
Type Patch
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Hello

I (with the usual lots of help from Alberth) have created a patch that allows you to view readmes/changelogs/licences of AIs and Gamescripts

Feedback (+ trunk inclusion ;P ) appreciated

(patch against r23903)
This task depends upon

Closed by  Remko Bijker (Rubidium)
Sunday, 12 February 2012, 11:02 GMT
Reason for closing:  Implemented
Additional comments about closing:  Around r23933
Comment by Remko Bijker (Rubidium) - Monday, 06 February 2012, 20:59 GMT
Overall the patch does not look bad. However, it's a bit big and we rather see patches in smaller more logical chunks. For example a first patch would be splitting the NewGRF and Window code (without renaming the strings), then one that renames/changes the way the strings are constructed, followed by one that moves/generalises the "find file" algorithm and then finally a patch that introduces the text files to GS/AI scripts.

One note though; the following looks weird, although not incorrect.
+ (slot == OWNER_DEITY) ? this->LoadTextfile(textfile, GAME_DIR) : this->LoadTextfile(textfile, AI_DIR);
+ (slot == OWNER_DEITY) ? SetDParam(0, STR_CONTENT_TYPE_GAME_SCRIPT) : SetDParam(0, STR_CONTENT_TYPE_AI);
I would however be preferred to write it respectively:
+ this->LoadTextfile(textfile, slot == OWNER_DEITY ? GAME_DIR : AI_DIR);
+ SetDParam(0, slot == OWNER_DEITY ? STR_CONTENT_TYPE_GAME_SCRIPT : STR_CONTENT_TYPE_AI);
Comment by Charles Pigott (LordAro) - Saturday, 11 February 2012, 19:03 GMT
I believe i have satisfied to 2 previous requests:
Comment by Jose Soler (Terkhen) - Sunday, 12 February 2012, 10:31 GMT
Patch 25 has some rejects that should be fixed. I get an error while trying to compile the whole queue (the error is introduced at 40):

http://paste.openttdcoop.org/show/1097/

Loading...