Added Reson to cant open left

This commit is contained in:
Cooldude2606
2017-12-31 18:09:54 +00:00
parent 812d03bd3b
commit 07585c3bad
2 changed files with 13 additions and 5 deletions

View File

@@ -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

View File

@@ -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
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