public C4Arm() { Instance = this; TimerText = "00:00"; for (int i = 0; i < C4Entity.TimerPresets.Length; i++) { int selectedPresetIndex = i; if (i == 0) { SetTimer(selectedPresetIndex); } TimerButtonPanel.Add.Button(Utils.TimerString(C4Entity.TimerPresets[selectedPresetIndex].Timer), "button", () => { SetTimer(selectedPresetIndex); }); } ActionButtonPanel.Add.TranslationButton(new TranslationData("EQUIPMENT.C4.UI.PICKUP"), null, "button action-button", () => { C4Entity.PickUp(Entity.NetworkIdent, Local.Pawn.NetworkIdent); }); ActionButtonPanel.Add.TranslationButton(new TranslationData("EQUIPMENT.C4.UI.DESTROY"), null, "button action-button", () => { C4Entity.Delete(Entity.NetworkIdent); }); ActionButtonPanel.Add.TranslationButton(new TranslationData("EQUIPMENT.C4.UI.ARM"), null, "button arm-button", () => { C4Entity.Arm(Entity.NetworkIdent, _selectedPresetIndex); }); this.Enabled(false); }
public void Open(C4Entity entity) { Entity = entity; this.Enabled(true); }