add sborka

This commit is contained in:
2026-03-31 10:27:04 +03:00
commit f5e5f56c84
2345 changed files with 382127 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,121 @@
local PLUGIN = PLUGIN
local PANEL = {}
function PANEL:Init()
ix.gui.chatTabCustomize = self
self:SetTitle(L("chatNewTab"))
self:SetSizable(true)
self:SetSize(ScrW() * 0.5, ScrH() * 0.5)
self.settings = self:Add("ixSettings")
self.settings:Dock(FILL)
self.settings:SetSearchEnabled(true)
self.settings:AddCategory(L("chatAllowedClasses"))
-- controls
local controlsPanel = self:Add("Panel")
controlsPanel:Dock(BOTTOM)
controlsPanel:DockMargin(0, 4, 0, 0)
controlsPanel:SetTall(32)
self.create = controlsPanel:Add("DButton")
self.create:SetText(L("create"))
self.create:SizeToContents()
self.create:Dock(FILL)
self.create:DockMargin(0, 0, 4, 0)
self.create.DoClick = ix.util.Bind(self, self.CreateClicked)
local uncheckAll = controlsPanel:Add("DButton")
uncheckAll:SetText(L("uncheckAll"))
uncheckAll:SizeToContents()
uncheckAll:Dock(RIGHT)
uncheckAll.DoClick = function()
self:SetAllValues(false)
end
local checkAll = controlsPanel:Add("DButton")
checkAll:SetText(L("checkAll"))
checkAll:SizeToContents()
checkAll:Dock(RIGHT)
checkAll:DockMargin(0, 0, 4, 0)
checkAll.DoClick = function()
self:SetAllValues(true)
end
-- chat class settings
self.name = self.settings:AddRow(ix.type.string)
self.name:SetText(L("chatTabName"))
self.name:SetValue(L("chatNewTabTitle"))
self.name:SetZPos(-1)
for k, _ in SortedPairs(ix.chat.classes) do
local panel = self.settings:AddRow(ix.type.bool, L("chatAllowedClasses"))
panel:SetText(k)
panel:SetValue(true, true)
end
self.settings:SizeToContents()
self:Center()
self:MakePopup()
end
function PANEL:PopulateFromTab(name, filter)
self.tab = name
self:SetTitle(L("chatCustomize"))
self.create:SetText(L("update"))
self.name:SetValue(name)
for _, v in ipairs(self.settings:GetRows()) do
if (filter[v:GetText()]) then
v:SetValue(false, true)
end
end
end
function PANEL:SetAllValues(bValue)
for _, v in ipairs(self.settings:GetRows()) do
if (v == self.name) then
continue
end
v:SetValue(tobool(bValue), true)
end
end
function PANEL:CreateClicked()
local name = self.tab and self.tab or self.name:GetValue()
if (self.tab != self.name:GetValue() and PLUGIN:TabExists(self.name:GetValue())) then
ix.util.Notify(L("chatTabExists"))
return
end
local filter = {}
for _, v in ipairs(self.settings:GetRows()) do
-- we only want to add entries for classes we don't want shown
if (!v:GetValue()) then
filter[v:GetText()] = true
end
end
if (self.tab) then
self:OnTabUpdated(name, filter, self.name:GetValue())
else
self:OnTabCreated(name, filter)
end
self:Remove()
end
function PANEL:OnTabCreated(id, filter)
end
function PANEL:OnTabUpdated(id, filter, newID)
end
vgui.Register("ixChatboxTabCustomize", PANEL, "DFrame")

View File

@@ -0,0 +1,205 @@
-- Переопределение стилей чатбокса под общий дизайн Military RP
local PLUGIN = PLUGIN
local gradient = surface.GetTextureID("vgui/gradient-u")
local gradientUp = surface.GetTextureID("vgui/gradient-d")
-- Цвета в стиле HUD
local Colors = {
green = Color(84, 147, 90),
dark_green = Color(52, 91, 60),
darker_green = Color(35, 53, 29),
gray = Color(193, 193, 193),
gray_dark = Color(94, 94, 94),
black = Color(0, 0, 0, 220),
black_light = Color(0, 0, 0, 150),
white = Color(255, 255, 255)
}
-- Переопределяем стандартные функции рисования чатбокса
local SKIN = derma.GetDefaultSkin()
-- Фон чатбокса
function SKIN:PaintChatboxBackground(panel, width, height)
-- Blur эффект
ix.util.DrawBlur(panel, 8)
-- Основной фон с градиентом
surface.SetDrawColor(Colors.black)
surface.DrawRect(0, 0, width, height)
if (panel:GetActive()) then
-- Зелёный градиент сверху когда чат активен
surface.SetDrawColor(Colors.dark_green.r, Colors.dark_green.g, Colors.dark_green.b, 120)
surface.SetTexture(gradientUp)
surface.DrawTexturedRect(0, panel.tabs.buttons:GetTall(), width, height * 0.25)
end
-- Обводка в стиле HUD
surface.SetDrawColor(Colors.darker_green)
surface.DrawOutlinedRect(0, 0, width, height)
-- Тонкая внутренняя обводка
surface.SetDrawColor(Colors.green.r, Colors.green.g, Colors.green.b, 60)
surface.DrawOutlinedRect(1, 1, width - 2, height - 2)
end
-- Кнопки табов
function SKIN:PaintChatboxTabButton(panel, width, height)
if (panel:GetActive()) then
-- Активная вкладка - зелёный градиент
surface.SetDrawColor(Colors.dark_green)
surface.DrawRect(0, 0, width, height)
surface.SetDrawColor(Colors.green.r, Colors.green.g, Colors.green.b, 100)
surface.SetTexture(gradient)
surface.DrawTexturedRect(0, 0, width, height)
else
-- Неактивная вкладка
surface.SetDrawColor(Colors.black_light)
surface.DrawRect(0, 0, width, height)
-- Индикатор непрочитанных сообщений
if (panel:GetUnread()) then
surface.SetDrawColor(ColorAlpha(Color(200, 200, 50), Lerp(panel.unreadAlpha, 0, 120)))
surface.SetTexture(gradient)
surface.DrawTexturedRect(0, 0, width, height - 1)
end
end
-- Разделитель вкладок
surface.SetDrawColor(Colors.darker_green)
surface.DrawRect(width - 1, 0, 1, height)
end
-- Панель табов
function SKIN:PaintChatboxTabs(panel, width, height, alpha)
-- Фон панели табов
surface.SetDrawColor(Colors.black_light)
surface.DrawRect(0, 0, width, height)
-- Градиент вниз
surface.SetDrawColor(Colors.darker_green.r, Colors.darker_green.g, Colors.darker_green.b, 150)
surface.SetTexture(gradient)
surface.DrawTexturedRect(0, height * 0.5, width, height * 0.5)
local tab = panel:GetActiveTab()
if (tab) then
local button = tab:GetButton()
local x, _ = button:GetPos()
-- Линия под активной вкладкой (зелёная)
surface.SetDrawColor(Colors.green)
surface.DrawRect(x, height - 2, button:GetWide(), 2)
-- Обводка панели табов
surface.SetDrawColor(Colors.darker_green)
surface.DrawRect(0, height - 1, x, 1) -- слева
surface.DrawRect(x + button:GetWide(), height - 1, width - x - button:GetWide(), 1) -- справа
end
end
-- Поле ввода текста
function SKIN:PaintChatboxEntry(panel, width, height)
-- Фон поля ввода
surface.SetDrawColor(Colors.darker_green.r, Colors.darker_green.g, Colors.darker_green.b, 100)
surface.DrawRect(0, 0, width, height)
-- Текст
panel:DrawTextEntryText(Colors.white, Colors.green, Colors.white)
-- Обводка
surface.SetDrawColor(Colors.dark_green)
surface.DrawOutlinedRect(0, 0, width, height)
-- Внутренний highlight когда активно
if panel:HasFocus() then
surface.SetDrawColor(Colors.green.r, Colors.green.g, Colors.green.b, 80)
surface.DrawOutlinedRect(1, 1, width - 2, height - 2)
end
end
-- Превью команды
function SKIN:DrawChatboxPreviewBox(x, y, text, color)
color = color or Colors.green
local textWidth, textHeight = surface.GetTextSize(text)
local width, height = textWidth + 8, textHeight + 8
-- Фон
surface.SetDrawColor(Colors.dark_green)
surface.DrawRect(x, y, width, height)
-- Градиент
surface.SetDrawColor(color.r, color.g, color.b, 60)
surface.SetTexture(gradient)
surface.DrawTexturedRect(x, y, width, height)
-- Текст
surface.SetTextColor(Colors.white)
surface.SetTextPos(x + width * 0.5 - textWidth * 0.5, y + height * 0.5 - textHeight * 0.5)
surface.DrawText(text)
-- Обводка
surface.SetDrawColor(Colors.darker_green)
surface.DrawOutlinedRect(x, y, width, height)
return width
end
-- Префикс команды
function SKIN:DrawChatboxPrefixBox(panel, width, height)
local color = panel:GetBackgroundColor() or Colors.green
-- Фон
surface.SetDrawColor(Colors.dark_green)
surface.DrawRect(0, 0, width, height)
-- Градиент
surface.SetDrawColor(color.r, color.g, color.b, 80)
surface.SetTexture(gradient)
surface.DrawTexturedRect(0, 0, width, height)
-- Обводка
surface.SetDrawColor(Colors.darker_green)
surface.DrawOutlinedRect(0, 0, width, height)
end
-- Автодополнение команд
function SKIN:PaintChatboxAutocompleteEntry(panel, width, height)
-- Выделенный фон
if (panel.highlightAlpha > 0) then
surface.SetDrawColor(Colors.dark_green.r, Colors.dark_green.g, Colors.dark_green.b, panel.highlightAlpha * 150)
surface.DrawRect(0, 0, width, height)
-- Градиент выделения
surface.SetDrawColor(Colors.green.r, Colors.green.g, Colors.green.b, panel.highlightAlpha * 60)
surface.SetTexture(gradient)
surface.DrawTexturedRect(0, 0, width, height)
end
-- Разделитель между командами
surface.SetDrawColor(Colors.darker_green.r, Colors.darker_green.g, Colors.darker_green.b, 100)
surface.DrawRect(0, height - 1, width, 1)
end
hook.Add("LoadFonts", "MilitaryRPChatFonts", function()
-- Переопределяем шрифты чата на Montserrat
local scale = ix.option.Get("chatFontScale", 1)
surface.CreateFont("ixChatFont", {
font = "Montserrat",
size = 17 * scale,
weight = 400,
extended = true
})
surface.CreateFont("ixChatFontItalics", {
font = "Montserrat",
size = 17 * scale,
weight = 400,
italic = true,
extended = true
})
end)