From 13995f355c1d9de068939a42e9b2908abc499e95 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 24 May 2020 18:22:57 +0100 Subject: [PATCH] Add loading screen --- .../glorifiedbanking_cardreader/cl_init.lua | 15 +++++++++++++-- .../localization/sh_glorifiedbanking_english.lua | 1 + .../modules/core/sv_glorifiedbanking_net.lua | 3 --- materials/glorified_banking/loading_spinner.png | Bin 0 -> 5339 bytes 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 materials/glorified_banking/loading_spinner.png diff --git a/lua/entities/glorifiedbanking_cardreader/cl_init.lua b/lua/entities/glorifiedbanking_cardreader/cl_init.lua index 7efddd0..f6dd41a 100644 --- a/lua/entities/glorifiedbanking_cardreader/cl_init.lua +++ b/lua/entities/glorifiedbanking_cardreader/cl_init.lua @@ -74,7 +74,7 @@ ENT.Screens[2].drawFunction = function(self) --Transaction confirm screen if imgui.IsHovering(scrw * .075, 550, scrw * .85, 120) then hovering = true - draw.RoundedBox(12, scrw * .075, 550, scrw * .85, 120, theme.Data.Colors.readerConfirmBgHoverCol) + draw.RoundedBox(10, scrw * .075, 550, scrw * .85, 120, theme.Data.Colors.readerConfirmBgHoverCol) if imgui.IsPressed() then net.Start("GlorifiedBanking.CardReader.ConfirmTransaction") @@ -82,7 +82,7 @@ ENT.Screens[2].drawFunction = function(self) --Transaction confirm screen net.SendToServer() end else - draw.RoundedBox(12, scrw * .075, 550, scrw * .85, 120, theme.Data.Colors.readerConfirmBgCol) + draw.RoundedBox(10, scrw * .075, 550, scrw * .85, 120, theme.Data.Colors.readerConfirmBgCol) end local iconsize = 55 @@ -99,6 +99,17 @@ ENT.Screens[2].drawFunction = function(self) --Transaction confirm screen return hovering end +ENT.Screens[3].drawFunction = function(self) --Loading screen + surface.SetDrawColor(theme.Data.Colors.readerBgCol) + surface.DrawRect(0, 0, scrw, scrh) + + surface.SetDrawColor(theme.Data.Colors.readerLoadingSpinnerCol) + surface.SetMaterial(theme.Data.Materials.loading) + surface.DrawTexturedRectRotated(scrw * .5, scrh * .5 - 50, 200, 200, -CurTime() * 100) + + draw.SimpleText(i18n.GetPhrase("gbReaderLoading"), "GlorifiedBanking.ReaderEntity.Loading", scrw * .5, scrh * .5 + 100, theme.Data.Colors.readerLoadingTextCol, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) +end + function ENT:DrawTranslucent() self:DrawModel() diff --git a/lua/glorifiedbanking/localization/sh_glorifiedbanking_english.lua b/lua/glorifiedbanking/localization/sh_glorifiedbanking_english.lua index 3661b72..92dd669 100644 --- a/lua/glorifiedbanking/localization/sh_glorifiedbanking_english.lua +++ b/lua/glorifiedbanking/localization/sh_glorifiedbanking_english.lua @@ -49,6 +49,7 @@ i18n.RegisterPhrases( "en", { gbCantPaySelf = "You can't pay yourself!", gbNeedCard = "You need to have your card in hand to make this payment!", gbConfirm = "CONFIRM", + gbReaderLoading = "PLEASE WAIT", gbEnterAmount = "ENTER AMOUNT", gbAdminMenuPlayers = "PLAYERS", gbAdminMenuLogs = "LOGS", diff --git a/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua b/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua index 438904d..7ec7a0f 100644 --- a/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua +++ b/lua/glorifiedbanking/modules/core/sv_glorifiedbanking_net.lua @@ -188,9 +188,6 @@ net.Receive("GlorifiedBanking.CardReader.ConfirmTransaction", function( len, ply readerEntity:EmitSound("GlorifiedBanking.Beep_Reader_Normal") readerEntity:Transfer(ply) - - readerEntity:SetTransactionAmount( 0 ) - readerEntity:SetScreenID( 1 ) end) net.Receive( "GlorifiedBanking.AdminPanel.SetPlayerBalance", function( len, ply ) diff --git a/materials/glorified_banking/loading_spinner.png b/materials/glorified_banking/loading_spinner.png new file mode 100644 index 0000000000000000000000000000000000000000..83eec638af9df9b61ff035de976e21b1fa05e03c GIT binary patch literal 5339 zcmV<16eR13P)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi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