mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-19 13:59:22 -04:00
36 lines
822 B
C#
36 lines
822 B
C#
using Sandbox;
|
|
|
|
public partial class MenuOverlay : RootPanel, IAchievementListener
|
|
{
|
|
public void OnAchievementUnlocked( IAchievementListener.UnlockDescription data )
|
|
{
|
|
// should we async this and wait for the achievement texture to load?
|
|
// should we pre-download the achievement textures with the package?
|
|
|
|
var popup = new Sandbox.OverlayPopups.AchievementUnlocked();
|
|
popup.Title = data.Title;
|
|
popup.Description = data.Description;
|
|
popup.Icon = data.Icon;
|
|
popup.Score = data.ScoreAdded;
|
|
popup.PlayerScore = data.TotalPlayerScore;
|
|
AddPopup( popup, null );
|
|
}
|
|
|
|
/*
|
|
RealTimeSince timeSinceRun;
|
|
|
|
public override void Tick()
|
|
{
|
|
base.Tick();
|
|
|
|
if ( timeSinceRun > 6 )
|
|
{
|
|
timeSinceRun = 0;
|
|
|
|
var popup = new Sandbox.OverlayPopups.AchievementUnlocked();
|
|
AddPopup( popup, null );
|
|
}
|
|
}
|
|
*/
|
|
}
|