mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-30 12:31:41 +09:00
Added commands tab
This commit is contained in:
@@ -211,7 +211,7 @@ local default = Roles.new_role('Guest','')
|
|||||||
:allow{
|
:allow{
|
||||||
'command/tag',
|
'command/tag',
|
||||||
'command/tag-clear',
|
'command/tag-clear',
|
||||||
'command/chelp',
|
'command/search-help',
|
||||||
'command/list-roles',
|
'command/list-roles',
|
||||||
'command/find-on-map',
|
'command/find-on-map',
|
||||||
'command/report',
|
'command/report',
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ to-self=Player can not be teleported to themselves.
|
|||||||
|
|
||||||
[expcom-chelp]
|
[expcom-chelp]
|
||||||
title=Help results for "__1__":
|
title=Help results for "__1__":
|
||||||
footer=[__1__ results found; page __2__ of __3__]
|
footer=[__1__ results found: page __2__ of __3__]
|
||||||
format=/__1__ __2__ - __3__ __4__
|
format=/__1__ __2__ - __3__ __4__
|
||||||
alias=Alias: __1__
|
alias=Alias: __1__
|
||||||
out-of-range=__1__ is an invalid page number.
|
out-of-range=__1__ is an invalid page number.
|
||||||
@@ -61,8 +61,8 @@ wip=This command is temporary and will be replaced at some point in the future.
|
|||||||
|
|
||||||
[expcom-ratio]
|
[expcom-ratio]
|
||||||
notSelecting=Please select an entetiy with a recpie.
|
notSelecting=Please select an entetiy with a recpie.
|
||||||
item-in=You need __1__ per seconds of [item=__2__].
|
item-in=You need __1__ per second of [item=__2__].
|
||||||
fluid-in=You need __1__ per seconds of [fluid=__2__].
|
fluid-in=You need __1__ per second of [fluid=__2__].
|
||||||
item-out=This will result in: __1__ [item=__2__] per second.
|
item-out=This will result in: __1__ [item=__2__] per second.
|
||||||
fluid-out=This will result in: __1__ [fluid=__2__] per second.
|
fluid-out=This will result in: __1__ [fluid=__2__] per second.
|
||||||
machines=And you will need __1__ machines (with the same speed as this one) for this.
|
machines=And you will need __1__ machines (with the same speed as this one) for this.
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ rules-14=Do not beg for roles, advertise other servers, or link to harmful sites
|
|||||||
rules-15=Use common sense, report rule breakers, and Administrators have the final word.
|
rules-15=Use common sense, report rule breakers, and Administrators have the final word.
|
||||||
commands-tab=Commands
|
commands-tab=Commands
|
||||||
commands-tooltip=Commands which you are able to use
|
commands-tooltip=Commands which you are able to use
|
||||||
|
commands-general=We have lots of custom commands which you are able to use. Below you can find a list of all the commands that you are allowed to use and what they do. If you need more information or want to search for a command you can use our /search-help command.
|
||||||
servers-tab=Servers
|
servers-tab=Servers
|
||||||
servers-tooltip=Links to our other servers and sites
|
servers-tooltip=Links to our other servers and sites
|
||||||
backers-tab=Backers
|
backers-tab=Backers
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ end)
|
|||||||
-- @command chelp
|
-- @command chelp
|
||||||
-- @tparam string keyword the keyword that will be looked for
|
-- @tparam string keyword the keyword that will be looked for
|
||||||
-- @tparam number page the page of help to view, must be in range of pages
|
-- @tparam number page the page of help to view, must be in range of pages
|
||||||
Commands.new_command('chelp','Searches for a keyword in all commands you are allowed to use.')
|
Commands.new_command('search-help','Searches for a keyword in all commands you are allowed to use.')
|
||||||
|
:add_alias('chelp','shelp','commands')
|
||||||
:add_param('keyword',true)
|
:add_param('keyword',true)
|
||||||
:add_param('page',true,'integer')
|
:add_param('page',true,'integer')
|
||||||
:set_defaults{keyword='',page=1}
|
:set_defaults{keyword='',page=1}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
local Gui = require 'expcore.gui' --- @dep expcore.gui
|
||||||
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
local Roles = require 'expcore.roles' --- @dep expcore.roles
|
||||||
|
local Commands = require 'expcore.commands' --- @dep expcore.commands
|
||||||
local Event = require 'utils.event' --- @dep utils.event
|
local Event = require 'utils.event' --- @dep utils.event
|
||||||
local Game = require 'utils.game' --- @dep utils.game
|
local Game = require 'utils.game' --- @dep utils.game
|
||||||
|
|
||||||
@@ -42,6 +43,24 @@ end)
|
|||||||
horizontal_align = 'center'
|
horizontal_align = 'center'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
--- Title element with bars on each side
|
||||||
|
-- @element title
|
||||||
|
local title =
|
||||||
|
Gui.element(function(_,parent,bar_size,caption)
|
||||||
|
local title_flow = parent.add{ type='flow' }
|
||||||
|
title_flow.style.vertical_align = 'center'
|
||||||
|
|
||||||
|
Gui.bar(title_flow,bar_size)
|
||||||
|
local title_label = title_flow.add{
|
||||||
|
type = 'label',
|
||||||
|
caption = caption,
|
||||||
|
style = 'heading_1_label'
|
||||||
|
}
|
||||||
|
Gui.bar(title_flow)
|
||||||
|
|
||||||
|
return title_label
|
||||||
|
end)
|
||||||
|
|
||||||
--- Content area for the welcome tab
|
--- Content area for the welcome tab
|
||||||
-- @element welcome_content
|
-- @element welcome_content
|
||||||
Tab({'readme.welcome-tab'},{'readme.welcome-tooltip'},
|
Tab({'readme.welcome-tab'},{'readme.welcome-tooltip'},
|
||||||
@@ -58,15 +77,7 @@ Gui.element(function(_,parent)
|
|||||||
top_vertical_flow.style.horizontal_align = 'center'
|
top_vertical_flow.style.horizontal_align = 'center'
|
||||||
|
|
||||||
-- Add the title to the top flow
|
-- Add the title to the top flow
|
||||||
local title_flow = top_vertical_flow.add{ type='flow' }
|
title(top_vertical_flow,62,'Welcome to '..server_details.name)
|
||||||
title_flow.style.vertical_align = 'center'
|
|
||||||
Gui.bar(title_flow,85)
|
|
||||||
title_flow.add{
|
|
||||||
type = 'label',
|
|
||||||
caption = 'Welcome to '..server_details.name,
|
|
||||||
style = 'caption_label'
|
|
||||||
}
|
|
||||||
Gui.bar(title_flow,85)
|
|
||||||
|
|
||||||
-- Add the description to the top flow
|
-- Add the description to the top flow
|
||||||
description_label(top_vertical_flow,380,server_details.description)
|
description_label(top_vertical_flow,380,server_details.description)
|
||||||
@@ -94,28 +105,20 @@ Gui.element(function(_,parent)
|
|||||||
local container = parent.add{ type='flow', direction='vertical' }
|
local container = parent.add{ type='flow', direction='vertical' }
|
||||||
|
|
||||||
-- Add the title to the content
|
-- Add the title to the content
|
||||||
local title_flow = container.add{ type='flow' }
|
title(container,267,{'readme.rules-tab'})
|
||||||
title_flow.style.vertical_align = 'center'
|
|
||||||
Gui.bar(title_flow,267)
|
|
||||||
title_flow.add{
|
|
||||||
type = 'label',
|
|
||||||
caption = {'readme.rules-tab'},
|
|
||||||
style = 'heading_1_label'
|
|
||||||
}
|
|
||||||
Gui.bar(title_flow,267)
|
|
||||||
|
|
||||||
-- Add the tab description
|
-- Add the tab description
|
||||||
description_label(container,575,{'readme.rules-general'})
|
description_label(container,575,{'readme.rules-general'})
|
||||||
Gui.bar(container)
|
Gui.bar(container)
|
||||||
|
|
||||||
-- Add a table for the rules
|
-- Add a table for the rules
|
||||||
|
container.add{ type='flow' }
|
||||||
local rules = Gui.scroll_table(container,275,1)
|
local rules = Gui.scroll_table(container,275,1)
|
||||||
rules.style = 'bordered_table'
|
rules.style = 'bordered_table'
|
||||||
rules.style.top_margin = 2
|
|
||||||
|
|
||||||
-- Add the rules to the table
|
-- Add the rules to the table
|
||||||
for i = 1,15 do
|
for i = 1,15 do
|
||||||
description_label(rules,545,{'readme.rules-'..i})
|
description_label(rules,555,{'readme.rules-'..i})
|
||||||
end
|
end
|
||||||
|
|
||||||
return container
|
return container
|
||||||
@@ -124,11 +127,30 @@ end))
|
|||||||
--- Content area for the commands tab
|
--- Content area for the commands tab
|
||||||
-- @element commands_content
|
-- @element commands_content
|
||||||
Tab({'readme.commands-tab'},{'readme.commands-tooltip'},
|
Tab({'readme.commands-tab'},{'readme.commands-tooltip'},
|
||||||
Gui.element{
|
Gui.element(function(_,parent)
|
||||||
type = 'label',
|
local container = parent.add{ type='flow', direction='vertical' }
|
||||||
caption = 'Commands'
|
local player = Gui.get_player_from_element(parent)
|
||||||
})
|
|
||||||
|
|
||||||
|
-- Add the title to the content
|
||||||
|
title(container,250,{'readme.commands-tab'})
|
||||||
|
|
||||||
|
-- Add the tab description
|
||||||
|
description_label(container,575,{'readme.commands-general'})
|
||||||
|
Gui.bar(container)
|
||||||
|
|
||||||
|
-- Add a table for the rules
|
||||||
|
container.add{ type='flow' }
|
||||||
|
local commands = Gui.scroll_table(container,275,2)
|
||||||
|
commands.style = 'bordered_table'
|
||||||
|
|
||||||
|
-- Add the rules to the table
|
||||||
|
for name,command in pairs(Commands.get(player)) do
|
||||||
|
description_label(commands,100,name)
|
||||||
|
description_label(commands,440,command.help)
|
||||||
|
end
|
||||||
|
|
||||||
|
return container
|
||||||
|
end))
|
||||||
--- Content area for the servers tab
|
--- Content area for the servers tab
|
||||||
-- @element servers_content
|
-- @element servers_content
|
||||||
Tab({'readme.servers-tab'},{'readme.servers-tooltip'},
|
Tab({'readme.servers-tab'},{'readme.servers-tooltip'},
|
||||||
|
|||||||
Reference in New Issue
Block a user