private void AddLevelVariablesToEffects(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues) { string strFriendlyContextName = lvRequestedContext.Context.ToString(); if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All) { strFriendlyContextName = this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.all"); } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode) { strFriendlyContextName = this.Client.GetFriendlyGamemode(lvRequestedContext.Context.ContextTarget); } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.Level) { strFriendlyContextName = this.Client.GetFriendlyMapname(lvRequestedContext.Context.ContextTarget); } ListViewItem newItem = this.CreateVariableEffectItem(lvRequestedContext.Context.ToString(), strFriendlyContextName, this.Font); if (this.lsvEvaluatedEffect.Items.ContainsKey(newItem.Name) == false) { this.lsvEvaluatedEffect.Items.Add(newItem); } this.SetLevelVariablesToEffects(lvRequestedContext, lstReturnedValues); }
private void SetLevelVariable(LevelVariable levelVar) { object value = null; if (String.Compare(levelVar.VariableName, "vehiclesdisabled", true) == 0) { value = levelVar.GetValue <bool>(false); } else { value = levelVar.GetValue <decimal>(100); } string responseKey = String.Format("levelvars.set {0}", levelVar.VariableName.ToLower()); this.OnSettingResponse(responseKey, value, true); if (this.AsyncSettingControls.ContainsKey(responseKey) == true) { foreach (Control enableControl in this.AsyncSettingControls[responseKey].ma_ctrlEnabledInputs) { if ((enableControl is Label && !(enableControl is LinkLabel)) || enableControl is CheckBox) { enableControl.ForeColor = Color.LightSeaGreen; enableControl.Font = new Font(this.Font, FontStyle.Bold); } } } }
private bool isApplicableContext(LevelVariable lvRequestedContext) { LevelVariableContext selectedContext = this.GetSelectedContext(); bool returnIsApplicableContext = false; if (lvRequestedContext.Context.CompareTo(selectedContext) == 0) { returnIsApplicableContext = true; } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All) { returnIsApplicableContext = true; } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode && selectedContext.ContextType == LevelVariableContextType.Level) { string targetPlaylist = this.Client.GetPlaylistByMapname(selectedContext.ContextTarget); if (String.Compare(lvRequestedContext.Context.ContextTarget, targetPlaylist, true) == 0) { returnIsApplicableContext = true; } } return(returnIsApplicableContext); }
private void ValidateAddLevelVariablesToEffects(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues) { this.InvokeIfRequired(() => { LevelVariableContext selectedContext = this.GetSelectedContext(); if (this.isApplicableContext(lvRequestedContext) == true) { this.AddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues); if (lvRequestedContext.Context.CompareTo(selectedContext) == 0) { if (this.lsvEvaluatedEffect.Items.ContainsKey("totalEvaluatedEffects") == false) { this.lsvEvaluatedEffect.Items.Add(this.CreateVariableEffectItem("totalEvaluatedEffects", this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.totalEvaluatedEffects"), new Font(this.Font, FontStyle.Bold))); } this.UpdateTotalEffects(); } } foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns) { col.Width = -2; } }); }
public override void OnLevelVariablesList(LevelVariable requestedContext, List <LevelVariable> returnedValues) { base.OnLevelVariablesList(requestedContext, returnedValues); Output.Information("{0}: Request VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesList", requestedContext.VariableName, requestedContext.RawValue, requestedContext.Context.ContextType, requestedContext.Context.ContextTarget); foreach (var returnedValue in returnedValues) { Output.Information("{0}: Return VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesList", returnedValue.VariableName, returnedValue.RawValue, returnedValue.Context.ContextType, returnedValue.Context.ContextTarget); } }
private void m_prcClient_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues) { LevelVariableContext selectedContext = this.GetSelectedContext(); if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) { this.SetCurrentSelectedLevelVariables(lstReturnedValues); } this.ValidateAddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues); }
private void m_prcClient_LevelVariablesClear(FrostbiteClient sender, LevelVariable lvRequestedContext) { LevelVariableContext selectedContext = this.GetSelectedContext(); if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) { this.GetSelectedLevelVariables(); this.OnSettingResponse("levelvars.clear", true, true); } }
protected virtual void Client_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues) { foreach (LevelVariable variable in lstReturnedValues) { if (variable.Context.ContextTarget.Length > 0) { this.AppendSetting(String.Format("levelVars.set {0} {1} {2}", variable.Context.ContextType.ToString().ToLower(), variable.Context.ContextTarget, variable.VariableName), variable.RawValue); } else { this.AppendSetting(String.Format("levelVars.set {0} {1}", variable.Context.ContextType.ToString().ToLower(), variable.VariableName), variable.RawValue); } } }
private void m_prcClient_LevelVariablesSet(FrostbiteClient sender, LevelVariable lvRequestedContext) { LevelVariableContext selectedContext = this.GetSelectedContext(); // If they are an exact match (we or another account is editing what we are editing) if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) { this.SetLevelVariable(lvRequestedContext); } // If the variable applies to our currently editing context. if (this.isApplicableContext(lvRequestedContext) == true) { this.SetLevelVariablesToEffects(lvRequestedContext, new List <LevelVariable>() { lvRequestedContext }); } }
private void SetLevelVariablesToEffects(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues) { if (this.lsvEvaluatedEffect.Items.ContainsKey(lvRequestedContext.Context.ToString()) == true) { ListViewItem item = this.lsvEvaluatedEffect.Items[lvRequestedContext.Context.ToString()]; foreach (LevelVariable variable in lstReturnedValues) { if (item.SubItems.ContainsKey(variable.VariableName) == true) { item.SubItems[variable.VariableName].Text = variable.RawValue; } } foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns) { col.Width = -2; } this.UpdateTotalEffects(); } }
void Client_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) { foreach (LevelVariable variable in lstReturnedValues) { if (variable.Context.ContextTarget.Length > 0) { this.AppendSetting(String.Format("levelVars.set {0} {1} {2}", variable.Context.ContextType.ToString().ToLower(), variable.Context.ContextTarget, variable.VariableName), variable.RawValue); } else { this.AppendSetting(String.Format("levelVars.set {0} {1}", variable.Context.ContextType.ToString().ToLower(), variable.VariableName), variable.RawValue); } } }
private void m_prcClient_LevelVariablesSet(FrostbiteClient sender, LevelVariable lvRequestedContext) { LevelVariableContext selectedContext = this.GetSelectedContext(); // If they are an exact match (we or another account is editing what we are editing) if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) { this.SetLevelVariable(lvRequestedContext); } // If the variable applies to our currently editing context. if (this.isApplicableContext(lvRequestedContext) == true) { this.SetLevelVariablesToEffects(lvRequestedContext, new List<LevelVariable>() { lvRequestedContext }); } }
public virtual void OnLevelVariablesSet(LevelVariable requestedContext) { }
public void OnLevelVariablesClear(LevelVariable lvRequestedContext) { }
public void OnLevelVariablesGet(LevelVariable lvRequestedContext, LevelVariable lvReturnedValue) { }
private void m_prcClient_LevelVariablesGet(FrostbiteClient sender, LevelVariable lvRequestedContext, LevelVariable lvReturnedValue) { InvokeOnAllEnabled("OnLevelVariablesGet", new object[] {lvRequestedContext, lvReturnedValue}); }
private void SetLevelVariable(LevelVariable levelVar) { object value = null; if (String.Compare(levelVar.VariableName, "vehiclesdisabled", true) == 0) { value = levelVar.GetValue<bool>(false); } else { value = levelVar.GetValue<decimal>(100); } string responseKey = String.Format("levelvars.set {0}", levelVar.VariableName.ToLower()); this.OnSettingResponse(responseKey, value, true); if (this.AsyncSettingControls.ContainsKey(responseKey) == true) { foreach (Control enableControl in this.AsyncSettingControls[responseKey].ma_ctrlEnabledInputs) { if ((enableControl is Label && !(enableControl is LinkLabel)) || enableControl is CheckBox) { enableControl.ForeColor = Color.LightSeaGreen; enableControl.Font = new Font(this.Font, FontStyle.Bold); } } } }
public void OnLevelVariablesSet(LevelVariable lvRequestedContext) { }
private void m_prcClient_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) { this.InvokeOnAllEnabled("OnLevelVariablesList", new object[] { lvRequestedContext, lstReturnedValues }); }
public override void OnLevelVariablesEvaluate(LevelVariable requestedContext, LevelVariable returnedValue) { base.OnLevelVariablesEvaluate(requestedContext, returnedValue); Output.Information("{0}: Request VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesEvaluate", requestedContext.VariableName, requestedContext.RawValue, requestedContext.Context.ContextType, requestedContext.Context.ContextTarget); Output.Information("{0}: Return VarName:{1} Value:{2} Type:{3} Target:{4}", "OnLevelVariablesEvaluate", returnedValue.VariableName, returnedValue.RawValue, returnedValue.Context.ContextType, returnedValue.Context.ContextTarget); }
protected virtual void DispatchLevelVarsEvaluateResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) { if (cpRecievedPacket.Words.Count >= 2 && cpRequestPacket.Words.Count >= 2) { LevelVariable request = new LevelVariable(new LevelVariableContext(String.Empty, String.Empty), cpRequestPacket.Words[1], cpRecievedPacket.Words[1]); if (this.LevelVariablesEvaluate != null) { FrostbiteConnection.RaiseEvent(this.LevelVariablesEvaluate.GetInvocationList(), this, request); } } }
public virtual void OnLevelVariablesGet(LevelVariable requestedContext, LevelVariable returnedValue) { }
protected virtual void DispatchLevelVarsEvaluateResponse(FrostbiteConnection sender, Packet cpRecievedPacket, Packet cpRequestPacket) { if (cpRecievedPacket.Words.Count >= 2 && cpRequestPacket.Words.Count >= 2) { var request = new LevelVariable(new LevelVariableContext(String.Empty, String.Empty), cpRequestPacket.Words[1], cpRecievedPacket.Words[1]); if (LevelVariablesEvaluate != null) { this.LevelVariablesEvaluate(this, request, null); } } }
private void m_prcClient_LevelVariablesSet(FrostbiteClient sender, LevelVariable lvRequestedContext) { InvokeOnAllEnabled("OnLevelVariablesSet", new object[] {lvRequestedContext}); }
public void OnLevelVariablesList(LevelVariable lvRequestedContext, List <LevelVariable> lstReturnedValues) { }
private void ValidateAddLevelVariablesToEffects(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) { LevelVariableContext selectedContext = this.GetSelectedContext(); if (this.isApplicableContext(lvRequestedContext) == true) { this.AddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues); if (lvRequestedContext.Context.CompareTo(selectedContext) == 0) { if (this.lsvEvaluatedEffect.Items.ContainsKey("totalEvaluatedEffects") == false) { this.lsvEvaluatedEffect.Items.Add(this.CreateVariableEffectItem("totalEvaluatedEffects", this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.totalEvaluatedEffects"), new Font(this.Font, FontStyle.Bold))); } this.UpdateTotalEffects(); } } foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns) { col.Width = -2; } }
public void OnLevelVariablesList(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) { }
private void m_prcClient_LevelVariablesList(FrostbiteClient sender, LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) { LevelVariableContext selectedContext = this.GetSelectedContext(); if (selectedContext.CompareTo(lvRequestedContext.Context) == 0) { this.SetCurrentSelectedLevelVariables(lstReturnedValues); } this.ValidateAddLevelVariablesToEffects(lvRequestedContext, lstReturnedValues); }
private void SetLevelVariablesToEffects(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) { if (this.lsvEvaluatedEffect.Items.ContainsKey(lvRequestedContext.Context.ToString()) == true) { ListViewItem item = this.lsvEvaluatedEffect.Items[lvRequestedContext.Context.ToString()]; foreach (LevelVariable variable in lstReturnedValues) { if (item.SubItems.ContainsKey(variable.VariableName) == true) { item.SubItems[variable.VariableName].Text = variable.RawValue; } } foreach (ColumnHeader col in this.lsvEvaluatedEffect.Columns) { col.Width = -2; } this.UpdateTotalEffects(); } }
public virtual void OnLevelVariablesList(LevelVariable requestedContext, List <LevelVariable> returnedValues) { }
public virtual void OnLevelVariablesList(LevelVariable requestedContext, List<LevelVariable> returnedValues) { }
private void AddLevelVariablesToEffects(LevelVariable lvRequestedContext, List<LevelVariable> lstReturnedValues) { string strFriendlyContextName = lvRequestedContext.Context.ToString(); if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All) { strFriendlyContextName = this.Language.GetLocalized("uscServerSettingsPanel.lsvEvaluatedEffect.items.all"); } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode) { strFriendlyContextName = this.Client.GetFriendlyGamemode(lvRequestedContext.Context.ContextTarget); } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.Level) { strFriendlyContextName = this.Client.GetFriendlyMapname(lvRequestedContext.Context.ContextTarget); } ListViewItem newItem = this.CreateVariableEffectItem(lvRequestedContext.Context.ToString(), strFriendlyContextName, this.Font); if (this.lsvEvaluatedEffect.Items.ContainsKey(newItem.Name) == false) { this.lsvEvaluatedEffect.Items.Add(newItem); } this.SetLevelVariablesToEffects(lvRequestedContext, lstReturnedValues); }
private bool isApplicableContext(LevelVariable lvRequestedContext) { LevelVariableContext selectedContext = this.GetSelectedContext(); bool returnIsApplicableContext = false; if (lvRequestedContext.Context.CompareTo(selectedContext) == 0) { returnIsApplicableContext = true; } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.All) { returnIsApplicableContext = true; } else if (lvRequestedContext.Context.ContextType == LevelVariableContextType.GameMode && selectedContext.ContextType == LevelVariableContextType.Level) { string targetPlaylist = this.Client.GetPlaylistByMapname(selectedContext.ContextTarget); if (String.Compare(lvRequestedContext.Context.ContextTarget, targetPlaylist, true) == 0) { returnIsApplicableContext = true; } } return returnIsApplicableContext; }