Tutorial : Use sign layout

Apr 19, 2015
Tutorial : Use sign layout
  • Tutorial : Use sign layout

    Welcome in this tutorial designed to show you how to create your own sign layout to get good-looking sign.

    Here are the two steps for using sign layout :
    • create the layout
    • assign the layout to a sign (the same layout can be used for many signs)
    1) Create the layout
    To begin with, you need to open your layouts.yml file.
    We're going to create a layout called myLayout.
    You need to know that a layout is basically a list of four strings (four lines of a sign), you can add placeholders (list available there) and use bukkit colour codes in it.
    Here is my layout:
    PHP:
    myLayout:
      - "&cMyAwesomeLayout"
      - "&aDiscover nice placeholders !"
      - "&9Players online : &b{total_player_count}"
      - "&6Motd: &e{motd}"
    Just add that to your layouts.yml file and save it.

    2) Assign the layout to a sign
    In order to assign a layout to a sign, you need to go in the signs section in the config.yml file.
    Once you're in there, you need to add a layout field which should have your layout name as value.
    Here is how my sign section looks after the modification :
    PHP:
      survivalSign:
        tag: survivalSign
        type: simple
        properties:
          layout: myLayout # The line I added to specify that I want this sign to use the layout "myLayout"
         destination: survival
    Once it's done, save your config.yml and reload the plugin (or restart the server).

    Now you need to create the sign for that it's the same as in the last tutorials, so if you forget just check them out.
    When you create it, you should see your brand new awesome custom layout!
    Here is mine :
    [​IMG]
    That's it, you're done !



    Go further with offline layout :
    What is an offline layout ?
    Actually an offline layout is just a layout that will be displayed when the target server of the sign is offline (not full !!).
    It's very easy to set an offline layout ! Just create a layout as it's described in step one and then in step two instead of adding a field called layout, add a field called offlinelayout and use your layout name as value.
    Here is an example of my sign section after this :
    PHP:
    survivalSign:
      tag: survivalSign
      type: simple
      properties:
      destination: factions
      layout: myLayout
      offlinelayout: offlineLook # The line I added to specify which layout use when the server is offline (here it is a layout called offlineLook that I've created before)

    Define layout on the fly while creating simple sign :
    When you create a simple sign (by writing simple_sign on the 2nd line of the sign and then the server name on the third) you may want to set a layout. But going in the config is time consuming ... Why don't you set it on the fly ?
    Just write the layout name you'd like to use on the fourth line of the sign and BTS will take care of the rest !
    NB: You can only set (online) layout with this method, to set an offline layout you still need to go in the config.
  • Loading...
  • Loading...