Leaderboard Library

Current Version: 0.1 (ALPHA)

This is a very simple basis for a custom leader board library.

Currently unmodifiable behaviors:

  • Creates a minimizable 500x400 leader board
  • Adds all active players to the leader board
  • Tracks and display names/kills/deaths of players
  • Uses a recursive sort function to sort players by: kills descending, deaths descending
  • Turns rows of eliminated players red and sorts them to the bottom of the list

Currently modifiable behaviors:

  • Can be positioned/anchored anywhere on the screen
  • Can be renamed (Title)

Some highlights:

  • All variables are private and a couple functions are private. Only relevant functions appear on function lists.
  • All variables are get/set by public functions.
  • The trigger footprint has been reduced to 40kb, down from 300kb, by converting the trigger contents into custom script.
  • Does not register any triggers. Initialization and updates are all functions that can be called within actions.

Reason for existence: I find the current leader board very limiting. Although the current version of this library is not more versatile than the default leader bar, it is my hope of posting this library that it be updated and improved. The existence of this library is a stepping stone to a collaborative work exceeding the versatility of the default leader board.

Current Functions:

Leaderboard Create (); // Initializes the leader board by creating the dialogs and setting player variables. This should be called on map initialization.
Leaderboard Record Kill (); // Takes the Killer and Killed (players) as parameters. Increases the kill count of the killer and increases death count of the killed. This should be called when a unit dies.
Leaderboard Eliminate (); // Sets the eliminated flag of a player on or off. When eliminated, a player's row on the board turns red and the player drops to the bottom. This should be called when a player leaves or is eliminated.
Leaderboard Minimize (); // Minimizes the leader board by hiding the full dialog and showing the minimized dialog. This should be called when a user clicks on the minimize button.
Leaderboard Maximize (); // Maximizes the leader board by showing the full dialog and hiding the minimized dialog. This should be called when a user clicks on the maximize button.

Current GET/SET Functions:

Leaderboard Min Button (); // GET - Returns a reference to the minimize button. This should be compared to "Used Dialog Item" when "Any Player clicks Any Dialog Item". On a match, you should call Leaderboard Minimize().
Leaderboard Max Button (); // GET - Returns a reference to the maximize button. This should be compared to "Used Dialog Item" when "Any Player clicks Any Dialog Item". On a match, you should call Leaderboard Maximize().
Leaderboard Kills (); // GET - Returns the amount of kills a specified player has. General use.
Leaderboard Deaths (); // GET - Returns the amount of deaths a specified player has. General use.

Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files