Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
10 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
12 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
181 行
すべてコピー
8 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
178 行
すべてコピー
---- Unlike sandbox, we have teams to deal with, so here's an extra panel in the
---- Unlike sandbox, we have teams to deal with, so here's an extra panel in the
---- hierarchy that handles a set of player rows belonging to its team.
---- hierarchy that handles a set of player rows belonging to its team.
include("sb_row.lua")
include("sb_row.lua")
local function CompareScore(pa, pb)
local function CompareScore(pa, pb)
コピー
コピー済み
コピー
コピー済み
if not
IsValid
(pa) then return false end
if not
ValidPanel
(pa) then return false end
if not
IsValid
(pb) then return true end
if not
ValidPanel
(pb) then return true end
local a = pa:GetPlayer()
local a = pa:GetPlayer()
local b = pb:GetPlayer()
local b = pb:GetPlayer()
if not IsValid(a) then return false end
if not IsValid(a) then return false end
if not IsValid(b) then return true end
if not IsValid(b) then return true end
if a:Frags() == b:Frags() then return a:Deaths() < b:Deaths() end
if a:Frags() == b:Frags() then return a:Deaths() < b:Deaths() end
return a:Frags() > b:Frags()
return a:Frags() > b:Frags()
end
end
local PANEL = {}
local PANEL = {}
function PANEL:Init()
function PANEL:Init()
self.name = "Unnamed"
self.name = "Unnamed"
self.color = COLOR_WHITE
self.color = COLOR_WHITE
self.rows = {}
self.rows = {}
self.rowcount = 0
self.rowcount = 0
self.rows_sorted = {}
self.rows_sorted = {}
self.group = "spec"
self.group = "spec"
end
end
function PANEL:SetGroupInfo(name, color, group)
function PANEL:SetGroupInfo(name, color, group)
self.name = name
self.name = name
self.color = color
self.color = color
self.group = group
self.group = group
end
end
local bgcolor = Color(20,20,20, 150)
local bgcolor = Color(20,20,20, 150)
function PANEL:Paint()
function PANEL:Paint()
-- Darkened background
-- Darkened background
draw.RoundedBox(8, 0, 0, self:GetWide(), self:GetTall(), bgcolor)
draw.RoundedBox(8, 0, 0, self:GetWide(), self:GetTall(), bgcolor)
surface.SetFont("treb_small")
surface.SetFont("treb_small")
-- Header bg
-- Header bg
local txt = self.name .. " (" .. self.rowcount .. ")"
local txt = self.name .. " (" .. self.rowcount .. ")"
local w, h = surface.GetTextSize(txt)
local w, h = surface.GetTextSize(txt)
draw.RoundedBox(8, 0, 0, w + 24, 20, self.color)
draw.RoundedBox(8, 0, 0, w + 24, 20, self.color)
-- Shadow
-- Shadow
surface.SetTextPos(11, 11 - h/2)
surface.SetTextPos(11, 11 - h/2)
surface.SetTextColor(0,0,0, 200)
surface.SetTextColor(0,0,0, 200)
surface.DrawText(txt)
surface.DrawText(txt)
-- Text
-- Text
surface.SetTextPos(10, 10 - h/2)
surface.SetTextPos(10, 10 - h/2)
surface.SetTextColor(255,255,255,255)
surface.SetTextColor(255,255,255,255)
surface.DrawText(txt)
surface.DrawText(txt)
-- Alternating row background
-- Alternating row background
local y = 24
local y = 24
for i, row in ipairs(self.rows_sorted) do
for i, row in ipairs(self.rows_sorted) do
if (i % 2) != 0 then
if (i % 2) != 0 then
surface.SetDrawColor(75,75,75, 100)
surface.SetDrawColor(75,75,75, 100)
surface.DrawRect(0, y, self:GetWide(), row:GetTall())
surface.DrawRect(0, y, self:GetWide(), row:GetTall())
end
end
y = y + row:GetTall() + 1
y = y + row:GetTall() + 1
end
end
-- Column darkening
-- Column darkening
local scr = sboard_panel.ply_frame.scroll.Enabled and 16 or 0
local scr = sboard_panel.ply_frame.scroll.Enabled and 16 or 0
surface.SetDrawColor(0,0,0, 80)
surface.SetDrawColor(0,0,0, 80)
if sboard_panel.cols then
if sboard_panel.cols then
コピー
コピー済み
コピー
コピー済み
local cx = self:GetWide() - scr
-- Draw for odd numbered columns
for k,v in ipairs(sboard_panel.cols) do
for i=1, #sboard_panel.cols, 2 do
cx = cx - v.Width
surface.DrawRect(
self:GetWide() - (50*i) - 25 - scr
, 0,
50
, self:GetTall())
if k % 2 == 1 then
-- Draw for odd numbered columns
surface.DrawRect(
cx-v.Width/2
, 0,
v.Width
, self:GetTall())
end
end
end
else
else
-- If columns are not setup yet, fall back to darkening the areas for the
-- If columns are not setup yet, fall back to darkening the areas for the
-- default columns
-- default columns
surface.DrawRect(self:GetWide() - 175 - 25 - scr, 0, 50, self:GetTall())
surface.DrawRect(self:GetWide() - 175 - 25 - scr, 0, 50, self:GetTall())
surface.DrawRect(self:GetWide() - 75 - 25 - scr, 0, 50, self:GetTall())
surface.DrawRect(self:GetWide() - 75 - 25 - scr, 0, 50, self:GetTall())
end
end
end
end
function PANEL:AddPlayerRow(ply)
function PANEL:AddPlayerRow(ply)
if ScoreGroup(ply) == self.group and not self.rows[ply] then
if ScoreGroup(ply) == self.group and not self.rows[ply] then
local row = vgui.Create("TTTScorePlayerRow", self)
local row = vgui.Create("TTTScorePlayerRow", self)
row:SetPlayer(ply)
row:SetPlayer(ply)
self.rows[ply] = row
self.rows[ply] = row
self.rowcount = table.Count(self.rows)
self.rowcount = table.Count(self.rows)
-- row:InvalidateLayout()
-- row:InvalidateLayout()
-- must force layout immediately or it takes its sweet time to do so
-- must force layout immediately or it takes its sweet time to do so
self:PerformLayout()
self:PerformLayout()
--self:InvalidateLayout()
--self:InvalidateLayout()
end
end
end
end
function PANEL:HasPlayerRow(ply)
function PANEL:HasPlayerRow(ply)
return self.rows[ply] != nil
return self.rows[ply] != nil
end
end
function PANEL:HasRows()
function PANEL:HasRows()
return self.rowcount > 0
return self.rowcount > 0
end
end
function PANEL:UpdateSortCache()
function PANEL:UpdateSortCache()
self.rows_sorted = {}
self.rows_sorted = {}
for k,v in pairs(self.rows) do
for k,v in pairs(self.rows) do
table.insert(self.rows_sorted, v)
table.insert(self.rows_sorted, v)
end
end
table.sort(self.rows_sorted, CompareScore)
table.sort(self.rows_sorted, CompareScore)
end
end
function PANEL:UpdatePlayerData()
function PANEL:UpdatePlayerData()
local to_remove = {}
local to_remove = {}
for k,v in pairs(self.rows) do
for k,v in pairs(self.rows) do
-- Player still belongs in this group?
-- Player still belongs in this group?
コピー
コピー済み
コピー
コピー済み
if
IsValid
(v) and IsValid(v:GetPlayer()) and ScoreGroup(v:GetPlayer()) == self.group then
if
ValidPanel
(v) and IsValid(v:GetPlayer()) and ScoreGroup(v:GetPlayer()) == self.group then
v:UpdatePlayerData()
v:UpdatePlayerData()
else
else
-- can't remove now, will break pairs
-- can't remove now, will break pairs
table.insert(to_remove, k)
table.insert(to_remove, k)
end
end
end
end
if #to_remove == 0 then return end
if #to_remove == 0 then return end
for k,ply in pairs(to_remove) do
for k,ply in pairs(to_remove) do
local pnl = self.rows[ply]
local pnl = self.rows[ply]
コピー
コピー済み
コピー
コピー済み
if
IsValid
(pnl) then
if
ValidPanel
(pnl) then
pnl:Remove()
pnl:Remove()
end
end
-- print(CurTime(), "Removed player", ply)
-- print(CurTime(), "Removed player", ply)
self.rows[ply] = nil
self.rows[ply] = nil
end
end
self.rowcount = table.Count(self.rows)
self.rowcount = table.Count(self.rows)
self:UpdateSortCache()
self:UpdateSortCache()
self:InvalidateLayout()
self:InvalidateLayout()
end
end
function PANEL:PerformLayout()
function PANEL:PerformLayout()
if self.rowcount < 1 then
if self.rowcount < 1 then
self:SetVisible(false)
self:SetVisible(false)
return
return
end
end
self:SetSize(self:GetWide(), 30 + self.rowcount + self.rowcount * SB_ROW_HEIGHT)
self:SetSize(self:GetWide(), 30 + self.rowcount + self.rowcount * SB_ROW_HEIGHT)
-- Sort and layout player rows
-- Sort and layout player rows
self:UpdateSortCache()
self:UpdateSortCache()
local y = 24
local y = 24
for k, v in ipairs(self.rows_sorted) do
for k, v in ipairs(self.rows_sorted) do
v:SetPos(0, y)
v:SetPos(0, y)
v:SetSize(self:GetWide(), v:GetTall())
v:SetSize(self:GetWide(), v:GetTall())
y = y + v:GetTall() + 1
y = y + v:GetTall() + 1
end
end
self:SetSize(self:GetWide(), 30 + (y - 24))
self:SetSize(self:GetWide(), 30 + (y - 24))
end
end
vgui.Register("TTTScoreGroup", PANEL, "Panel")
vgui.Register("TTTScoreGroup", PANEL, "Panel")
保存された差分
原文
ファイルを開く
---- Unlike sandbox, we have teams to deal with, so here's an extra panel in the ---- hierarchy that handles a set of player rows belonging to its team. include("sb_row.lua") local function CompareScore(pa, pb) if not IsValid(pa) then return false end if not IsValid(pb) then return true end local a = pa:GetPlayer() local b = pb:GetPlayer() if not IsValid(a) then return false end if not IsValid(b) then return true end if a:Frags() == b:Frags() then return a:Deaths() < b:Deaths() end return a:Frags() > b:Frags() end local PANEL = {} function PANEL:Init() self.name = "Unnamed" self.color = COLOR_WHITE self.rows = {} self.rowcount = 0 self.rows_sorted = {} self.group = "spec" end function PANEL:SetGroupInfo(name, color, group) self.name = name self.color = color self.group = group end local bgcolor = Color(20,20,20, 150) function PANEL:Paint() -- Darkened background draw.RoundedBox(8, 0, 0, self:GetWide(), self:GetTall(), bgcolor) surface.SetFont("treb_small") -- Header bg local txt = self.name .. " (" .. self.rowcount .. ")" local w, h = surface.GetTextSize(txt) draw.RoundedBox(8, 0, 0, w + 24, 20, self.color) -- Shadow surface.SetTextPos(11, 11 - h/2) surface.SetTextColor(0,0,0, 200) surface.DrawText(txt) -- Text surface.SetTextPos(10, 10 - h/2) surface.SetTextColor(255,255,255,255) surface.DrawText(txt) -- Alternating row background local y = 24 for i, row in ipairs(self.rows_sorted) do if (i % 2) != 0 then surface.SetDrawColor(75,75,75, 100) surface.DrawRect(0, y, self:GetWide(), row:GetTall()) end y = y + row:GetTall() + 1 end -- Column darkening local scr = sboard_panel.ply_frame.scroll.Enabled and 16 or 0 surface.SetDrawColor(0,0,0, 80) if sboard_panel.cols then local cx = self:GetWide() - scr for k,v in ipairs(sboard_panel.cols) do cx = cx - v.Width if k % 2 == 1 then -- Draw for odd numbered columns surface.DrawRect(cx-v.Width/2, 0, v.Width, self:GetTall()) end end else -- If columns are not setup yet, fall back to darkening the areas for the -- default columns surface.DrawRect(self:GetWide() - 175 - 25 - scr, 0, 50, self:GetTall()) surface.DrawRect(self:GetWide() - 75 - 25 - scr, 0, 50, self:GetTall()) end end function PANEL:AddPlayerRow(ply) if ScoreGroup(ply) == self.group and not self.rows[ply] then local row = vgui.Create("TTTScorePlayerRow", self) row:SetPlayer(ply) self.rows[ply] = row self.rowcount = table.Count(self.rows) -- row:InvalidateLayout() -- must force layout immediately or it takes its sweet time to do so self:PerformLayout() --self:InvalidateLayout() end end function PANEL:HasPlayerRow(ply) return self.rows[ply] != nil end function PANEL:HasRows() return self.rowcount > 0 end function PANEL:UpdateSortCache() self.rows_sorted = {} for k,v in pairs(self.rows) do table.insert(self.rows_sorted, v) end table.sort(self.rows_sorted, CompareScore) end function PANEL:UpdatePlayerData() local to_remove = {} for k,v in pairs(self.rows) do -- Player still belongs in this group? if IsValid(v) and IsValid(v:GetPlayer()) and ScoreGroup(v:GetPlayer()) == self.group then v:UpdatePlayerData() else -- can't remove now, will break pairs table.insert(to_remove, k) end end if #to_remove == 0 then return end for k,ply in pairs(to_remove) do local pnl = self.rows[ply] if IsValid(pnl) then pnl:Remove() end -- print(CurTime(), "Removed player", ply) self.rows[ply] = nil end self.rowcount = table.Count(self.rows) self:UpdateSortCache() self:InvalidateLayout() end function PANEL:PerformLayout() if self.rowcount < 1 then self:SetVisible(false) return end self:SetSize(self:GetWide(), 30 + self.rowcount + self.rowcount * SB_ROW_HEIGHT) -- Sort and layout player rows self:UpdateSortCache() local y = 24 for k, v in ipairs(self.rows_sorted) do v:SetPos(0, y) v:SetSize(self:GetWide(), v:GetTall()) y = y + v:GetTall() + 1 end self:SetSize(self:GetWide(), 30 + (y - 24)) end vgui.Register("TTTScoreGroup", PANEL, "Panel")
変更されたテキスト
ファイルを開く
---- Unlike sandbox, we have teams to deal with, so here's an extra panel in the ---- hierarchy that handles a set of player rows belonging to its team. include("sb_row.lua") local function CompareScore(pa, pb) if not ValidPanel(pa) then return false end if not ValidPanel(pb) then return true end local a = pa:GetPlayer() local b = pb:GetPlayer() if not IsValid(a) then return false end if not IsValid(b) then return true end if a:Frags() == b:Frags() then return a:Deaths() < b:Deaths() end return a:Frags() > b:Frags() end local PANEL = {} function PANEL:Init() self.name = "Unnamed" self.color = COLOR_WHITE self.rows = {} self.rowcount = 0 self.rows_sorted = {} self.group = "spec" end function PANEL:SetGroupInfo(name, color, group) self.name = name self.color = color self.group = group end local bgcolor = Color(20,20,20, 150) function PANEL:Paint() -- Darkened background draw.RoundedBox(8, 0, 0, self:GetWide(), self:GetTall(), bgcolor) surface.SetFont("treb_small") -- Header bg local txt = self.name .. " (" .. self.rowcount .. ")" local w, h = surface.GetTextSize(txt) draw.RoundedBox(8, 0, 0, w + 24, 20, self.color) -- Shadow surface.SetTextPos(11, 11 - h/2) surface.SetTextColor(0,0,0, 200) surface.DrawText(txt) -- Text surface.SetTextPos(10, 10 - h/2) surface.SetTextColor(255,255,255,255) surface.DrawText(txt) -- Alternating row background local y = 24 for i, row in ipairs(self.rows_sorted) do if (i % 2) != 0 then surface.SetDrawColor(75,75,75, 100) surface.DrawRect(0, y, self:GetWide(), row:GetTall()) end y = y + row:GetTall() + 1 end -- Column darkening local scr = sboard_panel.ply_frame.scroll.Enabled and 16 or 0 surface.SetDrawColor(0,0,0, 80) if sboard_panel.cols then -- Draw for odd numbered columns for i=1, #sboard_panel.cols, 2 do surface.DrawRect(self:GetWide() - (50*i) - 25 - scr, 0, 50, self:GetTall()) end else -- If columns are not setup yet, fall back to darkening the areas for the -- default columns surface.DrawRect(self:GetWide() - 175 - 25 - scr, 0, 50, self:GetTall()) surface.DrawRect(self:GetWide() - 75 - 25 - scr, 0, 50, self:GetTall()) end end function PANEL:AddPlayerRow(ply) if ScoreGroup(ply) == self.group and not self.rows[ply] then local row = vgui.Create("TTTScorePlayerRow", self) row:SetPlayer(ply) self.rows[ply] = row self.rowcount = table.Count(self.rows) -- row:InvalidateLayout() -- must force layout immediately or it takes its sweet time to do so self:PerformLayout() --self:InvalidateLayout() end end function PANEL:HasPlayerRow(ply) return self.rows[ply] != nil end function PANEL:HasRows() return self.rowcount > 0 end function PANEL:UpdateSortCache() self.rows_sorted = {} for k,v in pairs(self.rows) do table.insert(self.rows_sorted, v) end table.sort(self.rows_sorted, CompareScore) end function PANEL:UpdatePlayerData() local to_remove = {} for k,v in pairs(self.rows) do -- Player still belongs in this group? if ValidPanel(v) and IsValid(v:GetPlayer()) and ScoreGroup(v:GetPlayer()) == self.group then v:UpdatePlayerData() else -- can't remove now, will break pairs table.insert(to_remove, k) end end if #to_remove == 0 then return end for k,ply in pairs(to_remove) do local pnl = self.rows[ply] if ValidPanel(pnl) then pnl:Remove() end -- print(CurTime(), "Removed player", ply) self.rows[ply] = nil end self.rowcount = table.Count(self.rows) self:UpdateSortCache() self:InvalidateLayout() end function PANEL:PerformLayout() if self.rowcount < 1 then self:SetVisible(false) return end self:SetSize(self:GetWide(), 30 + self.rowcount + self.rowcount * SB_ROW_HEIGHT) -- Sort and layout player rows self:UpdateSortCache() local y = 24 for k, v in ipairs(self.rows_sorted) do v:SetPos(0, y) v:SetSize(self:GetWide(), v:GetTall()) y = y + v:GetTall() + 1 end self:SetSize(self:GetWide(), 30 + (y - 24)) end vgui.Register("TTTScoreGroup", PANEL, "Panel")
違いを見つける