Template talk:TrophyTableRow: Difference between revisions

(→‎N/A for price: new section)
 
(10 intermediate revisions by 4 users not shown)
Line 77: Line 77:


I've been adding some of the missing prices to the SSB4 trophy tables. But there are some trophies that can't be bought, so it would be nice to have something for the "price" parameters that will display "N/A". I'm familiar enough with wikicode to add that, but I don't know how to make it '''''not''''' display the Play Coin icon as well. For now I will just put a question mark for the non-purchased trophies, but that kind of implies they ''have'' a price but we don't know what it is. [[User:HelpTheWretched|HelpTheWretched]] ([[User talk:HelpTheWretched|talk]]) 18:47, March 4, 2021 (EST)
I've been adding some of the missing prices to the SSB4 trophy tables. But there are some trophies that can't be bought, so it would be nice to have something for the "price" parameters that will display "N/A". I'm familiar enough with wikicode to add that, but I don't know how to make it '''''not''''' display the Play Coin icon as well. For now I will just put a question mark for the non-purchased trophies, but that kind of implies they ''have'' a price but we don't know what it is. [[User:HelpTheWretched|HelpTheWretched]] ([[User talk:HelpTheWretched|talk]]) 18:47, March 4, 2021 (EST)
:I think I made it to do what you asked. Just set either ssb4-wiiu-price or ssb4-3ds-price to N/A (only one though, setting the other breaks it) and it will show N/A with no icon. --[[User:CanvasK|CanvasK]] ([[User talk:CanvasK|talk]]) 19:14, March 4, 2021 (EST)
::That is great, but it seems to have messed up any tables that don't have a '''Price''' column. I'd rather not just add that column to every table since there may be cases where it's not wanted? [[User:HelpTheWretched|HelpTheWretched]] ([[User talk:HelpTheWretched|talk]]) 19:27, March 4, 2021 (EST)
:::Heck. Are there any cases where 3ds-price is N/A and there is a wiiu-price? If not I can just move the ifeq to only the 3ds-price part and it seems to work with other tables. --[[User:CanvasK|CanvasK]] ([[User talk:CanvasK|talk]]) 19:39, March 4, 2021 (EST)
:::Yep, fighters' (Alt.) trophies are N/A on 3DS and bought in the shop on Wii U. There might be other cases but I don't know of any. [[User:HelpTheWretched|HelpTheWretched]] ([[User talk:HelpTheWretched|talk]]) 22:10, March 4, 2021 (EST)
::::I think the change I made should allow for N/A on 3DS and amount on Wii U. --[[User:CanvasK|CanvasK]] ([[User talk:CanvasK|talk]]) 22:32, March 4, 2021 (EST)
:::::Thanks for looking into this, and I'm sorry to keep bugging about it, but there are a couple issues. You can see on [[List of SSB4 trophies (Super Mario Bros. series)]], I've added the column of empty prices to the Both Versions table, then tried using N/A on the two Mario trophies at the top.
:::::*If there prices for both versions, the 3DS icon still doesn't appear.
:::::*If the price for Wii U is N/A, it still adds " G".
:::::*Not shown, but if we only enter a Wii U price, then not only does it still show a blank 3DS price, but the Wii U icon is missing!
:::::I think it may be easier to re-write this portion of the code from scratch than to try fixing each case. And again, I wish I could do that; I have a lot of programming experience but am still learning the wiki code syntax. If it can store and modify strings before writing them, then it should be easy, but if it can't write strings then the logic should go like:
:::::#If both price parameters are present, place the 3DS icon and colon.
:::::#If a 3DS price is present, write it.
:::::#If the 3DS price is ''NOT'' "N/A", then add " G" and the corresponding Play Coins, plus line break.
:::::#If both parameters are present, place the Wii U icon and colon.
:::::#If a Wii U price is present, write it.
:::::#If the Wii U price is not "N/A", then add " G".
:::::[[User:HelpTheWretched|HelpTheWretched]] ([[User talk:HelpTheWretched|talk]]) 00:46, March 6, 2021 (EST)
::::::I made a mock-up [[Special:PermanentLink/1543732|here in my sandbox]], does that do everything that is needed? I also added some pseudo-code comments into it to help both of us make sense of it. I also removed uses of non-breaking spaces because they are effectively ignored when next to images; replaced it with a CSS style that works. --[[User:CanvasK|CanvasK]] ([[User talk:CanvasK|talk]]) 07:28, March 6, 2021 (EST)
:::::::That's excellent! Thanks again. [[User:HelpTheWretched|HelpTheWretched]] ([[User talk:HelpTheWretched|talk]]) 21:37, March 7, 2021 (EST)