File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,6 +239,32 @@ namespace Example
239239}
240240```
241241
242+ # Storing items and spacers to change them later:
243+ ```c#
244+ [ConsoleCommand (" css_menuspacer" )]
245+ public void MenuSpacer(CCSPlayerController player, CommandInfo info)
246+ {
247+ if (player == null)
248+ return;
249+
250+ Menu menu = new Menu(this)
251+ {
252+ Title = "Test Spacer Menu"
253+ };
254+
255+ var spacer1 = menu .AddSpacer (" Spacer Test" ); // we store this in a variable
256+ menu .AddItem (" Change Spacer Text" , (p , o ) =>
257+ {
258+ spacer1 .Text = " Changed Spacer Text" ; // then just change the text here then refresh.
259+ p .PrintToChat (" Spacer text changed!" );
260+
261+ menu .Refresh ();
262+ });
263+
264+ menu .Display (player );
265+ }
266+ ```
267+
242268You can use this API in your project by installing it from Manage NuGet Packages or add it with this command
243269``` cmd
244270dotnet add package CS2ScreenMenuAPI
You can’t perform that action at this time.
0 commit comments