Jump to content
Message added by Yun,

V2 WARN FOR DEVELOPERS
Read the new API documentation in the description below, and read the topic GOOD WAY TO IMPLEMENT.
If you have any questions, add me on Discord: yunkkkk

2 Screenshots

  • 4.5k
  • 112
  • 35.19 kB
 Share

depends on

Works with

About Toastify

WHAT IS IT FOR?
This is a tool that creates temporary notifications on the user's screen, used to facilitate messages between plugins and server users.

 

CONSOLE COMMANDS
toastify [toast_id] [player] [message] - to send a toast notification for a specific player
toastify.global [toast_id] [message] - to send a toast notification for everyone

 

PERMISSION
toastify.use- the permission to access the toastify commands

 

 API </>

// Send a toast notification for the target player
// Returns the ID of the toast to destroy it if necessary
string SendToast(BasePlayer player, string toastId, string message, float? duration);

// Destroy a toast notification
void DestroyToast(BasePlayer player, string toastId);

 

GOOD WAY TO IMPLEMENT
If you want to integrate your plugin with Toastify, I recommend that you add an option in the configuration file of your plugin that the user can link their notification ID with the notifications you will use, you can see an example of how this was implemented in the FurnaceUpgrades or TCLevels configuration file.

 

CONFIGURATION
The default configuration file of the plugin:

Quote
{
  "General": {
    "Render layer": "Overlay",
    "Float side (left or right)": "right",
    "Max toasts in the screen": 8,
    "Margin X": 24.0,
    "Margin top": 24.0,
    "Spacing between toasts": 6.0
  },
  "Toasts": {
    "success": {
      "Default duration": 10.0,
      "Width": 260.0,
      "Height": 60.0,
      "Background": {
        "Color": "#5b7038",
        "Opacity": 1.0,
        "Image URL": null,
        "Material": "assets/content/ui/uibackgroundblur-ingamemenu.mat",
        "Sprite": null,
        "Decorations": [
          {
            "Width": 60.0,
            "Height": 60.0,
            "Position X": 0.0,
            "Position Y": 0.0,
            "Background color": "0 0 0 0.4",
            "Image URL": null
          }
        ]
      },
      "Icon settings": {
        "Url": "assets/icons/check.png",
        "Color": "#c4ff61",
        "Size": 28.0,
        "Position X": 16.0,
        "Position Y": 16.0
      },
      "Title settings": {
        "Lang key": "ToastSuccessTitle",
        "Text align (combination with: 'top middle bottom' and 'left center right')": "middle left",
        "Font": null,
        "Font size": 14,
        "Width": 176.0,
        "Height": 18.0,
        "Position X": 72.0,
        "Position Y": 36.0
      },
      "Text settings": {
        "Text align (combination with: 'top middle bottom' and 'left center right')": "top left",
        "Font": "robotocondensed-regular.ttf",
        "Font size": 11,
        "Width": 176.0,
        "Height": 28.0,
        "Position X": 72.0,
        "Position Y": 6.0
      },
      "Close on click?": true,
      "Command on click": null,
      "Effect prefab": "assets/prefabs/locks/keypad/effects/lock.code.unlock.prefab"
    },
    "error": {
      "Default duration": 10.0,
      "Width": 260.0,
      "Height": 60.0,
      "Background": {
        "Color": "#cd412b",
        "Opacity": 1.0,
        "Image URL": null,
        "Material": "assets/content/ui/uibackgroundblur-ingamemenu.mat",
        "Sprite": null,
        "Decorations": [
          {
            "Width": 60.0,
            "Height": 60.0,
            "Position X": 0.0,
            "Position Y": 0.0,
            "Background color": "0 0 0 0.4",
            "Image URL": null
          }
        ]
      },
      "Icon settings": {
        "Url": "assets/icons/close.png",
        "Color": "#ff9989",
        "Size": 28.0,
        "Position X": 16.0,
        "Position Y": 16.0
      },
      "Title settings": {
        "Lang key": "ToastErrorTitle",
        "Text align (combination with: 'top middle bottom' and 'left center right')": "middle left",
        "Font": null,
        "Font size": 14,
        "Width": 176.0,
        "Height": 18.0,
        "Position X": 72.0,
        "Position Y": 36.0
      },
      "Text settings": {
        "Text align (combination with: 'top middle bottom' and 'left center right')": "top left",
        "Font": "robotocondensed-regular.ttf",
        "Font size": 11,
        "Width": 176.0,
        "Height": 28.0,
        "Position X": 72.0,
        "Position Y": 6.0
      },
      "Close on click?": true,
      "Command on click": null,
      "Effect prefab": "assets/prefabs/weapons/toolgun/effects/repairerror.prefab"
    }
  },
  "Debug mode": false
}

 

SCREENSHOT

1.png.dd8d6d8a07da1d1afac960bb981c1c42.png

  • Like 3
  • Love 1

User Feedback

1m

Downloads

Total number of downloads.

5.4k

Customers

Total customers served.

76.4k

Files Sold

Total number of files sold.

1.5m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.