Skip to content

sbox-projectwarfare/sbox-notifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notifications Library for S&box Project Warfare

This is a library that allows you to call notification UI panels

How to add library to your addon?

Clone this repository to folder you need via git clone command or add as submodule via git submodule command.

How to use it?

This repository has a main part with library's source code and an example project, that you can use to understand how this library can be used. Keep in mind, in example project backend part stores in code/notifications and frontend in ui/notifications

To activate library you must:

  • Initialize NotificationStack in game script's constructor to store data; Manager init
  • Call NotificationStack.Push method from it in player's code (check "Notifications Library API") with data type you need; Calling method
  • Have fun.

How to make a custom notification?

If you want to make your own notification type with custom style, you need to do:

  • Inherit your custom class from Notification;

Custom notification example

  • Open styles/NotificationsStyle.scss file and set style for your custom notification type. For example, since we wrote "yellow" in class, we should add &.yellow class style realization. If you have any problems, check styles code above.

Style example

  • Now you can call NotificationStack.Push method with your new type.

Custom method example Custom notification example

We'll be glad if you send your feedback about library and what problems you've get to "Issues" section

About

Notifications Library for s&box Project Warfare

Resources

License

Stars

Watchers

Forks