From 6e129c77c5851a66fb7aa5ead7d43afcab063345 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Fri, 14 Sep 2018 20:32:46 +0100 Subject: [PATCH] Sorted items that need converting --- .../AdvancedStartingItems}/starting-items.lua | 0 .../DeathMarkers}/body-marker.lua | 0 .../DeconControl}/tree-decon.lua | 0 modules/ExpGamingAdmin/Reports/control.lua | 45 ++++ .../ExpGamingInfo/to convert}/readme.lua | 0 .../ExpGamingInfo/to convert}/rockets.lua | 0 .../ExpGamingInfo/to convert}/science.lua | 0 .../ExpGamingInfo/to convert}/tasklist.lua | 0 .../inventorySearch/control.lua | 1 + .../ExpGamingPlayer}/polls.lua | 0 .../GameSettingsGui}/game-settings.lua | 0 .../GuiAnnouncements}/announcements.lua | 0 .../HealthIndicator}/health.lua | 0 .../PlayerAutoColor}/colours.lua | 0 .../RankChanger}/rank-changer.lua | 0 .../SpawnArea}/spawn.lua | 0 .../WarpPoints}/warp-system.lua | 0 .../WornPaths}/paths.lua | 0 to convert/Addons/Admin/base-damage.lua | 47 ---- to convert/Addons/Guis/reports.lua | 53 ----- to convert/Addons/load.lua | 49 ---- to convert/Addons/playerRanks.lua | 224 ------------------ to convert/StandAlone/load.lua | 16 -- 23 files changed, 46 insertions(+), 389 deletions(-) rename {to convert/StandAlone => modules/AdvancedStartingItems}/starting-items.lua (100%) rename {to convert/StandAlone => modules/DeathMarkers}/body-marker.lua (100%) rename {to convert/Addons/Admin => modules/DeconControl}/tree-decon.lua (100%) rename {to convert/Addons/Guis => modules/ExpGamingInfo/to convert}/readme.lua (100%) rename {to convert/Addons/Guis => modules/ExpGamingInfo/to convert}/rockets.lua (100%) rename {to convert/Addons/Guis => modules/ExpGamingInfo/to convert}/science.lua (100%) rename {to convert/Addons/Guis => modules/ExpGamingInfo/to convert}/tasklist.lua (100%) rename {to convert/Addons/Guis => modules/ExpGamingPlayer}/polls.lua (100%) rename {to convert/Addons/Guis => modules/GameSettingsGui}/game-settings.lua (100%) rename {to convert/Addons/Guis => modules/GuiAnnouncements}/announcements.lua (100%) rename {to convert/StandAlone => modules/HealthIndicator}/health.lua (100%) rename {to convert/StandAlone => modules/PlayerAutoColor}/colours.lua (100%) rename {to convert/Addons/Guis => modules/RankChanger}/rank-changer.lua (100%) rename {to convert/StandAlone => modules/SpawnArea}/spawn.lua (100%) rename {to convert/Addons/Guis => modules/WarpPoints}/warp-system.lua (100%) rename {to convert/StandAlone => modules/WornPaths}/paths.lua (100%) delete mode 100644 to convert/Addons/Admin/base-damage.lua delete mode 100644 to convert/Addons/Guis/reports.lua delete mode 100644 to convert/Addons/load.lua delete mode 100644 to convert/Addons/playerRanks.lua delete mode 100644 to convert/StandAlone/load.lua diff --git a/to convert/StandAlone/starting-items.lua b/modules/AdvancedStartingItems/starting-items.lua similarity index 100% rename from to convert/StandAlone/starting-items.lua rename to modules/AdvancedStartingItems/starting-items.lua diff --git a/to convert/StandAlone/body-marker.lua b/modules/DeathMarkers/body-marker.lua similarity index 100% rename from to convert/StandAlone/body-marker.lua rename to modules/DeathMarkers/body-marker.lua diff --git a/to convert/Addons/Admin/tree-decon.lua b/modules/DeconControl/tree-decon.lua similarity index 100% rename from to convert/Addons/Admin/tree-decon.lua rename to modules/DeconControl/tree-decon.lua diff --git a/modules/ExpGamingAdmin/Reports/control.lua b/modules/ExpGamingAdmin/Reports/control.lua index 8d6affed..359f0821 100644 --- a/modules/ExpGamingAdmin/Reports/control.lua +++ b/modules/ExpGamingAdmin/Reports/control.lua @@ -8,6 +8,7 @@ local Admin = require('ExpGamingAdmin.AdminLib@^4.0.0') local Server = require('ExpGamingCore.Server@^4.0.0') local Ranking = require('ExpGamingCore.Ranking@^4.0.0') +local Gui = require('ExpGamingCore.Gui@^4.0.0') local Game = require('FactorioStdLib.Game@^0.8.0') local Color = require('FactorioStdLib.Color@^0.8.0') local Sync -- ExpGamingCore.Sync@^4.0.0 @@ -122,5 +123,49 @@ function Admin.clear_reports(player,by_player,no_emit) end end +local confirm_report = Gui.inputs.add{ + type='button', + name='admin-report-confirm', + caption='utility/spawn_flag', + tooltip={'ExpGamingAdmin.name'} +}:on_event('click',function(event) + local parent = event.element.parent + local player = Game.get_player(parent.player.caption) + local reason = parent.reason.text + Admin.report(player,event.player_index,reason) + Gui.center.clear(event.player_index) +end) + +Admin.report_btn = Gui.inputs.add{ + type='button', + name='admin-report', + caption='utility/spawn_flag', + tooltip={'ExpGamingAdmin.name'} +}:on_event('click',function(event) + local parent = event.element.parent + local player = Game.get_player(parent.children[1].name) + if not player then return end + local _player = Game.get_player(event) + Gui.center.clear(_player) + local frame = Gui.center.get_flow(_player).add{ + type='frame', + name='report-gui' + } + _player.opened=frame + frame.caption={'ExpGamingAdmin.name'} + frame.add{ + type='textfield', + name='reason' + }.style.width = 300 + local btn = confirm_report:draw(frame) + btn.style.height = 30 + btn.style.width = 30 + frame.add{ + type='label', + name='player', + caption=player.name + }.style.visible = false +end) + -- Module Return return ThisModule \ No newline at end of file diff --git a/to convert/Addons/Guis/readme.lua b/modules/ExpGamingInfo/to convert/readme.lua similarity index 100% rename from to convert/Addons/Guis/readme.lua rename to modules/ExpGamingInfo/to convert/readme.lua diff --git a/to convert/Addons/Guis/rockets.lua b/modules/ExpGamingInfo/to convert/rockets.lua similarity index 100% rename from to convert/Addons/Guis/rockets.lua rename to modules/ExpGamingInfo/to convert/rockets.lua diff --git a/to convert/Addons/Guis/science.lua b/modules/ExpGamingInfo/to convert/science.lua similarity index 100% rename from to convert/Addons/Guis/science.lua rename to modules/ExpGamingInfo/to convert/science.lua diff --git a/to convert/Addons/Guis/tasklist.lua b/modules/ExpGamingInfo/to convert/tasklist.lua similarity index 100% rename from to convert/Addons/Guis/tasklist.lua rename to modules/ExpGamingInfo/to convert/tasklist.lua diff --git a/modules/ExpGamingPlayer/inventorySearch/control.lua b/modules/ExpGamingPlayer/inventorySearch/control.lua index 2cf6a104..06a47128 100644 --- a/modules/ExpGamingPlayer/inventorySearch/control.lua +++ b/modules/ExpGamingPlayer/inventorySearch/control.lua @@ -7,6 +7,7 @@ -- Module Require local Admin = require('ExpGamingAdmin.AdminLib@^4.0.0') local Game = require('FactorioStdLib.Game@^0.8.0') +local Ranking -- ExpGamingCore.Ranking@^4.0.0 -- Local Varibles -- removed from none admin ranks, no further action diff --git a/to convert/Addons/Guis/polls.lua b/modules/ExpGamingPlayer/polls.lua similarity index 100% rename from to convert/Addons/Guis/polls.lua rename to modules/ExpGamingPlayer/polls.lua diff --git a/to convert/Addons/Guis/game-settings.lua b/modules/GameSettingsGui/game-settings.lua similarity index 100% rename from to convert/Addons/Guis/game-settings.lua rename to modules/GameSettingsGui/game-settings.lua diff --git a/to convert/Addons/Guis/announcements.lua b/modules/GuiAnnouncements/announcements.lua similarity index 100% rename from to convert/Addons/Guis/announcements.lua rename to modules/GuiAnnouncements/announcements.lua diff --git a/to convert/StandAlone/health.lua b/modules/HealthIndicator/health.lua similarity index 100% rename from to convert/StandAlone/health.lua rename to modules/HealthIndicator/health.lua diff --git a/to convert/StandAlone/colours.lua b/modules/PlayerAutoColor/colours.lua similarity index 100% rename from to convert/StandAlone/colours.lua rename to modules/PlayerAutoColor/colours.lua diff --git a/to convert/Addons/Guis/rank-changer.lua b/modules/RankChanger/rank-changer.lua similarity index 100% rename from to convert/Addons/Guis/rank-changer.lua rename to modules/RankChanger/rank-changer.lua diff --git a/to convert/StandAlone/spawn.lua b/modules/SpawnArea/spawn.lua similarity index 100% rename from to convert/StandAlone/spawn.lua rename to modules/SpawnArea/spawn.lua diff --git a/to convert/Addons/Guis/warp-system.lua b/modules/WarpPoints/warp-system.lua similarity index 100% rename from to convert/Addons/Guis/warp-system.lua rename to modules/WarpPoints/warp-system.lua diff --git a/to convert/StandAlone/paths.lua b/modules/WornPaths/paths.lua similarity index 100% rename from to convert/StandAlone/paths.lua rename to modules/WornPaths/paths.lua diff --git a/to convert/Addons/Admin/base-damage.lua b/to convert/Addons/Admin/base-damage.lua deleted file mode 100644 index 569f1cd7..00000000 --- a/to convert/Addons/Admin/base-damage.lua +++ /dev/null @@ -1,47 +0,0 @@ ---[[ -Explosive Gaming - -This file can be used with permission but this and the credit below must remain in the file. -Contact a member of management on our discord to seek permission to use our code. -Any changes that you may make to the code are yours but that does not make the script yours. -Discord: https://discord.gg/r6dC2uK -]] ---Please Only Edit Below This Line----------------------------------------------------------- - --- alot of this is copied from redmew - but it has been reworked to use the ExpCore --- https://github.com/Valansch/RedMew/blob/develop/nuke_control.lua - -local function _damage(reset) - global.addons = not reset and global.addons or {} - global.addons.damage = not reset and global.addons.damage or {} - return global.addons.damage -end - -Event.register(defines.events.on_entity_damaged,function(event) - if event.force == nil or event.force ~= event.entity.force then return end - if event.cause == nil or event.cause.name ~= 'player' then return end - local player = Game.get_player(event.cause.player) - if Ranking.get_rank(player):allowed('base-damage') then return end - if not _damage()[player.index] then _damage()[player.index] = {0,0} end - _damage()[player.index][1] = _damage()[player.index][1]+event.final_damage_amount - if _damage()[player.index][2] < event.tick-300 then - _damage()[player.index][2] = event.tick - player_return({'base-damage.used'},defines.textcolor.med,player) - Admin.give_warning(player,'','Damaged something inside the base. Total Delt: '.._damage()[player.index][1],4) - end -end) - -Event.register(defines.events.on_player_ammo_inventory_changed,function(event) - local player = Game.get_player(event) - if Ranking.get_rank(player):allowed('nuke') then return end - local found = player.remove_item({name='atomic-bomb',count=1000}) - if not _damage()[player.index] then _damage()[player.index] = {0,0} end - if found > 0 then - Admin.move_item_to_spawn({name='atomic-bomb',count=found},player.surface) - player_return({'base-damage.nuke'},defines.textcolor.med,player) - if _damage()[player.index][2] < event.tick-300 then - _damage()[player.index][2] = event.tick - Admin.give_warning(player,'','Nukes are not allowed for your rank.',4) - end - end -end) \ No newline at end of file diff --git a/to convert/Addons/Guis/reports.lua b/to convert/Addons/Guis/reports.lua deleted file mode 100644 index 969a9146..00000000 --- a/to convert/Addons/Guis/reports.lua +++ /dev/null @@ -1,53 +0,0 @@ ---[[ -Explosive Gaming - -This file can be used with permission but this and the credit below must remain in the file. -Contact a member of management on our discord to seek permission to use our code. -Any changes that you may make to the code are yours but that does not make the script yours. -Discord: https://discord.gg/r6dC2uK -]] ---Please Only Edit Below This Line----------------------------------------------------------- - -local confirm_report = Gui.inputs.add{ - type='button', - name='admin-report-confirm', - caption='utility/spawn_flag', - tooltip={ExpGamingAdmin.name'} -}:on_event('click',function(event) - local parent = event.element.parent - local player = Game.get_player(parent.player.caption) - local reason = parent.reason.text - Admin.report(player,event.player_index,reason) - Gui.center.clear(event.player_index) -end) - -Admin.report_btn = Gui.inputs.add{ - type='button', - name='admin-report', - caption='utility/spawn_flag', - tooltip={ExpGamingAdmin.name'} -}:on_event('click',function(event) - local parent = event.element.parent - local player = Game.get_player(parent.children[1].name) - if not player then return end - local _player = Game.get_player(event) - Gui.center.clear(_player) - local frame = Gui.center.get_flow(_player).add{ - type='frame', - name='report-gui' - } - _player.opened=frame - frame.caption={ExpGamingAdmin.name'} - frame.add{ - type='textfield', - name='reason' - }.style.width = 300 - local btn = confirm_report:draw(frame) - btn.style.height = 30 - btn.style.width = 30 - frame.add{ - type='label', - name='player', - caption=player.name - }.style.visible = false -end) \ No newline at end of file diff --git a/to convert/Addons/load.lua b/to convert/Addons/load.lua deleted file mode 100644 index f5e4f41d..00000000 --- a/to convert/Addons/load.lua +++ /dev/null @@ -1,49 +0,0 @@ ---[[ -Explosive Gaming - -This file can be used with permission but this and the credit below must remain in the file. -Contact a member of management on our discord to seek permission to use our code. -Any changes that you may make to the code are yours but that does not make the script yours. -Discord: https://discord.gg/r6dC2uK -]] ---Please Only Edit Below This Line----------------------------------------------------------- --- This file just contains all the diffrent requires - --- Admin dir -verbose('Begain Admin Loading') -require('Admin/player-info') -require('Admin/admin') -- Used with Guis/admin-gui, but can work without -require('Admin/reports') -- This adds onto Admin/admin, adds report command and warnings, and temp ban -require('Admin/discord') -require('Admin/auto-message') -require('Admin/tree-decon') -require('Admin/inventory-search') -require('Admin/base-damage') -require('Admin/afk-kick') -require('Admin/auto-chat') - --- Commands dir -verbose('Begain Command Loading') -require('Commands/cheat-mode') -require('Commands/kill') -require('Commands/repair') -require('Commands/bonus') -require('Commands/tags') -require('Commands/home') -require('Commands/tp') -- Requires Admin/admin -require('Commands/admin') -- Requires Admin/reports - --- GUIs dir -verbose('Begain Gui Loading') -require('Guis/readme') -require('Guis/science') -require('Guis/rockets') -require('Guis/player-list') -require('Guis/tasklist') -require('Guis/warp-system') -require('Guis/polls') -- Too many desyncs -require('Guis/announcements') -require('Guis/rank-changer') -require('Guis/admin-gui') -- Used with Admin/admin, requires Admin/admin -require('Guis/reports') -- Requires Admin/reports -require('Guis/game-settings') \ No newline at end of file diff --git a/to convert/Addons/playerRanks.lua b/to convert/Addons/playerRanks.lua deleted file mode 100644 index e4e532b1..00000000 --- a/to convert/Addons/playerRanks.lua +++ /dev/null @@ -1,224 +0,0 @@ ---[[ -Explosive Gaming - -This file can be used with permission but this and the credit below must remain in the file. -Contact a member of management on our discord to seek permission to use our code. -Any changes that you may make to the code are yours but that does not make the script yours. -Discord: https://discord.gg/r6dC2uK -]] ---Please Only Edit Below This Line----------------------------------------------------------- - ---[[ - How to use groups: -name The name that you can use to reference it. -disallow If present then all ranks in this group will have this added to their disallow. -allow If present then all ranks in this group will have this added to their allow. -highest Assigned by the script to show the highest rank in this group. -lowest Assigned by the script to show the lowest rank in this group. -How to add ranks: -Name What will be used in the scripts and is often the best choice for display in text. -short_hand What can be used when short on space but the rank still need to be displayed. -tag The tag the player will gain when moved to the rank, it can be nil. -time Used for auto-rank feature where you are moved to the rank after a certain play time in minutes. -colour The RGB value that can be used to emphasise GUI elements based on rank. -power Assigned by the script based on their index in ranks, you can insert new ranks between current ones. -group Assigned by the script to show the group this rank is in. -disallow A list containing input actions that the user can not perform. -allow A list of custom commands and effects that that rank can use, all defined in the scripts. - -For allow, add the allow as the key and the value as true -Example: test for 'server-interface' => allow['server-interface'] = true - -For disallow, add to the list the end part of the input action -Example: defines.input_action.drop_item -> 'drop_item' -http://lua-api.factorio.com/latest/defines.html#defines.input_action ---]] - --- See ExpCore/ranks.lua for examples - you add your own and edit pre-made ones here. - -local groups = Ranking._groups(true) - -groups['Root']:edit('allow',false,{ - ['player-list']=true, - ['readme']=true, - ['rockets']=true, - ['science']=true, - ['tasklist']=true, - ['rank-changer']=true, - ['admin-commands']=true, - ['warn']=true, - ['temp-ban']=true, - ['clear-warings']=true, - ['clear-reports']=true, - ['clear-all']=true, - ['clear-inv']=true, - ['announcements']=true, - ['warp-list']=true, - ['polls']=true, - ['admin-items']=true, - ['all-items']=true, - ['repair']=true, - ['global-chat']=true -}) -groups['Admin']:edit('allow',false,{ - ['player-list']=true, - ['readme']=true, - ['rockets']=true, - ['science']=true, - ['tasklist']=true, - ['rank-changer']=true, - ['admin-commands']=true, - ['warn']=true, - ['temp-ban']=true, - ['clear-warings']=true, - ['clear-reports']=true, - ['clear-all']=true, - ['clear-inv']=true, - ['announcements']=true, - ['warp-list']=true, - ['polls']=true, - ['global-chat']=true -}) -groups['User']:edit('allow',false,{ - ['player-list']=true, - ['readme']=true, - ['rockets']=true, - ['science']=true, - ['tasklist']=true, - ['report']=true, - ['warp-list']=true, - ['polls']=true -}) -groups['Jail']:edit('allow',false,{ - -}) - - - -groups['Root']:add_rank{ - name='Owner', - short_hand='Owner', - tag='[Owner]', - time=nil, - colour={r=170,g=0,b=0}, - is_admin = true, - is_spectator=true, - base_afk_time=false -} -groups['Root']:add_rank{ - name='Community Manager', - short_hand='Com Mngr', - tag='[Com Mngr]', - colour={r=150,g=68,b=161}, - is_admin = true, - is_spectator=true, - base_afk_time=false -} -groups['Root']:add_rank{ - name='Developer', - short_hand='Dev', - tag='[Dev]', - colour={r=179,g=125,b=46}, - is_admin = true, - is_spectator=true, - base_afk_time=false -} - -groups['Admin']:add_rank{ - name='Mod', - short_hand='Mod', - tag='[Mod]', - colour={r=0,g=170,b=0}, - disallow={ - 'server_command' - }, - is_admin = true, - is_spectator=true, - base_afk_time=false -} - -groups['User']:add_rank{ - name='Donator', - short_hand='P2W', - tag='[P2W]', - colour={r=233,g=63,b=233}, - power=0, - is_spectator=true, - base_afk_time=120 -} -groups['User']:add_rank{ - name='Veteran', - short_hand='Vet', - tag='[Veteran]', - time=600, - colour={r=140,g=120,b=200}, - power=1, - base_afk_time=60 -} -groups['User']:add_rank{ - name='Regular', - short_hand='Reg', - tag='[Regular]', - time=180, - colour={r=24,g=172,b=188}, - power=3, - base_afk_time=30 -} - -local ranks = Ranking._ranks(true) - -ranks['Developer']:edit('allow',false,{ - ['cheat-mode']=true -}) - -ranks['Admin']:edit('allow',false,{ - ['game-settings']=true, - ['always-warp']=true, - ['admin-items']=true -}) -ranks['Mod']:edit('allow',false,{ - ['go-to']=true, - ['bring']=true, - ['no-report']=true -}) - -ranks['Donator']:edit('allow',false,{ - ['global-chat']=true, - ['jail']=true, - ['unjail']=true, - ['set-home']=true, - ['home']=true, - ['return']=true, - ['bonus']=true, - ['bonus-respawn']=true -}) -ranks['Veteran']:edit('allow',false,{ - ['tree-decon']=true, - ['create-poll']=true, - ['repair']=true -}) -ranks['Member']:edit('allow',false,{ - ['edit-tasklist']=true, - ['make-warp']=true, - ['nuke']=true, - ['base-damage']=true, - ['varified']=true -}) -ranks['Regular']:edit('allow',false,{ - ['kill']=true, - ['decon']=true, - ['capsules']=true -}) -ranks['Guest']:edit('allow',false,{ - ['tag']=true, - ['tag-clear']=true, - ['report']=true -}) - -Ranking._base_preset{ - ['badgamernl']='Owner', - ['arty714']='Community Manager', - ['cooldude2606']='Developer', - ['mark9064']='Admin', - ['propangaseddy']='Admin' -} diff --git a/to convert/StandAlone/load.lua b/to convert/StandAlone/load.lua deleted file mode 100644 index 16841b94..00000000 --- a/to convert/StandAlone/load.lua +++ /dev/null @@ -1,16 +0,0 @@ ---[[ -Explosive Gaming - -This file can be used with permission but this and the credit below must remain in the file. -Contact a member of management on our discord to seek permission to use our code. -Any changes that you may make to the code are yours but that does not make the script yours. -Discord: https://discord.gg/r6dC2uK -]] ---Please Only Edit Below This Line----------------------------------------------------------- --- this file will just contain all the diffrent requires -require('colours') -require('health') -require('spawn') -require('starting-items') -require('paths') -require('body-marker') \ No newline at end of file