Inventory list formatting?

OurJud
14 Dec 2015, 12:57
I don't seem to be able to find where in the library the inventory list is formatted.

It's only a small matter, but currently on 'i' I get:

a rifle and a backpack (containing a crowbar, a can of baked beans, a hooded fleece, a sleeping bag and an empty water bottle).


When I would prefer:

A rifle and a backpack, containing a crowbar, a can of baked beans, a hooded fleece, a sleeping bag and an empty water bottle.


Note capital A and comma instead of brackets.

Thanks.

The Pixie
14 Dec 2015, 13:26
You need to over-write FormatObjectList. Try this code; it may need tweaking.
result = ""
count = 0
list = RemoveSceneryObjects(GetDirectChildren(parent))
if (CheckDarkness()) {
list = RemoveDarkObjects(list)
}
listLength = ListCount(list)
foreach (item, list) {
if (LengthOf(result) = 0) {
result = preList + " "
}
result = result + GetDisplayNameLink(item, "object")
if (CanSeeThrough(item)) {
result = result + FormatObjectList(", " + item.contentsprefix, item, preFinal, "")
}
count = count + 1
if (count = listLength - 1) {
result = result + " " + preFinal + " "
}
else if (count < listLength) {
result = result + ", "
}
else {
result = result + postList
}
}
return (CapFirst(result))

OurJud
14 Dec 2015, 13:39
Thank you.

That replaced the bracket with a comma, but not lowercase A with a capital.

The Pixie
14 Dec 2015, 13:56
How about this?
result = ""
count = 0
list = RemoveSceneryObjects(GetDirectChildren(parent))
if (CheckDarkness()) {
list = RemoveDarkObjects(list)
}
listLength = ListCount(list)
foreach (item, list) {
if (LengthOf(result) = 0) {
result = preList + " " + CapFirst(GetDisplayNameLink(item, "object"))
}
else {
result = result + GetDisplayNameLink(item, "object")
}
if (CanSeeThrough(item)) {
result = result + FormatObjectList(", " + item.contentsprefix, item, preFinal, "")
}
count = count + 1
if (count = listLength - 1) {
result = result + " " + preFinal + " "
}
else if (count < listLength) {
result = result + ", "
}
else {
result = result + postList
}
}
return (result)

OurJud
14 Dec 2015, 15:29
Ooh, nearly.

I now get:

A rifle and a backpack, containing A crowbar, a can of baked beans, a hooded fleece, a sleeping bag and an empty water bottle.


Trying to figure out myself how to remove the second cap A, but there's only one instance in the code for CapFirst - which I presume dictates the case of the first letter in a new list?