Advertisement
Friks12829

cloudgaming_donate_argus

Feb 19th, 2023 (edited)
272,402
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 26.79 KB | None | 0 0
  1. local a="igs.20"local b="igs.18"local c="igs.40"local d="igs.15"local e="igs.18"local f="igs.18"local g="igs.22"local h="igs.18"local i="igs.20"local j="igs.17"local k="igs.40"local l="igs.20"local m="igs.15"local n="igs.15"local o="igs.20"local p="igs.17"local q="igs.17"local r="igs.17"local s=r;local t="igs.17"local u="igs.22"local v="igs.18"local w="igs.15"local x="igs.15"local y="igs.18"local z="igs.24"local A="igs.18"local B=A;local C="igs.18"local function D(E)return E end;local function F(G)return Material(G,"smooth")end;local H=F("hrp/gui/donate/close.png")local I=F("hrp/gui/donate/shop.png")local J=F("hrp/gui/donate/shop_unactive.png")local K=F("hrp/gui/donate/profile.png")local L=F("hrp/gui/donate/profile_unactive.png")local M=F("hrp/gui/donate/go.png")local N=F("hrp/gui/donate/grad.png")local O=F("hrp/gui/donate/buy.png")local P=F("hrp/gui/donate/heart.png")local Q=F("hrp/gui/donate/coupon.png")local R={}function R.FancyTerm(S)local T=IGS.TermToStr(S)if T=="бесконечно"then return"НАВСЕГДА"elseif T=="единоразово"then return"ОДНОРАЗОВО"else return"НА "..T end end;file.CreateDir("dc_cloudgamingdonate")local U={["close.png"]="https://i.imgur.com/e0RfeLy.png",["closeHover.png"]="https://i.imgur.com/xJnHQ9f.png",["store.png"]="https://i.imgur.com/ZRpEWpo.png",["inventory.png"]="https://i.imgur.com/Wn1LDOd.png",["profile.png"]="https://i.imgur.com/bPOh33q.png",["cart.png"]="https://i.imgur.com/4z9RWdB.png",["deposit.png"]="https://i.imgur.com/U81QgPm.png",["logo.png"]="https://i.imgur.com/cSsEAGH.jpg",["transactions.png"]="https://i.imgur.com/OTkRDpU.png",["smile.png"]="https://i.imgur.com/gKQKBf9.png"}local V={}timer.Simple(0.2,function()for W,X in pairs(U)do V[W]=V[W]or Material("../data/dc_cloudgamingdonate/"..W)if V[W]:IsError()then http.Fetch(X,function(Y)file.Write("dc_cloudgamingdonate/"..W,Y)end)timer.Simple(4,function()V[W]=Material("../data/dc_cloudgamingdonate/"..W)end)end end end)local Z;local _={{name="Магазин",icon="store.png",panel="dc_cloudshop"},{name="Инвентарь",icon="inventory.png",panel="dc_cloudinventory"},{name="Транкзакции",icon="transactions.png",panel="dc_transactions"},{name="Профиль",icon="profile.png",panel="dc_cloudprofile"}}local function a0()local _={}_["Все"]=_["Все"]or{}for W,X in pairs(IGS.GetItems())do if (X.CanSee ~= nil and not X:CanSee(LocalPlayer())) or (X.CanSee == nil and X:IsHidden()) then goto a1 end;if X.isnull then goto a1 end;_[X.category or"Прочее"]=_[X.category or"Прочее"]or{}table.insert(_[X.category or"Прочее"],X)table.insert(_["Все"],X)local a2=""if X.image_url then a2=string.find(X.image_url,".png")and".png"or".jpg"end;V[X.uid]=Material("../data/dc_cloudgamingdonate/"..X.uid..a2)if X.image_url and V[X.uid]:IsError()then http.Fetch(X.image_url,function(Y)file.Write("dc_cloudgamingdonate/"..X.uid..a2,Y)end)timer.Simple(4,function()V[X.uid]=Material("../data/dc_cloudgamingdonate/"..X.uid..a2)end)end::a1::end;return _ end;timer.Simple(0.5,a0)local function a3(a4,a5)return math.Truncate(tonumber(a4)or a5,2)end;local a6={{name="Банк. карта",uniqueID="bankcard",url="https://data.hellspace.ru/deposit/index.php?serverID=" .. GetGlobalString("d_serverid", "site") .. "&steamID=" .. (CLIENT and LocalPlayer():SteamID() or ""),isParamentrs=true,advWide=70,notify="Поддерживаются все карты. Доступна так же оплата через СБП и Яндекс Pay.",icon="https://i.imgur.com/edQPOqu.png",desc="Доступно также: Банк. карты(Visa, Union Pay, Mastercard, Maestro)"},{name="Visa/MasterCard",uniqueID="mastercard",url="",isParamentrs=true,notify="Для оплаты через Visa/MasterCard свяжитесь с linkins99 в Discord",icon="https://i.imgur.com/l4l6hQT.png",desc="Доступно также: Банк. карты Visa"},{name="PayPal",uniqueID="paypal",url="https://data.hellspace.ru/deposit/index.php?serverID=" .. GetGlobalString("d_serverid", "site") .. "&steamID=" .. (CLIENT and LocalPlayer():SteamID() or ""),isParamentrs=false,icon="https://i.imgur.com/88owLqB.png",desc="Доступно также: Любые другие банк. карты Европы"}}file.CreateDir("dc_paymentsicons")local a7={}timer.Simple(1,function()for W,X in pairs(a6)do a7[X.uniqueID]=Material("../data/dc_paymentsicons/"..X.uniqueID..".png")if a7[X.uniqueID]:IsError()then http.Fetch(X.icon,function(Y)file.Write("dc_paymentsicons/"..X.uniqueID..".png",Y)end)end end end)local a8;local a9=Color(30,30,30,200)local aa=Color(45,45,45,200)local function ab(ac)if IsValid(a8)then a8:Remove()end;a8=vgui.Create("DFrame")a8:SetSize(0,200)a8:MakePopup()a8:SetSizable(false)a8:SetTitle("Выберите способ пополнения")local ad=0;for W,X in pairs(a6)do local ae=hook.Run("DC_PaymentShow",X.uniqueID)if ae~=nil and ae==false then goto af end;local ag=vgui.Create("DPanel",a8)ag:Dock(LEFT)ag:SetWide(200)ag:DockMargin(1,1,1,1)ag:SetCursor('hand')ag:SetTooltip(X.desc)ag.Paint=function(ah,ad,ai)if a7[X.uniqueID]:IsError()then a7[X.uniqueID]=Material("../data/dc_paymentsicons/"..X.uniqueID..".png")end;draw.RoundedBox(3,0,0,ad,ai,ah:IsHovered()and aa or a9)surface.SetDrawColor(color_white)surface.SetMaterial(a7[X.uniqueID])surface.DrawTexturedRect(10,10,ad-20,ai-20)end;ag.OnMousePressed=function()if X.notify then Derma_Query(X.notify,"Уведомление","Понял",function()gui.OpenURL(X.isParamentrs and string.format(X.url,LocalPlayer():SteamID(),ac)or X.url)end)else gui.OpenURL(X.isParamentrs and string.format(X.url,LocalPlayer():SteamID(),ac)or X.url)end end;ad=ad+ag:GetWide()+2::af::end;a8:SetWide(ad)a8:Center()end;local aj;function IGS.WIN.Deposit(ak)if IsValid(aj)then return end;ak=tonumber(ak)hook.Run("IGS.OnDepositWinOpen",ak)local al=true;local am=math.max(IGS.GetMinCharge(),a3(ak,0))aj=uigs.Create("igs_frame",function(self)self:SetSize(450,400)self:RememberLocation("igs_deposit")self:SetTitle("Автодонат от gm-donate.ru")self:MakePopup()uigs.Create("DLabel",function(an)an:SetSize(al and 450 or 180,25)an:SetPos(al and 0 or 10,self:GetTitleHeight())an:SetText(al and"Введите ниже сумму пополнения счета"or"Рубли")an:SetFont("igs.22")an:SetTextColor(IGS.col.HIGHLIGHTING)an:SetContentAlignment(2)end,self)self.real_m=uigs.Create("DTextEntry",self)self.real_m:SetPos(10,50)self.real_m:SetSize(al and 450-10-10 or 180,30)self.real_m:SetNumeric(true)self.real_m.OnChange=function(ah)if al then return end;self.curr_m:SetValue(IGS.PriceInCurrency(a3(ah:GetValue(),0)))end;self.real_m.Think=function()local ao=tonumber(self.real_m:GetValue())if al then self.purchase:SetText("Пополнить счет на "..a3(ao,0).." руб")else local ap=tonumber(self.curr_m:GetValue())self.purchase:SetText("Пополнить на "..IGS.SignPrice(a3(ap,0)).." за "..a3(ao,0).." руб")end;self.purchase:SetActive(ao and ao>0)end;if not al then uigs.Create("DLabel",function(aq)aq:SetSize(50,30)aq:SetPos(200,50)aq:SetText("=")aq:SetFont("igs.40")aq:SetTextColor(IGS.col.TEXT_HARD)aq:SetContentAlignment(5)end,self)end;self.purchase=uigs.Create("igs_button",function(ar)local as,at=self.real_m:GetPos()ar:SetSize(400,40)ar:SetActive(true)ar:SetPos((self:GetWide()-ar:GetWide())/2,at+self.real_m:GetTall()+10)ar.DoClick=function()local au=a3(self.real_m:GetValue())if not au then self.log:AddRecord("Указана некорректная сумма пополнения",false)return elseif au<am then self.log:AddRecord("Минимальная сумма пополнения "..PL_MONEY(am),false)return end;self.log:AddRecord("Запрос цифровой подписи запроса от сервера...")IGS.GetPaymentURL(au,function(av)ab(au)if not IsValid(self)then return end;self.log:AddRecord("Подпись получена. начинаем процесс оплаты")timer.Simple(.7,function()self.log:AddRecord("Счет пополнится моментально или после перезахода")end)end)end end,self)if not al then uigs.Create("DLabel",function(aw)aw:SetSize(180,25)aw:SetPos(self:GetWide()-10-aw:GetWide(),self:GetTitleHeight())aw:SetText(IGS.C.CURRENCY_NAME)aw:SetFont("igs.22")aw:SetTextColor(IGS.col.HIGHLIGHTING)aw:SetContentAlignment(2)end,self)self.curr_m=uigs.Create("DTextEntry",self)self.curr_m:SetPos(self:GetWide()-10-self.real_m:GetWide(),50)self.curr_m:SetSize(self.real_m:GetWide(),self.real_m:GetTall())self.curr_m:SetNumeric(true)self.curr_m.OnChange=function(ah)self.real_m:SetValue(IGS.RealPrice(a3(ah:GetValue(),0)))end end;self.real_m:SetValue(am)self.real_m:OnChange()self.log=uigs.Create("igs_scroll",function(ax)ax:SetSize(250,200)ax:SetPos(10,self:GetTall()-ax:GetTall()-10)function ax:AddRecord(ay,ag)local az=ag==true and IGS.col.LOG_SUCCESS or ag==false and IGS.col.LOG_ERROR or IGS.col.LOG_NORMAL;if ag or ag==false then self:GetParent():RequestFocus()self:GetParent():MakePopup()end;return ax:AddItem(uigs.Create("Panel",function(aA)ay="> "..os.date("%H:%M:%S",os.time()).."\n"..ay;local aB=2;for a4,aC in ipairs(string.Wrap("igs.18",ay,ax:GetWide()-0-0))do uigs.Create("DLabel",function(aD)aD:SetPos(0,aB)aD:SetText(aC)aD:SetFont("igs.18")aD:SizeToContents()aD:SetTextColor(a4==1 and IGS.col.HIGHLIGHTING or az)aB=aB+aD:GetTall()end,aA)end;aA:SetTall(aB+2)ax:ScrollTo(ax:GetCanvas():GetTall())end,ax))end end,self)local aE=uigs.Create("DLabel",function(aF)local aG,aH=self.log:GetPos()aF:SetSize(self.log:GetWide(),22)aF:SetPos(aG,aH-aF:GetTall())aF:SetText("Лог операций")aF:SetTextColor(IGS.col.HIGHLIGHTING)aF:SetFont("igs.22")aF:SetContentAlignment(1)end,self)local as,aI=aE:GetPos()uigs.Create("DPanel",function(aC)aC:SetPos(10,aI-2-10)aC:SetSize(self:GetWide()-aC:GetPos()*2,2)aC.Paint=function(ah,ad,ai)draw.RoundedBox(0,0,0,ad,ai,IGS.col.SOFT_LINE)end end,self)local aJ=uigs.Create("igs_button",function(aK)local as,aH=self.log:GetPos()aK:SetSize(170,30)aK:SetPos(self:GetWide()-10-aK:GetWide(),aH-20)aK:SetText("Активировать купон")aK.DoClick=function()IGS.WIN.ActivateCoupon()end end,self)local function ax(aL,ay,aM)timer.Simple(aL,function()if not IsValid(self.log)then return end;self.log:AddRecord(ay,aM)end)end;ax(0,"Открыт диалог пополнения счета",nil)ax(math.random(3),"Соединение установлено!",true)ax(math.random(20,40),"Деньги будут зачислены мгновенно и автоматически",nil)end)return aj end;local aN=Color(10,10,10,150)local aO=Color(222,170,12,200)local aP=Color(35,35,35,255)local aQ=Color(50,50,50,255)local aR=Color(10,10,10,150)local aS=Color(0,150,0,200)local aT=Color(200,200,200)local aU=Color(0,0,0)local aV=Color(200,200,200)local aW=Color(255,255,255)local aX=Color(222,170,12,150)local aY=Color(245,0,0,255)local aZ=Color(200,0,0,100)local a_=Color(200,0,0,150)local b0={}local function b1(b2,ay,b3,aB,b4)b4=b4 or g;local b5=vgui.Create("DLabel",b2)b5:SetFont(b4)b5:SetText(ay)b5:SetPos(b3,aB)b5:SizeToContents()b5:SetCursor('hand')b5.OnMousePressed=function(ah)SetClipboardText(ah:GetText())end;return b5 end;local b6=draw.SimpleText;local b7=Color(200,200,200)function b0:Init()local b8=LocalPlayer()local b9=vgui.Create("DPanel",self)b9:Dock(TOP)b9:SetTall(200)b9:TDLib():ClearPaint():Background(aQ):Blur(2)local ba=vgui.Create("DPanel",self)ba:Dock(TOP)ba:SetTall(50)ba:DockMargin(0,1,0,1)ba:TDLib():ClearPaint():Background(aN):Blur(2):Text("Активные Покупки",g,Color(200,200,200))IGS.GetMyPurchases(function(bb)if not IsValid(self)then return end;if#bb==0 then local bc=vgui.Create("Panel",self)bc:Dock(FILL)bc:TDLib():On("Paint",function(ah,ad,ai)surface.SetTextColor(b7)surface.SetTextPos(ad/2-240,ai/2-80)surface.DrawText("Здесь будут отображаться ваши активные покупки")surface.SetTextPos(ad/2-240,ai/2-55)surface.DrawText("Не самое ли подходящее время, чтобы совершить первую?")surface.SetTextPos(ad/2-240,ai/2-30)surface.DrawText("Табличка сразу станет красивее. Честно-честно")surface.SetDrawColor(255,255,255,255)surface.SetMaterial(V['smile.png'])surface.DrawTexturedRect(ad/2-64,ai-182,128,128)end)return end;local ba=vgui.Create("DPanel",self)ba:Dock(TOP)ba:SetTall(30)ba:DockMargin(0,1,0,1)ba:TDLib():ClearPaint():Background(aN):Blur(2):On("Paint",function(ah,ad,ai)draw.SimpleText("Имя сервера",g,10,ai/2,b7,TEXT_ALIGN_LEFT,1)draw.SimpleText("ID в системе",g,ad*.4,ai/2,b7,1,1)draw.SimpleText("Куплен",g,ad*.6,ai/2,b7,1,1)draw.SimpleText("Истекает",g,ad*.75,ai/2,b7,1,1)draw.SimpleText("название",g,ad-10,ai/2,b7,TEXT_ALIGN_RIGHT,1)end)local bd=vgui.Create("DScrollPanel",self)bd:Dock(FILL)for a4,X in ipairs(bb)do local be=IGS.ServerName(X.server)or"???"local bf=IGS.GetItemByUID(X.item)local bg=bf.isnull and X.item or bf:Name()local bh=IGS.TimestampToDate(X.expire)or"Никогда"local bi=IGS.TimestampToDate(X.purchase)or"Никогда"if be and utf8 and utf8.len and utf8.len(be)>20 then be=utf8.sub(be,1,20)be=be.."..."end;local ba=bd:Add("DPanel")ba:Dock(TOP)ba:SetTall(25)ba:DockMargin(0,1,0,1)ba:TDLib():ClearPaint():Background(aN):Blur(2):On("Paint",function(ah,ad,ai)draw.SimpleText(be,g,10,ai/2,b7,TEXT_ALIGN_LEFT,1)draw.SimpleText(X.id,g,ad*.4,ai/2,b7,1,1)draw.SimpleText(bi,g,ad*.6,ai/2,b7,1,1)draw.SimpleText(bh,g,ad*.75,ai/2,b7,1,1)draw.SimpleText(bg,g,ad-10,ai/2,b7,TEXT_ALIGN_RIGHT,1)end)end end)local bj=vgui.Create("DPanel",self)bj:TDLib()bj:SetSize(184,184)bj:SetPos(10,10)bj:CircleAvatar():SetPlayer(LocalPlayer(),184)b1(self,LocalPlayer():SteamID(),bj:GetWide()-5,20)local bk=IGS.PlayerLVL(b8)local bl=b8:IGSFunds()local bm=not bk and IGS.LVL.MAP[1]or bk:GetNext()b1(self,"Статус: "..(bk and bk:Name()or"Никто :("),bj:GetWide()+10,50)if bm then local bn=bm:Description()b1(self,"След. статус: "..bm:Name()..(bn and ("\n\n%s"):format(bn)or"").." (".."Нужно: "..bm:Cost()-IGS.TotalTransaction(b8).." руб"..")",bj:GetWide()+18,80)end;local aK=vgui.Create("DButton",self)aK:SetSize(220,30)aK:SetPos(bj:GetWide()+5,150)aK:SetText("")aK:TDLib():ClearPaint():Background(Color(22,87,128),5):FadeHover(Color(7,107,171)):Text("Активировать купон",g):On("DoClick",function(ah)LocalPlayer():EmitSound("UI/buttonclick.wav",100,100)IGS.WIN.ActivateCoupon()end)end;vgui.Register("dc_cloudprofile",b0,"Panel")local b0={}local b6=draw.SimpleText;local b7=Color(200,200,200)function b0:Init()local bo=vgui.Create("DPanel",self)bo:Dock(TOP)bo:SetTall(50)bo:TDLib():ClearPaint():Background(aN,3):Blur(2):On("Paint",function(ah,ad,ai)b6("Сервер",o,ad*.1,ai/2,b7,1,1)b6("Предмет",o,ad*.35,ai/2,b7,1,1)b6("Куплен",o,ad*.5,ai/2,b7,1,1)b6("Истечет",o,ad*.67,ai/2,b7,1,1)b6("Сумма",o,ad*.83,ai/2,b7,1,1)b6("Баланс",o,ad*.95,ai/2,b7,1,1)end)local bd=vgui.Create("DScrollPanel",self)bd:Dock(FILL)local bl=LocalPlayer():IGSFunds()IGS.GetMyTransactions(function(bp)if not IsValid(bd)then return end;for a4,X in ipairs(bp)do X.note=X.note or"-"local function bq(br)local bf=IGS.GetItemByUID(br)return bf.isnull and br or bf:Name()end;if X.note:StartWith("A: ")or X.note:StartWith("C: ")then goto bs end;if not X.note:StartWith("P: ")then goto bs end;bl=bl-X.sum;local be=IGS.ServerName(X.server)or"???"local bf=IGS.GetItemByUID(bq(X.note:sub(4)))local bg=bf.isnull and X.note:sub(4)or bf:Name()local bt=function(bu,b3,aB)draw.SimpleText(bu,s,b3,aB,color_white,1)end;local bv=vgui.Create("DPanel",self)bv:Dock(TOP)bv:SetTall(30)if be and utf8 and utf8.len and utf8.len(be)>20 then be=utf8.sub(be,1,20)be=be.."..."end;local bw=bl;bv:DockMargin(0,1,0,0)bv:TDLib():ClearPaint():Background(aQ,3):On("Paint",function(ah,ad,ai)b6(be,o,ad*.12,ai/2,b7,1,1)b6(bg,o,ad*.35,ai/2,b7,1,1)b6(IGS.TimestampToDate(X.date)or"Никогда",o,ad*.5,ai/2,b7,1,1)b6(bf.termin~=0 and IGS.TimestampToDate(X.date+bf.termin*86400)or"Никогда",o,ad*.67,ai/2,b7,1,1)b6(IGS.SignPrice(X.sum),o,ad*.83,ai/2,b7,1,1)b6(IGS.SignPrice(bw),o,ad-5,ai/2,b7,TEXT_ALIGN_RIGHT,1)end)bd:AddItem(bv)::bs::end end)end;vgui.Register("dc_transactions",b0,"Panel")local bx={}local by;local function bz(S)if IsValid(by)then by:Remove()end;by=vgui.Create("DFrame")by:SetSize(400,500)by:Center()by:MakePopup()by:SetTitle("")by:ShowCloseButton(false)by:TDLib():ClearPaint():Background(aP,5):Blur(2):On("Paint",function(ah,ad,ai)draw.RoundedBox(1,0,0,ad,28,aQ)draw.SimpleText(S.name,e,ad/2,5,color_white,1,TEXT_ALIGN_TOP)end)local bA=vgui.Create("DButton",by)bA:SetSize(24,24)bA:SetPos(by:GetWide()-26,2)bA:SetText('')bA:TDLib():ClearPaint():On("Paint",function(ah,ad,ai)surface.SetDrawColor(color_white)surface.SetMaterial(ah:IsHovered()and V["closeHover.png"]or V["close.png"])surface.DrawTexturedRect(0,0,ad,ai)end):On("DoClick",function()by:Remove()end)surface.SetFont("ChatFont")local bB,bC=surface.GetTextSize(S.price)local bD=Color(255,255,255)local bE=vgui.Create("DPanel",by)bE:Dock(TOP)bE:SetTall(240)bE:DockMargin(1,1,1,10)bE:TDLib():ClearPaint():Background(aN):Blur(4):Material(V[S.uid]):On("Paint",function(ah,ad,ai)if S.discounted_from then local bF=draw.SimpleText("₽"..S.discounted_from,"ChatFont",10,ai-45,aY,TEXT_ALIGN_LEFT,TEXT_ALIGN_BOTTOM)local bG,bH=7,ai-48-20/2;surface.SetDrawColor(IGS.col.TEXT_SOFT)surface.DrawLine(bG,bH,bF+13,bH+6)bD.g=100;bD.r=math.sin(CurTime()+1)*100;bD.b=100-math.sin(CurTime()+1)*100;draw.RoundedBox(5,5,ai-40,bB+20,30,bD)draw.SimpleText("₽"..S.price,"ChatFont",10,ai-15,color_white,TEXT_ALIGN_LEFT,TEXT_ALIGN_BOTTOM)else draw.RoundedBox(5,5,ai-40,bB+20,30,aS)draw.SimpleText("₽"..S.price,"ChatFont",10,ai-15,color_white,TEXT_ALIGN_LEFT,TEXT_ALIGN_BOTTOM)end end)local bI=vgui.Create("DButton",bE)bI:SetSize(120,30)bI:SetText("")bI:SetPos(bB+30,bE:GetTall()-40)bI:TDLib():ClearPaint():Background(Color(66,133,180),5):Text(R.FancyTerm(S.termin),l)local bu=string.Wrap(p,S.description,400)local bf=IGS.GetItemByUID(S.uid)local bJ=S.price;local bK=-1;uigs.Create("DCheckBoxLabel",function(self)self.Button:TDLib():SquareCheckbox(Color(39,174,96))self:Dock(TOP)self:DockMargin(0,5,0,0)self:SetTall(20)local bL=LocalPlayer():GetNWBool("igs.gos."..bf:ID())self:SetValue(bL)local opaint = self.Paint self.Paint = function(s,w,h) draw.RoundedBox(3, 0, 0, w,h,Color(10,10,10,255)) opaint(s,w,h)end self:SetText("Выдавать при спавне")self.Label:SetTextColor(IGS.col.TEXT_SOFT)self.Label:SetFont("igs.15")function self:OnChange(bM)net.Start("IGS.GiveOnSpawnWep")net.WriteIGSItem(bf)net.WriteBool(bM)net.SendToServer()end end,bE)for W,X in ipairs(bu)do local bN=vgui.Create("DLabel",by)bN:SetText(X)bN:SetFont(p)bN:SizeToContents()bN:Dock(TOP)end;local bO=vgui.Create("DButton",by)bO:SetText("")bO:Dock(BOTTOM)bO:SetSize(120,40)bO:SetTall(45)bO:DockMargin(5,1,5,5)bO:TDLib():ClearPaint():Background(aR):FadeHover(aS):On("Paint",function(ah,ad,ai)surface.SetDrawColor(ah:IsHovered()and aU or aT)surface.SetMaterial(V["cart.png"])local bP,bQ=draw.SimpleText("КУПИТЬ",C,ad/2,ai/2,color_white,1,1)surface.DrawTexturedRect(ad/2-bP-10,ai/2-16,32,32)end):On("DoClick",function()if bK>=CurTime()then return end;bK=CurTime()+1;IGS.Purchase(S.uid,function(bR,bS)bK=-1;if bR then local need=bJ-LocalPlayer():IGSFunds()surface.PlaySound("ambient/voices/citizen_beaten1.wav")IGS.BoolRequest("Недостаточно денег", ("Вам не хватает %s для покупки %s.\nЖелаете мгновенно пополнить счет?"):format(PL_IGS(need),bf:Name()),function(bT)if bT then IGS.WIN.Deposit(need,true)surface.PlaySound("vo/npc/male01/yeah02.wav")end end):ShowCloseButton(true)surface.PlaySound("ambient/voices/citizen_beaten1.wav")return end;S.Purchased=S.Purchased or 0;S.Purchased=S.Purchased+1;if not bf:IsStackable()then if not IGS.C.Inv_Enabled then IGS.ShowNotify("Спасибо за покупку. Это было просто, правда? :)","Успешная покупка")return end;IGS.BoolRequest("Успешная покупка","Спасибо за покупку. Она находится в вашем /donate инвентаре.\n\nАктивировать ее сейчас?",function(bT)if not bT then return end;IGS.ProcessActivate(bS)end)end;surface.PlaySound("ambient/office/coinslot1.wav")end)end)end;function bx:Init()self:TDLib():ClearPaint()local bd=vgui.Create("DScrollPanel",self)bd:Dock(FILL)bd:TDLib():HideVBar()local bU=vgui.Create("DHorizontalScroller",self)bU:Dock(TOP)bU:SetTall(40)bU:SetOverlap(-4)local bV=nil;for bW,bX in SortedPairs(a0())do local bY=bU:Add("DButton")bY:Dock(LEFT)bY:SetWide(100)bY:SetFont(a)bY:DockMargin(1,1,0,1)bU:AddPanel(bY)surface.SetFont(a)local b3,aB=surface.GetTextSize(bW)bY:SetText(bW)if b3+10<100 then b3=90 end;bY:SetWide(b3+10)bY:SetTextColor(color_white)bY:TDLib():ClearPaint():FadeHover(aO):On("Paint",function(ah,ad,ai)if ah:IsHovered()or bV==ah then draw.RoundedBox(1,0,0,ad,ai,aO)end end)local bZ=function(ah)bd:Clear()bV=ah;local b_=vgui.Create("DIconLayout",bd)b_:Dock(FILL)b_:DockMargin(5,5,5,5)b_:SetSpaceY(5)b_:SetSpaceX(5)for c0,Y in pairs(bX)do local c1=b_:Add("DPanel")c1:SetSize(200,200)c1:SetCursor('hand')surface.SetFont("ChatFont")local bB,bC=surface.GetTextSize(Y.price)local bD=table.Copy(color_white)c1:TDLib():ClearPaint():Background(aN,5):Blur(4):On("OnMousePressed",function(ah)surface.PlaySound("garrysmod/ui_click.wav")bz(Y)end):On("Paint",function(ah,ad,ai)surface.SetDrawColor(ah:IsHovered()and aW or aV)surface.SetMaterial(V[Y.uid])surface.DrawTexturedRect(0,0,ad,ai)if Y.discounted_from then local bF=draw.SimpleText("₽"..Y.discounted_from,"ChatFont",10,ai-45,aY,TEXT_ALIGN_LEFT,TEXT_ALIGN_BOTTOM)local bG,bH=7,ai-48-20/2;surface.SetDrawColor(IGS.col.TEXT_SOFT)surface.DrawLine(bG,bH,bF+13,bH+6)bD.g=100;bD.r=math.sin(CurTime()+1)*100;bD.b=100-math.sin(CurTime()+1)*100;draw.RoundedBox(5,5,ai-40,bB+20,30,bD)draw.SimpleText("₽"..Y.price,"ChatFont",10,ai-15,color_white,TEXT_ALIGN_LEFT,TEXT_ALIGN_BOTTOM)else draw.RoundedBox(5,5,ai-40,bB+20,30,aS)draw.SimpleText("₽"..Y.price,"ChatFont",10,ai-15,color_white,TEXT_ALIGN_LEFT,TEXT_ALIGN_BOTTOM)end end)local bo=vgui.Create("DPanel",c1)bo:Dock(TOP)bo:DockMargin(2,2,2,2)bo:SetTall(25)bo:TDLib():ClearPaint():Background(Color(26,66,71),5):Text(Y.name,g)local bI=vgui.Create("DButton",c1)bI:SetSize(115,30)bI:SetText("")bI:SetPos(c1:GetWide()-120,c1:GetTall()-40)bI:TDLib():ClearPaint():Background(Color(66,133,180),5):Text(R.FancyTerm(Y.termin),l)end end;bY:On("DoClick",function(ah)LocalPlayer():EmitSound("UI/buttonclick.wav",100,300)bZ(ah)end)if bV==nil then bZ(bY)end end end;vgui.Register("dc_cloudshop",bx,"DPanel")local c2={}function c2:Init()self:TDLib():ClearPaint()local bd=vgui.Create("DScrollPanel",self)bd:Dock(FILL)bd:TDLib():HideVBar()local bV;local function bZ(ah)bd:Clear()IGS.GetInventory(function(bX)if table.Count(bX)<=0 then self:Text("Инвентарь пуст")return end;local b_=vgui.Create("DIconLayout",bd)b_:Dock(FILL)b_:DockMargin(5,5,5,5)b_:SetSpaceY(5)b_:SetSpaceX(5)for c0,Y in pairs(bX)do if (Y.item.CanSee ~= nil and not Y.item:CanSee(LocalPlayer())) or (Y.item.CanSee == nil and Y.item:IsHidden())then goto a1 end;if Y.item.isnull then goto a1 end;local c1=b_:Add("DPanel")c1:SetSize(200,200)surface.SetFont("ChatFont")local bB,bC=surface.GetTextSize(Y.item.price)c1:TDLib():ClearPaint():Background(aN,5):Blur(4):On("Paint",function(ah,ad,ai)surface.SetDrawColor(aW)surface.SetMaterial(V[Y.item.uid])surface.DrawTexturedRect(0,0,ad,ai)end)local bo=vgui.Create("DPanel",c1)bo:Dock(TOP)bo:DockMargin(2,2,2,2)bo:SetTall(25)bo:TDLib():ClearPaint():Background(Color(26,66,71),5):Text(Y.item.name,g)local bI=vgui.Create("DButton",c1)bI:Dock(BOTTOM)bI:SetTall(20)bI:DockMargin(2,2,2,5)bI:SetText("")bI:TDLib():ClearPaint():Background(aZ,5):FadeHover(a_):Text("ВЫБРОСИТЬ",l):On("DoClick",function(ah)IGS.DropItem(Y.id,function()surface.PlaySound("garrysmod/ui_click.wav")ah:Remove()bZ()end)end)local bI=vgui.Create("DButton",c1)bI:Dock(BOTTOM)bI:SetTall(30)bI:DockMargin(2,2,2,5)bI:SetText("")bI:TDLib():ClearPaint():Background(Color(66,133,180),5):FadeHover(aS):Text("АКТИВИРОВАТЬ",l):On("DoClick",function(ah)IGS.ProcessActivate(Y.id,function(c3)surface.PlaySound("garrysmod/ui_click.wav")if not c3 then return end;ah:Remove()bZ()end)end)::a1::end end)end;bZ()end;vgui.Register("dc_cloudinventory",c2,"Panel")function R.Menu()if IsValid(Z)then Z:Remove()gui.EnableScreenClicker(false)hook.Run("DC_DonateClose")return end;local ad,ai=1000,700;hook.Run("DC_DonateOpen")if ScrW()<ad then ad=ScrW()end;if ScrH()<ai then ai=ScrH()end;Z=vgui.Create("DPanel")Z:SetSize(ad,ai)Z:SetPos(ScrW()/2-ad/2,ScrH()/2-ai/2)Z:TDLib():ClearPaint():On("Paint",function(ah,ad,ai)draw.RoundedBox(4,0,42,ad,ai-42,aP)end)gui.EnableScreenClicker(true)local bA=vgui.Create("DButton",Z)bA:SetSize(40,40)bA:SetPos(Z:GetWide()-42,2)bA:SetText('')bA:TDLib():ClearPaint():On("Paint",function(ah,ad,ai)surface.SetDrawColor(color_white)surface.SetMaterial(ah:IsHovered()and V["closeHover.png"]or V["close.png"])surface.DrawTexturedRect(0,0,ad,ai)end):On("DoClick",function()surface.PlaySound("garrysmod/ui_click.wav")gui.EnableScreenClicker(false)Z:Remove()hook.Run("DC_DonateClose")end)local c4=vgui.Create("Panel",Z)c4:Dock(FILL)c4:DockMargin(0,42,0,0)c4:TDLib():Blur(3)local c5=vgui.Create("DPanel",c4)c5:Dock(LEFT)c5:SetWide(ad*.14)c5:TDLib():ClearPaint():Background(Color(20,20,20,100),3)local c6=vgui.Create("Panel",c4)c6:Dock(FILL)c6:DockMargin(5,5,5,5)local bV=nil;local function c7(bc,bW)c6:Clear()bV=bW;local ar=vgui.Create(bc,c6)ar:Dock(FILL)end;c7(_[1].panel)local c8=c5:Add("Panel")c8:Dock(TOP)c8:SetTall(100)c8:DockMargin(7,7,7,7)c8:TDLib():On("Paint",function(ah,ad,ai)if ah:IsHovered()then ah:SetCursor('hand')end;surface.SetDrawColor(ah:IsHovered()and aW or aV)surface.SetMaterial(V['logo.png'])surface.DrawTexturedRect(0,0,ad,ai)end):On("OnMousePressed",function(ah)surface.PlaySound("garrysmod/ui_click.wav")gui.OpenURL("https://discord.gg/cloudgaming")end)local c9=hook.Run("DC_DonateOpenCategorises",_)if c9 then table.insert(_,c9)end;for W,X in ipairs(_)do local Y={}local bW=c5:Add("DButton")bW:Dock(TOP)bW:SetTall(ad*.1)bW:SetText("")bW:DockMargin(5,2,5,0)bW:TDLib():ClearPaint():Background(aN):FadeHover(aO):On("Paint",function(ah,ad,ai)if ah:IsHovered()or bV==ah then draw.RoundedBox(1,0,0,ad,ai,aO)end;surface.SetDrawColor((ah:IsHovered()or bV==ah)and aU or aT)surface.SetMaterial(V[X.icon])surface.DrawTexturedRect(ad/2-25,ai/2-25,50,50)end):On("DoClick",function(ah)if bV==ah then return end;LocalPlayer():EmitSound("UI/buttonclick.wav",100,300)c7(X.panel,bW)end)if bV==nil then c7(X.panel,bW)end end;local bO=vgui.Create("DButton",c5)bO:Dock(BOTTOM)bO:SetText("")bO:SetTall(40)bO:DockMargin(5,1,5,5)bO:TDLib():ClearPaint():Background(aR):FadeHover(aS):On("Paint",function(ah,ad,ai)surface.SetDrawColor(ah:IsHovered()and aU or aT)surface.SetMaterial(V["deposit.png"])surface.DrawTexturedRect(ad-26,ai/2-12,24,24)draw.SimpleText("₽"..LocalPlayer():IGSFunds(),"ChatFont",5,ai/2,color_white,TEXT_ALIGN_LEFT,1)end):On("DoClick",function()IGS.WIN.Deposit(need,true)end)return Z end;local ca=IGS.UI;IGS.UI=R.Menu;concommand.Add("donate_menu",function()R.Menu()end)concommand.Add("donate_menu_old",function()ca()end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement