diff --git a/player_list.lua b/player_list.lua index c4d5a6bc..691825b3 100644 --- a/player_list.lua +++ b/player_list.lua @@ -16,6 +16,7 @@ local focus_color = {r = 1, g = 0.55, b = 0.1} local rank_colors = { {r = 1, g = 1, b = 1}, -- Guest {r = 0.155, g = 0.540, b = 0.898}, -- Regular + {r = 172.6, g = 70.2, b = 215.8}, -- Donator {r = 152, g = 24, b = 206} {r = 0.093, g = 0.768, b = 0.172} -- Admin } @@ -23,6 +24,7 @@ local inv_sprite_time_step = 1 / sprite_time_step local rank_names = { 'Guest', 'Regular', + 'Donator', 'Admin' } @@ -111,12 +113,17 @@ end local function get_rank_level(player) if player.admin then - return 3 - elseif UserGroups.is_regular(player.name) then - return 2 - else - return 1 + return 4 end + + local name = player.name + if UserGroups.is_donator(name) then + return 3 + elseif UserGroups.is_regular(name) then + return 2 + end + + return 1 end local function do_poke_spam_protection(player) diff --git a/resources/donators.lua b/resources/donators.lua new file mode 100644 index 00000000..c009f2a6 --- /dev/null +++ b/resources/donators.lua @@ -0,0 +1,4 @@ +return { + ['robertkruijt'] = true, + ['aldldl'] = true +} diff --git a/user_groups.lua b/user_groups.lua index ef78d909..111b6043 100644 --- a/user_groups.lua +++ b/user_groups.lua @@ -1,4 +1,5 @@ global.regulars = require 'resources.regulars' +global.donators = require 'resources.donators' local Event = require 'utils.event' local Utils = require 'utils.utils' @@ -66,6 +67,10 @@ function Module.get_rank(player) end end +function Module.is_donator(player_name) + return global.donators[player_name] +end + Event.add( defines.events.on_player_joined_game, function(event)