From be49b0615183635ea23723ad76791ad6374153e6 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Mon, 17 Sep 2018 22:32:11 +0100 Subject: [PATCH] Fixed EapGamingCore.Gui --- control.lua | 2 +- modules/ExpGamingCore/Commands/control.lua | 1 + modules/ExpGamingCore/Gui/control.lua | 10 +++ modules/ExpGamingCore/Gui/src/center.lua | 4 +- modules/ExpGamingCore/Gui/src/inputs.lua | 17 +++-- modules/ExpGamingCore/Gui/src/test.lua | 1 + .../ExpGamingPlayer/playerList/control.lua | 67 ++++++++++--------- .../ExpGamingPlayer/playerList/locale/de.cfg | 2 +- .../ExpGamingPlayer/playerList/locale/en.cfg | 2 +- .../ExpGamingPlayer/playerList/locale/fr.cfg | 2 +- .../ExpGamingPlayer/playerList/locale/nl.cfg | 2 +- .../playerList/locale/sv-SE.cfg | 2 +- .../playerList/src/ranking.lua | 4 +- modules/index.lua | 5 +- 14 files changed, 70 insertions(+), 51 deletions(-) diff --git a/control.lua b/control.lua index c5e46030..1c352a55 100644 --- a/control.lua +++ b/control.lua @@ -6,7 +6,7 @@ Manager.setVerbose{ moduleLoad=false, -- when a module is required by the manager moduleInit=false, -- when and within the initation of a module modulePost=false, -- when and within the post of a module - moduleEnv=true, -- during module runtime, this is a global option set within each module for fine control + moduleEnv=false, -- during module runtime, this is a global option set within each module for fine control eventRegistered=false, -- when a module registers its event handlers errorCaught=true, -- when an error is caught during runtime output=Manager._verbose -- can be: can be: print || log || other function diff --git a/modules/ExpGamingCore/Commands/control.lua b/modules/ExpGamingCore/Commands/control.lua index 47f46a2c..6c5363d3 100644 --- a/modules/ExpGamingCore/Commands/control.lua +++ b/modules/ExpGamingCore/Commands/control.lua @@ -252,6 +252,7 @@ return commands commands.add_command('foo',{'foo.description'},{ ['player']={true,'player'}, -- a required arg that must be a valid player ['number']={true,'number-range',0,10}, -- a required arg that must be a number 0 global.update - global.intervial then global.update = tick + global.delay @@ -49,7 +60,7 @@ end) Gui.left.add{ name='player-list', caption='entity/player', - tooltip={'player-list.tooltip'}, + tooltip={'ExpGamingPlayer-playerList.tooltip'}, draw=function(frame) frame.caption = '' local player_list = frame.add{ @@ -70,18 +81,18 @@ Gui.left.add{ type='label', name=player.name, style='caption_label', - caption={'player-list.format-nil',tick_to_display_format(player.online_time),player.name} + caption={'ExpGamingPlayer-playerList.format-nil',tick_to_display_format(player.online_time),player.name} }.style.font_color = rank[1] else flow.add{ type='label', name=player.name, style='caption_label', - caption={'player-list.format',tick_to_display_format(player.online_time),player.name,rank[2]} + caption={'ExpGamingPlayer-playerList.format',tick_to_display_format(player.online_time),player.name,rank[2]} }.style.font_color = rank[1] end - if Admin.report_btn then - if not rank:allowed('no-report') and player.index ~= frame.player_index then + if Admin and Admin.report_btn then + if not rank[4] and player.index ~= frame.player_index then local btn = Admin.report_btn:draw(flow) btn.style.height = 20 btn.style.width = 20 @@ -114,18 +125,12 @@ script.on_event(defines.events.on_gui_click,function(event) back_btn:draw(flow) playerInfo(event.element.name,flow,true) if Game.get_player(event.element.name) and event.player_index == Game.get_player(event.element.name).index then return end - if Admin and Admin.allowed and Admin.allowed(event.player_index) then Admin.btn_flow(flow).caption = event.element.name end + if Admin and Admin.allowed(event.player_index) then Admin.btn_flow(flow).caption = event.element.name end end) -script.on_event(defines.events.on_player_joined_game,queue_update) -script.on_event(defines.events.on_player_left_game,queue_update) -script.on_event(defines.events.rank_change,queue_update) +script.on_event(defines.events.on_player_joined_game,ThisModule.update) +script.on_event(defines.events.on_player_left_game,ThisModule.update) +script.on_event(defines.events.rank_change,ThisModule.update) -return { - force_update=function() return Gui.left.update('player-list') end, - update=queue_update, - on_init=function(self) - if loaded_modules['ExpGamingPlayer.playerInfo'] then playerInfo = require('ExpGamingPlayer.playerInfo') end - if loaded_modules['ExpGamingAdmin.AdminLib'] then Admin = require('ExpGamingAdmin.AdminLib') end - end -} \ No newline at end of file +ThisModule.force_update = function() return Gui.left.update('player-list') end +return ThisModule \ No newline at end of file diff --git a/modules/ExpGamingPlayer/playerList/locale/de.cfg b/modules/ExpGamingPlayer/playerList/locale/de.cfg index 7caaf627..ed48069f 100644 --- a/modules/ExpGamingPlayer/playerList/locale/de.cfg +++ b/modules/ExpGamingPlayer/playerList/locale/de.cfg @@ -1,4 +1,4 @@ -[player-list] +[ExpGamingPlayer-playerList] tooltip=Verkleinere die Spielerliste. Rechtsklicke einen Spieler für Informationen über ihn. format-nil=__1__ - __2__ format=__1__ - __2__ - __3__ diff --git a/modules/ExpGamingPlayer/playerList/locale/en.cfg b/modules/ExpGamingPlayer/playerList/locale/en.cfg index a385d119..d2c2e345 100644 --- a/modules/ExpGamingPlayer/playerList/locale/en.cfg +++ b/modules/ExpGamingPlayer/playerList/locale/en.cfg @@ -1,4 +1,4 @@ -[player-list] +[ExpGamingPlayer-playerList] tooltip=Toggle player list, right click player for more info format-nil=__1__ - __2__ format=__1__ - __2__ - __3__ diff --git a/modules/ExpGamingPlayer/playerList/locale/fr.cfg b/modules/ExpGamingPlayer/playerList/locale/fr.cfg index 9adacd4d..83d2dd03 100644 --- a/modules/ExpGamingPlayer/playerList/locale/fr.cfg +++ b/modules/ExpGamingPlayer/playerList/locale/fr.cfg @@ -1,4 +1,4 @@ -[player-list] +[ExpGamingPlayer-playerList] tooltip=Toogle player list, right click player for info format-nil=__1__ - __2__ format=__1__ - __2__ - __3__ diff --git a/modules/ExpGamingPlayer/playerList/locale/nl.cfg b/modules/ExpGamingPlayer/playerList/locale/nl.cfg index 4ba8d8b6..6a58e08a 100644 --- a/modules/ExpGamingPlayer/playerList/locale/nl.cfg +++ b/modules/ExpGamingPlayer/playerList/locale/nl.cfg @@ -1,4 +1,4 @@ -[player-list] +[ExpGamingPlayer-playerList] tooltip=Toggle speler lijst. Rechtermuisklik op een speler voor meer info format-nil=__1__ - __2__ format=__1__ - __2__ - __3__ diff --git a/modules/ExpGamingPlayer/playerList/locale/sv-SE.cfg b/modules/ExpGamingPlayer/playerList/locale/sv-SE.cfg index b415bf5d..b871c389 100644 --- a/modules/ExpGamingPlayer/playerList/locale/sv-SE.cfg +++ b/modules/ExpGamingPlayer/playerList/locale/sv-SE.cfg @@ -1,4 +1,4 @@ -[player-list] +[ExpGamingPlayer-playerList] tooltip=Växla spelarlista, högerklicka på spelare för mer information. format-nil=__1__ - __2__ format=__1__ - __2__ - __3__ diff --git a/modules/ExpGamingPlayer/playerList/src/ranking.lua b/modules/ExpGamingPlayer/playerList/src/ranking.lua index 0a7cee2e..4f53e52c 100644 --- a/modules/ExpGamingPlayer/playerList/src/ranking.lua +++ b/modules/ExpGamingPlayer/playerList/src/ranking.lua @@ -1,9 +1,9 @@ -local Ranking = require('ExpGamingCore.Ranking') +local Ranking = require('ExpGamingCore.Ranking@^4.0.0') return function() local rtn = {} for _,rank in pairs(Ranking.ranks) do - table.insert(rtn,{rank.colour,rank.short_hand,rank:get_players(true)) + table.insert(rtn,{rank.colour,rank.short_hand,rank:get_players(true),rank:allowed('no-report')}) end return rtn end \ No newline at end of file diff --git a/modules/index.lua b/modules/index.lua index cb950c56..266d5686 100644 --- a/modules/index.lua +++ b/modules/index.lua @@ -19,7 +19,6 @@ return { ['ExpGamingCore.Server@^4.0.0']='./modules/ExpGamingCore/Server', ['ExpGamingCommands.tags@4.0.0']='./modules/ExpGamingCommands/tags', ['ExpGamingCore.Commands@^4.0.0']='./modules/ExpGamingCore/Commands', - ['ExpGamingAdmin.Commands@4.0.0']='./modules/ExpGamingCommands/kill', ['ExpGamingCommands.home@4.0.0']='./modules/ExpGamingCommands/home', ['ExpGamingCommands.cheatMode@4.0.0']='./modules/ExpGamingCommands/cheatMode', ['ExpGamingCommands.bonus@4.0.0']='./modules/ExpGamingCommands/bonus', @@ -27,12 +26,12 @@ return { ['ExpGamingCore.Gui@4.0.0']='./modules/ExpGamingCore/Gui', ['ExpGamingCore.Sync@^4.0.0']='./modules/ExpGamingCore/Sync', ['ExpGamingPlayer.playerList@4.0.0']='./modules/ExpGamingPlayer/playerList', + ['ExpGamingAdmin.AdminLib@^4.0.0']='./modules/ExpGamingAdmin/AdminLib', ['ExpGamingPlayer.playerInfo@4.0.0']='./modules/ExpGamingPlayer/playerInfo', ['ExpGamingCore.Sync@4.0.0']='./modules/ExpGamingCore/Sync', ['ExpGamingBot.discordAlerts@4.0.0']='./modules/ExpGamingBot/discordAlerts', ['ExpGamingBot.autoMessage@4.0.0']='./modules/ExpGamingBot/autoMessage', ['ExpGamingPlayer.afkKick@4.0.0']='./modules/ExpGamingPlayer/afkKick', - ['ExpGamingAdmin.AdminLib@^4.0.0']='./modules/ExpGamingAdmin/AdminLib', ['ExpGamingAdmin.AdminLib@4.0.0']='./modules/ExpGamingAdmin/AdminLib', ['ExpGamingAdmin.Warnings@4.0.0']='./modules/ExpGamingAdmin/Warnings', ['ExpGamingAdmin.Reports@4.0.0']='./modules/ExpGamingAdmin/Reports', @@ -46,6 +45,6 @@ return { ['ExpGamingCommands.teleport@4.0.0']='./modules/ExpGamingCommands/teleport', ['ExpGamingAdmin.Kick@4.0.0']='./modules/ExpGamingAdmin/Kick', ['ExpGamingAdmin.Jail@4.0.0']='./modules/ExpGamingAdmin/Jail', - ['ExpGamingCommands.admin@4.0.0']='./modules/ExpGamingCommands/admin', + ['ExpGamingAdmin.Commands@4.0.0']='./modules/ExpGamingAdmin/Commands', ['ExpGamingAdmin.Ban@4.0.0']='./modules/ExpGamingAdmin/Ban', } \ No newline at end of file