Difference between revisions of "GenreCatNav"

From Sega Retro

 
(42 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly>{| class="bottomtemplate" align="left"
+
<div style="display:none;">{{#vardefine:genre|{{#if:{{#pos:{{PAGENAME}}|action}}|action|{{
 +
#if:{{#pos:{{PAGENAME}}|adventure}}|adventure|{{
 +
#if:{{#pos:{{PAGENAME}}|compilations}}|compilation|{{
 +
#if:{{#pos:{{PAGENAME}}|demo discs}}|demo|{{
 +
#if:{{#pos:{{PAGENAME}}|educational}}|educational|{{
 +
#if:{{#pos:{{PAGENAME}}|fighting}}|fighting|{{
 +
#if:{{#pos:{{PAGENAME}}|miscellaneous}}|miscellaneous|{{
 +
#if:{{#pos:{{PAGENAME}}|puzzle}}|puzzle|{{
 +
#if:{{#pos:{{PAGENAME}}|RPGs}}|RPGs|{{
 +
#if:{{#pos:{{PAGENAME}}|racing}}|racing|{{
 +
#if:{{#pos:{{PAGENAME}}|shoot}}|shoot|{{
 +
#if:{{#pos:{{PAGENAME}}|simulation}}|simulation|{{
 +
#if:{{#pos:{{PAGENAME}}|sports}}|sports|{{
 +
#if:{{#pos:{{PAGENAME}}|table}}|table|}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{{#switch:{{#var:genre}}|
 +
|action={{#vardefine:icon|Genre action.svg}}{{#vardefine:category|action games}}
 +
|adventure={{#vardefine:icon|Genre adventure.svg}}{{#vardefine:category|adventure games}}
 +
|compilation={{#vardefine:icon|}}{{#vardefine:category|game compilations}}
 +
|demo={{#vardefine:icon|}}{{#vardefine:category|demo discs}}
 +
|educational={{#vardefine:icon|Genre edu.svg}}{{#vardefine:category|educational games}}
 +
|fighting={{#vardefine:icon|Genre fighting.png}}{{#vardefine:category|fighting games}}
 +
|miscellaneous={{#vardefine:icon|}}{{#vardefine:category|miscellaneous software}}
 +
|puzzle={{#vardefine:icon|Genre puzzle.svg}}{{#vardefine:category|puzzle games}}
 +
|RPGs={{#vardefine:icon|Genre rpg.svg}}{{#vardefine:category|RPGs}}
 +
|racing={{#vardefine:icon|Genre racing.svg}}{{#vardefine:category|racing games}}
 +
|shoot={{#vardefine:icon|Genre shmup.svg}}{{#vardefine:category|shoot-'em-up games}}
 +
|simulation={{#vardefine:icon|Genre simulation.svg}}{{#vardefine:category|simulation games}}
 +
|sports={{#vardefine:icon|Genre sports.svg}}{{#vardefine:category|sports games}}
 +
|table={{#vardefine:icon|Genre home.png}}{{#vardefine:category|table games}}
 +
}}</div>{{#if:{{#var:icon}}|[[File:{{#var:icon}}|right|200px]]}}{{#ifeq:{{NAMESPACE}}|Category|[[Category:{{#var:category}}]][[Category:{{{1}}} games by genre]]}}
 +
{| class="toc plainlinks noprint" align="left"
 
|-
 
|-
|class="bottomtemptext" align="left" |'''[[:Category:{{{1}}} Games|{{{1}}} Games]] by [[Sega Retro:Determining Genre|Genre]]:''' {{ #switch: {{{1}}}
+
|class="bottomtemptext" align="left" style="text-align:center; padding:0px;"| <div style="margin-top:-5px; margin-bottom:5px;">'''[[:Category:{{{1}}} games|{{{1}}} games]] by [[Sega Retro:Determining Genre|Genre]]:'''</div>
| Saturn
+
{{#vardefine:catdata|action games,Genre action.svg,Action;
| Dreamcast = [[:Category:{{{1}}} 3D Action Games|3D Action]] • [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Game Compilations|Compilation]] • [[:Category:{{{1}}} Demo Discs|Demo Discs]] • [[:Category:{{{1}}} Fighting Games|Fighting]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} RPGs|RPGs]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Shooting Games|Shooting]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Strategy Games|Strategy]]
+
adventure games,Genre adventure.svg,Adventure;
| 32X = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] • [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} Fighting Games|Fighting]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} RPGs|RPG]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Strategy Games|Strategy]]
+
game compilations,Notavailable.svg,Compilation;
| #default = [[:Category:{{{1}}} Action Games|Action]] • [[:Category:{{{1}}} Adventure Games|Adventure]] [[:Category:{{{1}}} Educational Games|Educational]] • [[:Category:{{{1}}} Puzzle Games|Puzzle]] • [[:Category:{{{1}}} Racing Games|Racing]] • [[:Category:{{{1}}} RPGs|RPG]] • [[:Category:{{{1}}} Shoot-'em-Up Games|Shoot-'em-Up]] • [[:Category:{{{1}}} Sports Games|Sports]] • [[:Category:{{{1}}} Strategy Games|Strategy]]
+
demo discs,Notavailable.svg,Demo Disc;
 +
educational games,Genre edu.svg,Educational;
 +
fighting games,Genre fighting.png,Fighting;
 +
miscellaneous software,Notavailable.svg,Misc.;
 +
puzzle games,Genre puzzle.svg,Puzzle;
 +
RPGs,Genre rpg.svg,RPG;
 +
racing games,Genre racing.svg,Racing;
 +
shoot-'em-up games,Genre shmup.svg,Shooting;
 +
simulation games,Genre simulation.svg,Simulation;
 +
sports games,Genre sports.svg,Sport;
 +
table games,Genre home.png,Table
 +
}}{{#vardefine:i|0}}{{#vardefine:j|0}}{{#while:
 +
| {{#ifexpr: {{#len:{{#explode:{{#var:catdata}}|;|{{#var:i}}}}}} > 0 | true }}
 +
| {{#vardefine:catdatasub|{{#explode:{{#var:catdata}}|;|{{#var:i}}}}}}{{#vardefine:catname|{{#explode:{{#var:catdatasub}}|,|0}}}}{{#vardefine:catimg|{{#explode:{{#var:catdatasub}}|,|1}}}}{{#vardefine:catshort|{{#explode:{{#var:catdatasub}}|,|2}}}}
 +
{{#if:{{ifexists|Category:{{{1}}} {{#var:catname}}}} | {{incvar|j}}<div style="display:inline-block; text-align:center; padding-top:4px; width:76px; {{#ifeq: {{#expr:{{#var:j}} mod 2}} | 1 | background:#DDDDDD;}}">[[File:{{#var:catimg}}|40px|link=Category:{{{1}}} {{#var:catname}}]]<br>[[:Category:{{{1}}} {{#var:catname}}|{{#var:catshort}}]]<br>{{PAGESINCATEGORY:{{{1}}} {{#var:catname}}}} pages</div> }}
 +
{{incvar|i}}
 
}}
 
}}
|}</includeonly>
+
|}
<br clear="all">
+
{{clear}}<noinclude>
<noinclude>
+
==Usage==
<nowiki>{{</nowiki>GenreCatNav|system}}
+
<pre>{{GenreCatNav|system}}</pre>
system will use the pre-Saturn set for pre-Saturn systems and the Saturn/Dreamcast set for Saturn and Dreamcast; see [[Sega Retro:Determining Genre]]. 32X will load its own set, as it adds the Fighting category on top of the pre-Saturn set. For example,
+
 
 +
===Examples===
 
  <nowiki>{{</nowiki>GenreCatNav|Mega Drive}}
 
  <nowiki>{{</nowiki>GenreCatNav|Mega Drive}}
 
becomes
 
becomes
Line 19: Line 64:
 
becomes
 
becomes
 
{{GenreCatNav|Saturn}}
 
{{GenreCatNav|Saturn}}
[[Category:Navigational Templates]]
+
 
 +
[[Category:Navigational templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 09:39, 3 November 2022

Genre action.svg

Usage

{{GenreCatNav|system}}

Examples

{{GenreCatNav|Mega Drive}}

becomes

Genre action.svg

and

{{GenreCatNav|Saturn}}

becomes

Genre action.svg