×
Einen neuen Artikel erstellen
Schreibe den Seitennamen hierhin:
Wir haben derzeit 9.055 Artikel auf Vaultpedia. Gib deinen Artikelnamen oberhalb von oder klicke auf einen der unten stehenden Titel und beginne zu schreiben! ein



    Vaultpedia
    9.055Artikel

    Modul:Games: Unterschied zwischen den Versionen

    Tritt unserem Discord bei und informiere dich auf unserem Twitter-Kanal über die aktuellsten Themen rund um Fallout!
    Huu.Psii (Diskussion | Beiträge)
    Keine Bearbeitungszusammenfassung
    Huu.Psii (Diskussion | Beiträge)
    Keine Bearbeitungszusammenfassung
    Zeile 80: Zeile 80:
    }
    }


    -- look up short title without disambig
    -- Funktion zur Suche nach einem kurzen Titel ohne Begriffsklärung
    function stitle(game)
    function stitle(game)
         local result = games[game] or game
         local result = games[game] or game
    Zeile 90: Zeile 90:


    -- ====================
    -- ====================
    -- This function, links, is for ordinary links within the body of
    -- Diese Funktion, links, ist für gewöhnliche Links innerhalb des
    -- an infobox. So if all you want returned is [[Fallout 4]], then
    -- Inhalts einer Infobox gedacht. Wenn du nur [[Fallout 4]]  
    -- use the syntax:
    -- zurückgeben möchtest, dann verwende die Syntax:
    --        {{#invoke:Games|links|{{{games|}}}}}
    --        {{#invoke:Games|links|{{{games|}}}}}
    -- specifying a second argument returns the text in italics:
    -- Die Angabe eines zweiten Arguments gibt den Text kursiv zurück:
    --        {{#invoke:Games|links|{{{games|}}}|1}}
    --        {{#invoke:Games|links|{{{games|}}}|1}}
    -- ====================
    -- ====================
    Zeile 121: Zeile 121:


    -- ====================
    -- ====================
    -- This function, title, generically generates links for the supertitle.
    -- Diese Funktion, title, generiert generisch Links für den Supertitel.
    -- Either just to the game page itself or to a more specific page.
    -- Entweder nur zur Spielseite selbst oder zu einer spezifischeren Seite.
    --
    --
    -- {{#invoke:Games|title|FO4}} gives just [[Fallout 4|Fallout 4]]
    -- {{#invoke:Games|title|FO4}} gibt einfach [[Fallout 4|Fallout 4]]
    -- {{#invoke:Games|title|FO4|weapons}} results in [[Fallout 4 weapons|Fallout 4]]
    -- {{#invoke:Games|title|FO4|weapons}} ergibt [[Weapons (Fallout 4)|Fallout 4]]
    -- {{#invoke:Games|title|FO4|weapons|weapon}} results in [[Fallout 4 weapons|Fallout 4 weapon]]
    -- {{#invoke:Games|title|FO4|weapons|weapon}} ergibt [[Weapons (Fallout 4)|Fallout 4: Weapon]]
    -- ====================
    -- ====================


    Zeile 134: Zeile 134:
         local game_list = mw.text.split(frame.args[1], "%s*,%s*")  
         local game_list = mw.text.split(frame.args[1], "%s*,%s*")  
         for n, game in ipairs(game_list) do
         for n, game in ipairs(game_list) do
             if game:lower() == "kein" or "none" then
             if game:lower() == "kein" or game:lower() == "none" then
                 result = 'Erwähnt'
                 result = 'Erwähnt'
                 if frame.args[3] then
                 if frame.args[3] then
    Zeile 142: Zeile 142:
                 local link
                 local link
                 if frame.args[2] then
                 if frame.args[2] then
                     link = stitle(game) .. ' ' .. frame.args[2]
                     link = frame.args[2]:sub(1,1):upper() .. frame.args[2]:sub(2) .. ' (' .. games[game] .. ')'
                 else
                 else
                     link = games[game]
                     link = games[game]
                 end
                 end
                 local text = stitle(game)
                 local text = games[game]
                 if frame.args[3] and n == #game_list then
                 if frame.args[3] then
                     text = text .. ' ' .. frame.args[3]
                     text = text .. ': ' .. frame.args[3]:sub(1,1):upper() .. frame.args[3]:sub(2)
                 end  
                 end  
                 result = result .. '[[' .. link .. '|' .. text .. ']]'
                 result = result .. '[[' .. link .. '|' .. text .. ']]'

    Version vom 8. Juli 2024, 18:08 Uhr

    Die Dokumentation für dieses Modul kann unter Modul:Games/Doku erstellt werden

    --<nowiki>
    
    local p = {}
    
    local games = {
        ["AR"] = "All Roads",
        ["D20"] = "Fallout Pen & Paper d20",
        ["FB"] = "Fallout Bible",
        ["FBG"] = "Fallout: The Board Game",
        ["FBGNC"] = "Fallout: New California",
        ["FILM"] = "Fallout (Film)",
        ["FNV"] = "Fallout: New Vegas",
        ["FNVGRA"] = "Gun Runners' Arsenal (Add-On)",
        ["FNVDM"] = "Dead Money (Add-On)",
        ["FNVHH"] = "Honest Hearts (Add-On)",
        ["FNVOWB"] = "Old World Blues (Add-On)",
        ["FNVLR"] = "Lonesome Road (Add-On)",
        ["FO1"] = "Fallout",
        ["FO2"] = "Fallout 2",
        ["FO3"] = "Fallout 3",
        ["FO3OA"] = "Operation: Anchorage (Add-On)",
        ["FO3TP"] = "The Pitt (Add-On)",
        ["FO3BS"] = "Broken Steel (Add-On)",
        ["FO3PL"] = "Point Lookout (Add-On)",
        ["FO3MZ"] = "Mothership Zeta (Add-On)",
        ["FO4"] = "Fallout 4",
        ["FO4AUT"] = "Automatron (Add-On)",
        ["FO4WW"] = "Wasteland Workshop (Add-On)",
        ["FO4FH"] = "Far Harbor (Add-On)",
        ["FO4CW"] = "Contraptions Workshop (Add-On)",
        ["FO4VW"] = "Vault-Tec Workshop (Add-On)",
        ["FO4NW"] = "Nuka-World (Add-On)",
        ["FO4VR"] = "Fallout 4 VR",
        ["FO4CC"] = "Creation Club",
        ["FO76"] = "Fallout 76",
        ["FO76WA"] = "Wild Appalachia",
        ["FO76NW"] = "Nuclear Winter",
        ["FO76WL"] = "Wastelanders",
        ["FO76LR"] = "Das legendäre Rennen (Update)",
        ["FO76OW"] = "Ein Ödland für alle",
        ["FO76FS"] = "Stählerne Dämmerung",
        ["FO76SD"] = "Stählerne Dämmerung",
        ["FO76LL"] = "Geladen und entsichert",
        ["FO76SR"] = "Stählerne Herrschaft",
        ["FO76FW"] = "Fallout Worlds (Update)",
        ["FO76IB"] = "Angreifer aus dem All (Update)",
        ["FO76NM"] = "Nacht der Motte",
        ["FO76TM"] = "Härteprüfung (Update)",
        ["FO76TP"] = "Expeditionen: The Pitt",
        ["FO76NT"] = "Nuka-World on Tour (Update)",
        ["FO76NWOT"] = "Nuka-World on Tour (Update)",
        ["FO76MI"] = "Mutations-Invasion",
        ["FO76OB"] = "Wenn die Sterne günstig stehen",
        ["FO76AC"] = "Expeditionen: Atlantic City",
        ["FO76BP"] = "AC Boardwalk Paradise",
        ["FO76AP"] = "AC America's Playground",
        ["FO76SV"] = "Skyline Valley (Update)",
        ["FOBOS"] = "Fallout: Brotherhood of Steel",
        ["FOBOS2"] = "Fallout: Brotherhood of Steel 2",
        ["FORPG"] = "Fallout: The Roleplaying Game",
        ["2D20"] = "Fallout: The Roleplaying Game",
        ["FORPGWOA"] = "Winter of Atom",
        ["FOS"] = "Fallout Shelter",
        ["FOSO"] = "Fallout Shelter Online",
        ["FOT"] = "Fallout Tactics",
        ["FOT2"] = "Fallout Tactics 2",
        ["FOTV"] = "Fallout (Fernsehserie)",
        ["FTV"] = "Fallout (Fernsehserie)",
        ["FOW"] = "Fallout: Warfare",
        ["FOX"] = "Fallout Extreme",
        ["FWW"] = "Fallout: Wasteland Warfare",
        ["FOWW"] = "Fallout: Wasteland Warfare",
        ["FOF"] = "Fallout: Factions",
        ["JES"] = "J.E. Sawyer's Fallout RPG",
        ["LH"] = "Lionheart",
        ["PA"] = "One Man, and a Crate of Puppets",
        ["PV13"] = "Project V13",
        ["TAR"] = "Project V13",
        ["VB"] = "Van Buren",
    }
    
    -- Funktion zur Suche nach einem kurzen Titel ohne Begriffsklärung
    function stitle(game)
        local result = games[game] or game
        if game ~= "FILM" then
            result = result:gsub('%s%(.*', '')
        end
        return result
    end
    
    -- ====================
    -- Diese Funktion, links, ist für gewöhnliche Links innerhalb des 
    -- Inhalts einer Infobox gedacht. Wenn du nur [[Fallout 4]] 
    -- zurückgeben möchtest, dann verwende die Syntax:
    --        {{#invoke:Games|links|{{{games|}}}}}
    -- Die Angabe eines zweiten Arguments gibt den Text kursiv zurück:
    --        {{#invoke:Games|links|{{{games|}}}|1}}
    -- ====================
    
    function p.links(frame)
        local result = ''
     
        local game_list = mw.text.split(frame.args[1], "%s*,%s*") 
        for n, game in ipairs(game_list) do
            if game:lower() == "kein" or "none" then
                result = ''
            else
                result = result .. '[[' .. games[game] .. '|' .. stitle(game) .. ']]'
                if n ~= #game_list then
                    result = result .. '<br/>'
                end
            end
        end
     
        if (frame.args[2] and result ~= '') then
            return "''" .. result .. "''"
        else
          return result
        end
    end
    
    -- ====================
    -- Diese Funktion, title, generiert generisch Links für den Supertitel.
    -- Entweder nur zur Spielseite selbst oder zu einer spezifischeren Seite.
    --
    -- {{#invoke:Games|title|FO4}} gibt einfach [[Fallout 4|Fallout 4]]
    -- {{#invoke:Games|title|FO4|weapons}} ergibt [[Weapons (Fallout 4)|Fallout 4]]
    -- {{#invoke:Games|title|FO4|weapons|weapon}} ergibt [[Weapons (Fallout 4)|Fallout 4: Weapon]]
    -- ====================
    
    function p.title(frame)
        local result = ''
     
        local game_list = mw.text.split(frame.args[1], "%s*,%s*") 
        for n, game in ipairs(game_list) do
            if game:lower() == "kein" or game:lower() == "none" then
                result = 'Erwähnt'
                if frame.args[3] then
                    result = result .. ' ' .. frame.args[3]
                end
            else
                local link
                if frame.args[2] then
                    link = frame.args[2]:sub(1,1):upper() .. frame.args[2]:sub(2) .. ' (' .. games[game] .. ')'
                else
                    link = games[game]
                end
                local text = games[game]
                if frame.args[3] then
                    text = text .. ': ' .. frame.args[3]:sub(1,1):upper() .. frame.args[3]:sub(2)
                end 
                result = result .. '[[' .. link .. '|' .. text .. ']]'
                if n ~= #game_list then
                    result = result .. ' / '
                end
            end
        end
     
        return result
    end
    
    
    return p
    
    --</nowiki>