void LoadSecurityProps() { sec_cbLogNotes.Checked = Server.Config.LogNotes; sec_cbVerifyAdmins.Checked = Server.Config.verifyadmins; sec_cbWhitelist.Checked = Server.Config.WhitelistedOnly; GuiPerms.SetRanks(sec_cmbVerifyRank); GuiPerms.SetSelectedRank(sec_cmbVerifyRank, Server.Config.VerifyAdminsRank); sec_cmbVerifyRank.Enabled = Server.Config.verifyadmins; sec_cbChatAuto.Checked = Server.Config.ChatSpamCheck; sec_numChatMsgs.Value = Server.Config.ChatSpamCount; sec_numChatSecs.Value = Server.Config.ChatSpamInterval; sec_numChatMute.Value = Server.Config.ChatSpamMuteTime; ToggleChatSpamSettings(Server.Config.ChatSpamCheck); sec_cbCmdAuto.Checked = Server.Config.CmdSpamCheck; sec_numCmdMsgs.Value = Server.Config.CmdSpamCount; sec_numCmdSecs.Value = Server.Config.CmdSpamInterval; sec_numCmdMute.Value = Server.Config.CmdSpamBlockTime; ToggleCmdSpamSettings(Server.Config.CmdSpamCheck); sec_cbBlocksAuto.Checked = Server.Config.BlockSpamCheck; sec_numBlocksMsgs.Value = Server.Config.BlockSpamCount; sec_numBlocksSecs.Value = Server.Config.BlockSpamInterval; ToggleBlocksSpamSettings(Server.Config.BlockSpamCheck); sec_cbIPAuto.Checked = Server.Config.IPSpamCheck; sec_numIPMsgs.Value = Server.Config.IPSpamCount; sec_numIPSecs.Value = Server.Config.IPSpamInterval; sec_numIPMute.Value = Server.Config.IPSpamBlockTime; ToggleIPSpamSettings(sec_cbIPAuto.Checked); }
void CommandInitExtraPerms() { extraPermsList = CommandExtraPerms.FindAll(cmd.name); for (int i = 0; i < commandExtraBoxes.Length; i++) { commandExtraBoxes[i].Visible = false; commandExtraLabels[i].Visible = false; } if (cmd.ExtraPerms == null) { extraPermsList.Clear(); } int height = 12; for (int i = 0; i < extraPermsList.Count; i++) { CommandExtraPerms perms = LookupExtraPerms(extraPermsList[i].CmdName, extraPermsList[i].Num); if (perms == null) { perms = extraPermsList[i]; } GuiPerms.SetSelectedRank(commandExtraBoxes[i], perms.MinRank); commandExtraBoxes[i].Visible = true; commandExtraLabels[i].Text = "+ " + perms.Desc; commandExtraLabels[i].Visible = true; height = commandExtraBoxes[i].Bottom + 12; } cmd_grpExtra.Visible = extraPermsList.Count > 0; cmd_grpExtra.Height = height; }
static void SetSpecificPerms(List <LevelPermission> perms, ComboBox[] boxes) { ComboBox box = null; int permsCount = perms == null ? 0 : perms.Count; for (int i = 0; i < boxes.Length; i++) { box = boxes[i]; // Hide the non-visible specific permissions box.Text = ""; box.Enabled = false; box.Visible = false; box.SelectedIndex = -1; // Show the non-visible specific permissions previously set if (permsCount > i) { box.Visible = true; box.Enabled = true; GuiPerms.SetSelectedRank(box, perms[i]); } } // Show (add rank) for the last item if (permsCount >= boxes.Length) { return; } SetAddRank(boxes[permsCount]); }
void Eco_UpdateItem() { eco_gbItem.Text = eco_curItem.Name; eco_numItemPrice.Value = eco_curItem.Price; Eco_UpdateItemEnables(); GuiPerms.SetSelectedRank(eco_cmbItemRank, eco_curItem.PurchaseRank); }
public void Update(ItemPerms perms) { SupressEvents = true; GuiPerms.SetSelectedRank(MinBox, perms.MinRank); SetSpecificPerms(perms.Allowed, AllowBoxes); SetSpecificPerms(perms.Disallowed, DisallowBoxes); SupressEvents = false; }
void LoadRankProps() { LoadDefaultRank(); GuiPerms.SetRanks(rank_cmbOsMap); GuiPerms.SetSelectedRank(rank_cmbOsMap, Server.Config.OSPerbuildDefault); rank_cbTPHigher.Checked = Server.Config.HigherRankTP; rank_cbSilentAdmins.Checked = Server.Config.AdminsJoinSilently; rank_cbEmpty.Checked = Server.Config.ListEmptyRanks; }
void LoadIRCProps() { irc_chkEnabled.Checked = Server.Config.UseIRC; irc_txtServer.Text = Server.Config.IRCServer; irc_numPort.Value = Server.Config.IRCPort; irc_txtNick.Text = Server.Config.IRCNick; irc_txtChannel.Text = Server.Config.IRCChannels; irc_txtOpChannel.Text = Server.Config.IRCOpChannels; irc_chkPass.Checked = Server.Config.IRCIdentify; irc_txtPass.Text = Server.Config.IRCPassword; irc_cbTitles.Checked = Server.Config.IRCShowPlayerTitles; irc_cbWorldChanges.Checked = Server.Config.IRCShowWorldChanges; irc_cbAFK.Checked = Server.Config.IRCShowAFK; ToggleIrcSettings(Server.Config.UseIRC); GuiPerms.SetRanks(irc_cmbRank); GuiPerms.SetSelectedRank(irc_cmbRank, Server.Config.IRCControllerRank); irc_cmbVerify.Items.AddRange(Enum.GetNames(typeof(IRCControllerVerify))); irc_cmbVerify.SelectedIndex = (int)Server.Config.IRCVerify; irc_txtPrefix.Text = Server.Config.IRCCommandPrefix; }