Added Readme Gui

This commit is contained in:
Cooldude2606
2017-12-28 15:25:44 +00:00
parent bbcfa2f597
commit 479fa71bf9
4 changed files with 106 additions and 3 deletions

77
Addons/Guis/readme.lua Normal file
View File

@@ -0,0 +1,77 @@
--[[
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-----------------------------------------------------------
Gui.center.add{
name='readme',
caption='utility/questionmark',
tooltip={'readme.tooltip'}
}:add_tab('guildlines',{'readme.tab1-name'},{'readme.tab1-tooltip'},function(frame)
for i = 1,10 do
local line = frame.add{
type='label',
caption={'readme.tab1-line'..tostring(i)}
}
line.style.maximal_width = 480
line.style.single_line = false
end
end):add_tab('chat',{'readme.tab2-name'},{'readme.tab2-tooltip'},function(frame)
local line = frame.add{
type='label',
caption={'readme.tab2-singleline'}
}
line.style.maximal_width = 480
line.style.single_line = false
end):add_tab('commands',{'readme.tab3-name'},{'readme.tab3-tooltip'},function(frame)
local line = frame.add{
type='label',
caption={'readme.tab3-singleline'}
}
line.style.maximal_width = 480
line.style.single_line = false
local table = frame.add{name='command_table',type='table',column_count=2}
table.add{
type='label',
caption={'readme.tab3-col1'}
}
table.add{
type='label',
caption={'readme.tab3-col2'}
}
table.draw_vertical_lines = true
table.draw_horizontal_line_after_headers = true
for _,command in pairs(Commands.get_commands(frame.player_index)) do
table.add{
type='label',
caption='/'..comand.name
}
local help = table.add{
type='label',
caption=command.help,
}
help.style.width = 400
help.style.single_line = false
end
end)
Event.register(defines.events.on_player_created,function(event)
if not player.admin then
local player = Game.get_player(event)
script.raise_event(defines.events.on_gui_click,{
name=defines.events.on_gui_click,
tick=event.tick,
element=mod_gui.get_button_flow(player).readme,
player_index=player.index,
button=defines.mouse_button_type.left,
alt=false,
control=false,
shift=false
})
end
end)

View File

@@ -16,5 +16,6 @@ Discord: https://discord.gg/r6dC2uK
-- guis dir
require('Guis/player-list')
require('Guis/readme')
-- other

View File

@@ -40,13 +40,16 @@ local groups = Ranking._groups(true)
local ranks = Ranking._ranks(true)
groups['Root']:edit('allow',false,{
['player-list']=true
['player-list']=true,
['readme']=true
})
groups['Admin']:edit('allow',false,{
['player-list']=true
['player-list']=true,
['readme']=true
})
groups['User']:edit('allow',false,{
['player-list']=true
['player-list']=true,
['readme']=true
})
groups['Jail']:edit('allow',false,{

22
locale/en/readme.cfg Normal file
View File

@@ -0,0 +1,22 @@
[readme]
tooltip=Open the readme gui that opens when you first join.
tab1-name=Guild Lines
tab1-tooltip=These are the guildlines you should follow
tab1-line1=Welcome to the Explosive Gaming Community!
tab1-line2=
tab1-line3=Here are some guidelines to keep this Server fun for everyone:
tab1-line4=- Hacking / cheating / abusing bugs will not be tolerated.
tab1-line5=- Be polite and use common sense.
tab1-line6=- Nobody likes spam. That includes: Chat, Bots, unlimited Chests and Concrete.
tab1-line7=- Do not remove stuff without even trying to talk / ask about it.
tab1-line8=- Trains: LHD (Left hand drive), no Loops and use them for long distances.
tab1-line9=
tab1-line10=If you have any questions about the rules, the server or the game in general, feel free to ask. Have Fun!
tab2-name=How To Chat
tab2-tooltip=How to chat in factorio with default key config
tab2-singleline=Chatting can be difficult for new players because its different than other games! Its very simple, the button you need to press is the “GRAVE/TILDE” key its located under the “ESC key”. If you would like to change the key go to your controls tab in options. The key you need to change is “Toggle Lua console” its located in the second column 2nd from bottom.
tab3-name=Commands
tab3-tooltip=These are the commands you can use
tab3-singleline=These are the many diffrent custom commands you are able to use, the base game commands are not shown
tab3-col1=Command Name
tab3-col2=Command Help