「モジュール:SMWメンバー情報」の版間の差分

Motodai (トーク | 投稿記録)
グループごとの選抜、センター回数がゼロならカウントしない。ただし、選抜回数合計はゼロでもプロパティに反映する
Motodai (トーク | 投稿記録)
5行目、書き方を訂正
 
(同じ利用者による、間の9版が非表示)
3行目: 3行目:
local function setProperty(dataStore)
local function setProperty(dataStore)
   -- メイン空間のみ
   -- メイン空間のみ
   if not mw.title.getCurrentTitle().namespace == 0 then
   if mw.title.getCurrentTitle().namespace ~= 0 then
       return true;
       return true;
   end
   end
110行目: 110行目:
   end
   end
   -- Add the total selection times to the dataStore
   -- Add the total selection times to the dataStore
   if total_c > 0 then
   dataStore["センター回数合計"] = total_c
    dataStore["センター回数合計"] = total_c
  end


   local generation = ''
   local generation = ''
125行目: 123行目:
   dataStore["選抜回数"] = {}
   dataStore["選抜回数"] = {}


   local lines_s = mw.text.split(args["選抜回数"] or "", '<br>')
   local lines_s = mw.text.split(args["選抜回数"] or "0回", '<br>')
   mw.logObject(lines_s)
   mw.logObject(lines_s)
   local total_s = 0
   local total_s = 0
153行目: 151行目:
   dataStore["センター回数"] = {}
   dataStore["センター回数"] = {}


   local lines_c = mw.text.split(args["センター回数"] or "", '<br>')
   local lines_c = mw.text.split(args["センター回数"] or "0回", '<br>')
   mw.logObject(lines_c)
   mw.logObject(lines_c)
   local total_c = 0
   local total_c = 0
175行目: 173行目:
   end
   end
   -- Add the total selection times to the dataStore
   -- Add the total selection times to the dataStore
 
   dataStore["センター回数合計"] = total_c
   if total_c > 0 then
    dataStore["センター回数合計"] = total_c
  end
 
   setProperty(dataStore);
   setProperty(dataStore);