• 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
Undo revision 921822 by がか (talk)
Line 1: Line 1: −
local Utils = require("Module:Utils")
  −
local format = require('Module:StringInterpolation').format
   
local BaseTable = require("Module:BaseTable")
 
local BaseTable = require("Module:BaseTable")
 
local EnemyShip = require("Module:EnemyShip")
 
local EnemyShip = require("Module:EnemyShip")
 
local Formatting = require('Module:Formatting')
 
local Formatting = require('Module:Formatting')
 
local ShipBattleCardKai = require("Module:ShipBattleCardKai")
 
local ShipBattleCardKai = require("Module:ShipBattleCardKai")
 +
 +
local format = require('Module:StringInterpolation').format
    
local NodeInfo = BaseTable({
 
local NodeInfo = BaseTable({
Line 94: Line 94:  
     end
 
     end
 
     return { values = { as = row.as }, color = color }
 
     return { values = { as = row.as }, color = color }
 +
end
 +
 +
function NodeInfo:upcase(str)
 +
    str = str:gsub("(%s)(%l)", function(a, b) return a .. string.upper(b) end)
 +
    str = str:gsub("^(%l)", function(a) return string.upper(a) end)
 +
    return str
 
end
 
end
   Line 187: Line 193:  
    end
 
    end
 
    elseif mode == 3 then
 
    elseif mode == 3 then
        resource = U.capitalize(item_key)
+
        resource = self:upcase(item_key)
 
        mode = 4
 
        mode = 4
 
    elseif mode == 4 then
 
    elseif mode == 4 then
Line 199: Line 205:  
        mode = 1
 
        mode = 1
 
    elseif mode == 5 then
 
    elseif mode == 5 then
        formation = U.capitalize(item_key)
+
        formation = self:upcase(item_key)
 
        mode = 6
 
        mode = 6
 
    else
 
    else
Line 367: Line 373:  
                table.insert(self._rows, format{self._selection_node_template, values = { node = Formatting:japanese_text(values[1]) } })
 
                table.insert(self._rows, format{self._selection_node_template, values = { node = Formatting:japanese_text(values[1]) } })
 
             else
 
             else
                local resource = Formatting:format_image{values[2] .. ".png", caption = U.capitalize(values[2]), size = "22x22px"}
+
                local resource = Formatting:format_image{values[2] .. ".png", caption = self:upcase(values[2]), size = "22x22px"}
 
                local text, node_type, bg_color = self:process_resource_node(resource, values[3])
 
                local text, node_type, bg_color = self:process_resource_node(resource, values[3])
 
                local color = "initial"
 
                local color = "initial"
cssedit, gkautomate
7,064

edits

Navigation menu