This repository was archived by the owner on Jan 31, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathEntrypoint.cs
More file actions
76 lines (57 loc) · 2.04 KB
/
Copy pathEntrypoint.cs
File metadata and controls
76 lines (57 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
using DynamicFuel.Modules;
[assembly: Rage.Attributes.Plugin("DynamicFuel", Author = "Venoxity Development", PrefersSingleInstance = true, ShouldTickInPauseMenu = true, SupportUrl = "https://discord.gg/jCEdAF8AQz")]
namespace DynamicFuel
{
public class Entrypoint : CommonPlugin
{
#region Fields
private static readonly Dictionary<string, DecoratorType> decorators = new Dictionary<string, DecoratorType>()
{
{ "_Fuel_Level", DecoratorType.Float },
};
#endregion
#region Plugin Lifecycle
public static void Main()
{
DependencyManager.AddDependency("NAudio.dll", "2.2.1");
DependencyManager.AddDependency("Venoxity.Common.dll", "1.0.8");
if (!DependencyManager.CheckDependencies()) return;
InitializePlugin();
}
#endregion
#region Plugin Initialization
private static void InitializePlugin()
{
Settings.Initialize();
Decorators.Initialize();
Decorators.Register(decorators);
GasStationManager.SetupGasStationBlips();
GasStationManager.StartPumpPropManagement();
FuelSystem.Start();
LastWorldTime = DateTime.UtcNow;
}
#endregion
#region Unload
public static void OnUnload(bool isTerminating)
{
Logging.Info($"Plugin unloading initiated.", "EntryPoint");
try
{
CleanUp();
Logging.Info("Plugin successfully unloaded.", "EntryPoint");
}
catch (Exception ex)
{
Logging.Error($"Error during unload: {ex.Message}", "EntryPoint");
}
}
private static void CleanUp()
{
Logging.Info("Cleaning up resources...", "EntryPoint");
GasStationManager.DeleteAllBlips();
GasStationManager.DeleteAllPumps();
GasStationManager.DeleteNozzleAndRope();
}
#endregion
}
}