• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
m
no edit summary
Line 2: Line 2:     
local getArgs = require("Module:GetArgs")
 
local getArgs = require("Module:GetArgs")
local format = require("Module:StringOperations").format
+
local Utils = require("Module:Core")
local Utils = require("Module:Utils")
+
local format = Utils.format
 
local BaseData = require("Module:BaseData")
 
local BaseData = require("Module:BaseData")
   Line 25: Line 25:  
|- class="mw-customtoggle-${id}" style="cursor:pointer;"
 
|- class="mw-customtoggle-${id}" style="cursor:pointer;"
 
!colspan="3"|${title}
 
!colspan="3"|${title}
|- class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${id}"
+
|- class="mw-collapsible ${collapsed}" id="mw-customcollapsible-${id}"
 
!colspan="2"|Nodes||Rules
 
!colspan="2"|Nodes||Rules
 
${rows}
 
${rows}
 
|}]],
 
|}]],
   −
     _row_start_template = [[|- class="mw-collapsible mw-collapsed"  id="mw-customcollapsible-${id}"
+
     _row_start_template = [[|- class="mw-collapsible ${collapsed}"  id="mw-customcollapsible-${id}"
 
|rowspan="${rowspan}" style="text-align:center;vertical-align:middle;width:50px;"|${from}]],
 
|rowspan="${rowspan}" style="text-align:center;vertical-align:middle;width:50px;"|${from}]],
   −
     _row_separator_template = [[|- class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${id}"
+
     _row_separator_template = [[|- class="mw-collapsible ${collapsed}" id="mw-customcollapsible-${id}"
 
]],
 
]],
   −
     _row_template = [[${separator}|class="mw-collapsible mw-collapsed" id="mw-customcollapsible-${id}" style="text-align:center;width:50px;"|${to}${rules}]],
+
     _row_template = [[${separator}|class="mw-collapsible ${collapsed}" id="mw-customcollapsible-${id}" style="text-align:center;width:50px;"|${to}${rules}]],
    
     _rules = "\n|rowspan=\"${span}\" style=\"padding:10px;\"|\n${rules}",
 
     _rules = "\n|rowspan=\"${span}\" style=\"padding:10px;\"|\n${rules}",
    
     -- .kcRoute is defined in MediaWiki:Common.css
 
     -- .kcRoute is defined in MediaWiki:Common.css
     _node_template = [[<div class="kcRoute" style="vertical-align:middle"><div class="${class}" style="${style}">${label}</div></div>]],
+
     _node_template = [[<div class="maproute" style="vertical-align:middle"><div class="${class}" style="${style}">${label}</div></div>]],
 
      
 
      
 
     _node_color1 = [[background: ${color};]],
 
     _node_color1 = [[background: ${color};]],
Line 60: Line 60:  
         nightday_night = { "battle", "night", "night", "night" },
 
         nightday_night = { "battle", "night", "night", "night" },
 
         night_battle_empty = { "night", "battle", "empty" },
 
         night_battle_empty = { "night", "battle", "empty" },
 +
        ambush = { "battle", "orange", "battle", "orange" },
 
     },
 
     },
   Line 81: Line 82:  
     self._vars = {
 
     self._vars = {
 
         id = args.id or args.title and make_id_from_title(args.title) or self._id,
 
         id = args.id or args.title and make_id_from_title(args.title) or self._id,
        -- id = args.id or args.title and make_id_from_title(args.title) or remiLib.timeHash(args) or self._id,
   
         title = args.title or self._title,
 
         title = args.title or self._title,
 
         width = args.width or self._width,
 
         width = args.width or self._width,
 
         branching = { index = {} },
 
         branching = { index = {} },
 +
        collapsed = args.expand and "" or "mw-collapsed",
 
     }
 
     }
 
     local branching = self._vars.branching
 
     local branching = self._vars.branching
Line 197: Line 198:  
         self._node_template,
 
         self._node_template,
 
         label = label,
 
         label = label,
         class = #label > 1 and "kcRouteNodeWide" or "kcRouteNode",
+
         class = #label > 1 and "mapnodewide" or "mapnode",
 
         style = style
 
         style = style
 
     }
 
     }
Line 211: Line 212:  
             from = self:format_node(from_node, branching[from_node].colors),
 
             from = self:format_node(from_node, branching[from_node].colors),
 
             id = self._vars.id,
 
             id = self._vars.id,
 +
            collapsed = self._vars.collapsed,
 
         })
 
         })
 
         local first = true
 
         local first = true
Line 216: Line 218:  
             table.insert(rows, format{
 
             table.insert(rows, format{
 
                 self._row_template,
 
                 self._row_template,
                 separator = first and "" or format{self._row_separator_template, id = self._vars.id},
+
                 separator = first and "" or format{
 +
                    self._row_separator_template,
 +
                    id = self._vars.id,
 +
                    collapsed = self._vars.collapsed,
 +
                },
 
                 to = self:format_node(to_node, branching[from_node][to_node].colors),
 
                 to = self:format_node(to_node, branching[from_node][to_node].colors),
 
                 rules = branching[from_node][to_node].rules and format{
 
                 rules = branching[from_node][to_node].rules and format{
Line 224: Line 230:  
                 } or "",
 
                 } or "",
 
                 id = self._vars.id,
 
                 id = self._vars.id,
 +
                collapsed = self._vars.collapsed,
 
             })
 
             })
 
             first = false
 
             first = false
cssedit, gkautomate
6,928

edits

Navigation menu