Difference between revisions of "User talk:HubrisBliss"

From UFOpaedia
Jump to navigation Jump to search
 
(9 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
==Re: The Info Popup==
 
==Re: The Info Popup==
  
"I just need to learn how to page break properly in the b-info pop-up window. This is my first wiki edit ever, so I learned a bunch watching your updates."
+
10-4. I put the current mediocre rank icons up this morning, I think.  Certainly looking forward to them being upgraded.  I'm so glad you made the [[Template:Ability (LW2)]]. The old one was atrocious to add to. I just need to learn how to page break properly in the <code>b-info</code> pop-up window.<br/>
 +
This is my first wiki edit ever, so I learned a bunch watching your updates. I never would've thought about putting the extra info on a mouse-over, or how to do it.  BTW, if you think your question mark is poor, [[:File:Questionmark_yellow_(LW2).png|check out what I uploaded, lol]].<br/>
 +
I'll be filling out more text info for now, and working on the Psi Operative Tree.<br/>
 +
Oh, and I just learned about <nowiki>'~~~~'</nowiki>. <Phew>. --[[User:HubrisBliss|HubrisBliss]] ([[User talk:HubrisBliss|talk]]) 23:30, 27 January 2017 (UTC)
 +
:Glad I could teach by doing. :) (Though regexes and Pywikibot helped a lot in sorting those ability templates.) As for the info pop-up, I've never been able to get title text to respect breaks on a wiki. I think it's still possible, but would require tweaking the CSS used by the wiki to add a new class for these images specifically. --Tvol (talk) 23:59, 27 January 2017 (UTC)
 +
:Oh, and I forgot to mention, that this line-break issue is part of the reason I moved the info bits to their own sub-pages. (Or will be moving them.) That way it's easy to transclude those lists elsewhere, in-case there's need of a stop-gap of some sort. --Tvol (talk) 00:12, 28 January 2017 (UTC)
 +
::Specifically, where are you moving the info bits?  Not the individual perk templates? i.e. [[Template:Alpha Mike Foxtrot (LW2)]], after <code>| s_info =</code>.  If somewhere else, please point me there. --[[User:HubrisBliss|HubrisBliss]] ([[User talk:HubrisBliss|talk]]) 00:37, 28 January 2017 (UTC)
 +
::: Ah, okay. Here goes my explanation. I'm moving the lists of extra/extended info to sub-pages of their respective templates. This means that for [[Template:Alpha Mike Foxtrot (LW2)]], the info text (and ''just'' the info text) would be on the page [[Template:Alpha Mike Foxtrot (LW2)/Info]]. Note the <code>/Info</code> part. Then the template itself should be edited so that it reads <code><nowiki>{{ {{subst:FULLPAGENAME}}/Info }}</nowiki></code> and saved. When it is saved, the <code>subst:</code> part will convert the FULLPAGENAME magic word into raw text, and the result will be, in this example, <code>{{ Template:Alpha Mike Foxtrot (LW2)/Info }}</code>. This will make sure that it references its own Info sub-page correctly no matter where it is used on the wiki. You can see an example at [[Template:Heavy_Weapons_(LW2)]] and [[Template:Heavy_Weapons_(LW2)/Info]], as well as more info about [https://www.mediawiki.org/wiki/Transclusion transclusion here.]
 +
::: The payoff here is that should anyone want to reference the perk's extra info text somewhere else, they don't need to duplicate it, just use transclusion to refer to it, keeping things DRY (a software engineering principle, "Don't Repeat Yourself", but it applies equally well to wikis). This could be used, for example, to display all the info text underneath the ability icon, or next to it, or in a different cell in a table, etc. It's a just-in-case thing but could save headache later. --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 01:01, 28 January 2017 (UTC)
 +
::::All makes sense.  Just wanted to avoid adding text in the wrong spot.  For now, I'm finding new things to do, but I will plan on adding text later after you have created the respective <code>*/Info</code> pages.<br/>Expect a simple unit navbar at the bottom of the class pages fairly soon.  I'm already frustrated trying to jump between them. --[[User:HubrisBliss|HubrisBliss]] ([[User talk:HubrisBliss|talk]]) 01:16, 28 January 2017 (UTC)
 +
:::::Right! Navbars! Those too! As for the /Info pages, don't be afraid to make them yourself. There's nothing special that needs to be done other than what I put above. Besides moving the that text to the new pages is going to be a chore. I can use Pywikibot to generate a list of the pages that match a regex that looks for that pattern, but grabbing it and moving it to another page isn't something it's built for. (I have no doubt it can do it, but I'd have to dig into the guts of the thing and extend it myself, which I'm not keen on right now. :P ) --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 01:21, 28 January 2017 (UTC)
  
Glad I could teach by doing. :) (Though regexes and Pywikibot helped a lot in sorting those ability templates.) As for the info pop-up, I've never been able to get title text to respect breaks on a wiki. I think it's still possible, but would require tweaking the CSS used by the wiki to add a new class for these images specifically. --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 23:59, 27 January 2017 (UTC)
+
== Perk Images ==
  
Oh, and I forgot to mention, that this line-break issue is part of the reason I moved the info bits to their own sub-pages. (Or will be moving them.) That way it's easy to transclude those lists elsewhere, in-case there's need of a stop-gap of some sort. --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 00:12, 28 January 2017 (UTC)
+
Metric ass-load of perk images incoming. [[:Category:Perk Images (XCOM 2)]] has all the ones I extracted from XCOM 2. I forgot to tag the Long War 2 ones properly, but I'll figure-out a way to fix that shortly (I hope). Tomorrow I'll see if I can't throw these through Photoshop and get a niceish border around them. The icons are actually setup already for a nice square border, just need to figure-out how to do it. --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 03:15, 28 January 2017 (UTC)
 +
 
 +
== Templates ==
 +
 
 +
If you want to make sure the Info pages are only called when the associated Info page exists, you can use [https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions#.23ifexist #ifexist]:
 +
 
 +
<pre>
 +
{{ #ifexist | Template:Title_(LW2)/Info | {{ Template:Title_(LW2)/Info }} |}}
 +
</pre>
 +
 
 +
That'll only make the template call if it's associated info page exists. Otherwise it'll be left blank. (Which should be okay as long as I didn't derp the template defaults.) It's a good idea to have that check there; one of us can incorporate that check into {{Tl|Ability_(LW2)}} and I can run the bot over all the ability templates so that they just provide the page title, not a transclusion directly. Unfortunately the title does have to be hardcoded and passed to {{tl|Ability_(LW2)}} to make the check work on that page instead of repeating it for each ability template. In any case my end-goal for template design is always to push as much of the decision-making to the base template (in this case {{tl|Ability_(LW2)}}) as is reasonable. (Don't be afraid to ask me to do any tedious tasks with the bot either. :) Replacing defaults on each template or the like is a long slog without it. Been there, done that. I'm using [https://www.mediawiki.org/wiki/Manual:Pywikibot Pywikibot], so there are plenty of powerful tools to do that sort of text replacement and more.)
 +
 
 +
As for the defaults on ability templates, may I ask your reasoning as to setting them all to be visible? My thinking was that having them not be visible by default makes it easier to inline them (it won't work right now because I used divs and not spans because I'm a derp but I plan to rejig that later). So instead of this:
 +
 
 +
<pre>
 +
The assault's primary ability is slash {{Slash_(LW2) | b_info = 0 | b_descr = 0 | b_name = 0 }}.
 +
</pre>
 +
 
 +
It'd be:
 +
 
 +
<pre>
 +
The assault's primary ability is slash {{Slash_(LW2) | b_name = 0 }}
 +
</pre>
 +
 
 +
In fact there might be an argument to be made to have them all default to not being visible. I think minimizing the amount of markup for when using it inline would make writing with them easier. To make it even more useful we could get the image to link to the right class page, but will have to handle cases where two classes have the same skill somehow. Maybe a disambiguation page for those.
 +
 
 +
Cheers. :) --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 23:38, 1 February 2017 (UTC)
 +
 
 +
 
 +
: Unfortunately #ifexist is what's known as an "expensive" parser function. On this wiki there is a limit of 100 of such functions per page. After that limit they return false no matter what. So I won't be adding that to the Ability template, since it already gets called a lot on each class page. To do so would be an irresponsible use of server resources. The good news is that the functionality can be replicated by using CSS selectors. The bad news is that (I sound like a broken record at this point) I need access to the wiki's CSS to implement such a solution. --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 03:42, 4 February 2017 (UTC)
 +
 
 +
:: Alright. I'm 90% sure now that I have {{tl|Ability (LW2)}} in a finished state. I had to move the constants (defaults) used to {{tl|Ability (LW2)/Constants}} There are two minor improvements I want to make, but the first shouldn't effect anything (I just want to give the option to place the name in front of the image), and the other one (making the info icon interactive) requires CSS. --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 08:50, 4 February 2017 (UTC)
 +
 
 +
== Replied ==
 +
 
 +
See my talk page. Bottom line, don't worry about breaking anything or making "mistakes". It's all good. :D --[[User:Tvol|Tvol]] ([[User talk:Tvol|talk]]) 02:54, 4 February 2017 (UTC)

Latest revision as of 08:50, 4 February 2017

Heya. I like where you're going with Template:Class Tree (LW2). Just so you know I have a pile of images including rank, class, and ability icons all pulled from the game's files (they're even PNGs so have transparency :D ) ready to upload. I'll be doing that as a batch job later today (just in case you were thinking of doing it manually, which would suck...a lot). The darker scheme for the class tree will certainly look good with the icons I've pulled. --Tvol (talk) 22:40, 27 January 2017 (UTC)

Re: The Info Popup

10-4. I put the current mediocre rank icons up this morning, I think. Certainly looking forward to them being upgraded. I'm so glad you made the Template:Ability (LW2). The old one was atrocious to add to. I just need to learn how to page break properly in the b-info pop-up window.
This is my first wiki edit ever, so I learned a bunch watching your updates. I never would've thought about putting the extra info on a mouse-over, or how to do it. BTW, if you think your question mark is poor, check out what I uploaded, lol.
I'll be filling out more text info for now, and working on the Psi Operative Tree.
Oh, and I just learned about '~~~~'. <Phew>. --HubrisBliss (talk) 23:30, 27 January 2017 (UTC)

Glad I could teach by doing. :) (Though regexes and Pywikibot helped a lot in sorting those ability templates.) As for the info pop-up, I've never been able to get title text to respect breaks on a wiki. I think it's still possible, but would require tweaking the CSS used by the wiki to add a new class for these images specifically. --Tvol (talk) 23:59, 27 January 2017 (UTC)
Oh, and I forgot to mention, that this line-break issue is part of the reason I moved the info bits to their own sub-pages. (Or will be moving them.) That way it's easy to transclude those lists elsewhere, in-case there's need of a stop-gap of some sort. --Tvol (talk) 00:12, 28 January 2017 (UTC)
Specifically, where are you moving the info bits? Not the individual perk templates? i.e. Template:Alpha Mike Foxtrot (LW2), after | s_info =. If somewhere else, please point me there. --HubrisBliss (talk) 00:37, 28 January 2017 (UTC)
Ah, okay. Here goes my explanation. I'm moving the lists of extra/extended info to sub-pages of their respective templates. This means that for Template:Alpha Mike Foxtrot (LW2), the info text (and just the info text) would be on the page Template:Alpha Mike Foxtrot (LW2)/Info. Note the /Info part. Then the template itself should be edited so that it reads {{ {{subst:FULLPAGENAME}}/Info }} and saved. When it is saved, the subst: part will convert the FULLPAGENAME magic word into raw text, and the result will be, in this example,
The payoff here is that should anyone want to reference the perk's extra info text somewhere else, they don't need to duplicate it, just use transclusion to refer to it, keeping things DRY (a software engineering principle, "Don't Repeat Yourself", but it applies equally well to wikis). This could be used, for example, to display all the info text underneath the ability icon, or next to it, or in a different cell in a table, etc. It's a just-in-case thing but could save headache later. --Tvol (talk) 01:01, 28 January 2017 (UTC)
All makes sense. Just wanted to avoid adding text in the wrong spot. For now, I'm finding new things to do, but I will plan on adding text later after you have created the respective */Info pages.
Expect a simple unit navbar at the bottom of the class pages fairly soon. I'm already frustrated trying to jump between them. --HubrisBliss (talk) 01:16, 28 January 2017 (UTC)
Right! Navbars! Those too! As for the /Info pages, don't be afraid to make them yourself. There's nothing special that needs to be done other than what I put above. Besides moving the that text to the new pages is going to be a chore. I can use Pywikibot to generate a list of the pages that match a regex that looks for that pattern, but grabbing it and moving it to another page isn't something it's built for. (I have no doubt it can do it, but I'd have to dig into the guts of the thing and extend it myself, which I'm not keen on right now. :P ) --Tvol (talk) 01:21, 28 January 2017 (UTC)

Perk Images

Metric ass-load of perk images incoming. Category:Perk Images (XCOM 2) has all the ones I extracted from XCOM 2. I forgot to tag the Long War 2 ones properly, but I'll figure-out a way to fix that shortly (I hope). Tomorrow I'll see if I can't throw these through Photoshop and get a niceish border around them. The icons are actually setup already for a nice square border, just need to figure-out how to do it. --Tvol (talk) 03:15, 28 January 2017 (UTC)

Templates

If you want to make sure the Info pages are only called when the associated Info page exists, you can use #ifexist:

{{ #ifexist | Template:Title_(LW2)/Info | {{ Template:Title_(LW2)/Info }} |}}

That'll only make the template call if it's associated info page exists. Otherwise it'll be left blank. (Which should be okay as long as I didn't derp the template defaults.) It's a good idea to have that check there; one of us can incorporate that check into {{Ability_(LW2)}} and I can run the bot over all the ability templates so that they just provide the page title, not a transclusion directly. Unfortunately the title does have to be hardcoded and passed to {{Ability_(LW2)}} to make the check work on that page instead of repeating it for each ability template. In any case my end-goal for template design is always to push as much of the decision-making to the base template (in this case {{Ability_(LW2)}}) as is reasonable. (Don't be afraid to ask me to do any tedious tasks with the bot either. :) Replacing defaults on each template or the like is a long slog without it. Been there, done that. I'm using Pywikibot, so there are plenty of powerful tools to do that sort of text replacement and more.)

As for the defaults on ability templates, may I ask your reasoning as to setting them all to be visible? My thinking was that having them not be visible by default makes it easier to inline them (it won't work right now because I used divs and not spans because I'm a derp but I plan to rejig that later). So instead of this:

The assault's primary ability is slash {{Slash_(LW2) | b_info = 0 | b_descr = 0 | b_name = 0 }}.

It'd be:

The assault's primary ability is slash {{Slash_(LW2) | b_name = 0 }}

In fact there might be an argument to be made to have them all default to not being visible. I think minimizing the amount of markup for when using it inline would make writing with them easier. To make it even more useful we could get the image to link to the right class page, but will have to handle cases where two classes have the same skill somehow. Maybe a disambiguation page for those.

Cheers. :) --Tvol (talk) 23:38, 1 February 2017 (UTC)


Unfortunately #ifexist is what's known as an "expensive" parser function. On this wiki there is a limit of 100 of such functions per page. After that limit they return false no matter what. So I won't be adding that to the Ability template, since it already gets called a lot on each class page. To do so would be an irresponsible use of server resources. The good news is that the functionality can be replicated by using CSS selectors. The bad news is that (I sound like a broken record at this point) I need access to the wiki's CSS to implement such a solution. --Tvol (talk) 03:42, 4 February 2017 (UTC)
Alright. I'm 90% sure now that I have {{Ability (LW2)}} in a finished state. I had to move the constants (defaults) used to {{Ability (LW2)/Constants}} There are two minor improvements I want to make, but the first shouldn't effect anything (I just want to give the option to place the name in front of the image), and the other one (making the info icon interactive) requires CSS. --Tvol (talk) 08:50, 4 February 2017 (UTC)

Replied

See my talk page. Bottom line, don't worry about breaking anything or making "mistakes". It's all good. :D --Tvol (talk) 02:54, 4 February 2017 (UTC)