From 07585c3badb52d42f6ac0054442daa7f360ce0be Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sun, 31 Dec 2017 18:09:54 +0000 Subject: [PATCH] Added Reson to cant open left --- ExpCore/GuiParts/left.lua | 11 +++++++---- locale/en/exp-core.cfg | 7 ++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ExpCore/GuiParts/left.lua b/ExpCore/GuiParts/left.lua index f34d2273..8eb9f972 100644 --- a/ExpCore/GuiParts/left.lua +++ b/ExpCore/GuiParts/left.lua @@ -141,12 +141,14 @@ function left._left.toggle(event) elseif err == true then open = true elseif global.over_ride_left_can_open then if is_type(Ranking,'table') and Ranking._presets and Ranking._presets().meta.rank_count > 0 then - if Ranking.get_rank(player):allowed(_left.name) then open = true end + if Ranking.get_rank(player):allowed(_left.name) then open = true + else open = {gui.unauthorized} end end - end + else open == err end else if is_type(Ranking,'table') and Ranking._presets and Ranking._presets().meta.rank_count > 0 then - if Ranking.get_rank(player):allowed(_left.name) then open = true end + if Ranking.get_rank(player):allowed(_left.name) then open = true + else open = {gui.unauthorized} end end end if open and left.style.visible ~= true then @@ -154,7 +156,8 @@ function left._left.toggle(event) else left.style.visible = false end - if not open then player_return('You can not open this panel right now',defines.text_color.crit,player) player.play_sound{path='utility/cannot_build'} end + if open == false then player_return({'gui.cant-open-no-reason'},defines.text_color.crit,player) player.play_sound{path='utility/cannot_build'} + else open ~= true then player_return({'gui.cant-open',open},defines.text_color.crit,player) player.play_sound{path='utility/cannot_build'} end end -- draws the left guis when a player first joins, fake_event is just because i am lazy diff --git a/locale/en/exp-core.cfg b/locale/en/exp-core.cfg index 5b46c9c9..6d099655 100644 --- a/locale/en/exp-core.cfg +++ b/locale/en/exp-core.cfg @@ -10,4 +10,9 @@ rank-print=[__1__]: __2__ rank-up=__1__ was promoted to __2__ by __3__ rank-down=__1__ was demoted to __2__ by __3__ rank-given=You have been given the __1__ Rank! -tag-reset=Your Tag was reset due to a Rank change \ No newline at end of file +tag-reset=Your Tag was reset due to a Rank change + +[gui] +unauthorized=401 - Unauthorized: Access is denied due to invalid credentials +cant-open=You can not open this panel right now, reason: __1__ +cant-open-no-reason=You can not open this panel right now \ No newline at end of file