Map Picker

Library
Hard loop updated 3y ago 0 MB engine 10
thumb_up 5 open_in_new View on sbox.game
Map Picker

About Map Picker

Easily add a map vote at the end of your game (or whenever you wish) with the map picker library. Supports both user defined map lists, and Asset.Party!

Usage Guide

public static async Task EndGame()
{
  // Define maps - The background ImageURL is optional.
  List<MapPicker.MapInfo> maps = new List<MapPicker.MapInfo>()
      {
          new MapPicker.MapInfo(){ Name = "Dust II", Id = "dust2", ImageURL="https://source.unsplash.com/random/200x200?sig=1" },
          new MapPicker.MapInfo(){ Name = "Inferno", Id = "inferno" },
          new MapPicker.MapInfo(){ Name = "Nuke", Id = "nuke" }
      };

  // Assign user maps.
  Vote.AddMapsFromList( maps );

  // Add maps from asset party.
  await Vote.AddAssetPartyMapsUsingSearchString( "surf" );
  await Vote.AddAssetPartyMapsFromCollectionName( "xenthio.coolmaps" );

  // Begin vote when you're ready, providing the time in seconds you wish the vote to run for.
  // This will display map vote UI on all connected clients.
  Vote.BeginVote( 10 );
}

// Subscribe to completion event to retrieve the map ID that was top voted.
[Event( "MapPicker.VoteFinished" )]
public void OnVoteFinished( string Id )
{
  Log.Info( $"MapPicker.VoteFinished: {Id}" );
}



Roadmap




- Add scrollbar (scroll works, but no scrollbar is visible)
- Add optional "Replay" or "Random" buttons.
- Add maps on the fly as admin via CMD.
- Add "disabled" flag for a map (perhaps they have been recently played, but you still want them shown in list).
- Ability to scale vote depending on client ID (useful for VIP, or scaling based on player level).


Contribute

Check out the source and contribute @ https://github.com/TomYeoman/map-picker

No usage statistics available
This package may be new or not widely used yet. Usage data becomes available as more users install and play with the package.
0 recorded entries
Rank Player Score Recorded
refresh
Discovering package leaderboards...
Package ID: hardloop.map_picker
Created: 2023-08-07 20:32 UTC
Updated: 2023-08-09 19:35 UTC
Type: library
Public: Yes
Version: 31864
files: 5
Size: 0.0 MB
Engine Version: 10
Asset Version ID: 31864
Version Created: 2023-08-09 19:35 UTC
Hash: 1604892229360459449
Manifest: Open manifest

more_horiz Additional Properties

Project Template:
new_releases Latest Update Aug 9, 2023
Changes on 2023-08-09
31864 Aug 9, 2023
Changes on 2023-08-09
31695 Aug 8, 2023
Changes on 2023-08-08
31513 Aug 7, 2023
Changes on 2023-08-07
31492 Aug 7, 2023
Changes on 2023-08-07
info Live API Passthrough & Removal Notice

This file manifest and asset metadata are retrieved live directly from the official Facepunch s&box public API. s&box Explorer does not host, store, or redistribute any package files. All download links route directly to Facepunch CDN servers.