class menu_c_Optimizer extends GUI2K4.MidGamePanel
 config(HideMut);

var a_MonsterOptimizer MOpt;
var bool bIsConfigLoaded;

// ================================================================= Interface section
var    automated  GUIButton     b_CullDistance_Zeds, b_StopOptimizer_Zeds, b_GlobalSaveConfig, b_GlobalLoadConfig, 
                              b_LoadVanillaMonsters, b_LoadHillbillyMonsters, b_LoadXMASMonsters, b_LoadCircusMonsters,  b_LoadCustomMonsters,
                              // Karma params
                              b_LoadDefaultKarmaParams, b_LoadConfigKarmaParams, b_SaveConfigKarmaParams, b_ApplyKarmaParams, b_RemoveBodies,
                              // Log shit
                              b_ClearLog, b_ToggleZedSpy, b_Settings,
                              // Switches
                              b_ReplacerPrefs, b_NetPrefs, b_ZedsPrefs, b_OptimizerPrefs;

var automated MOCheckBox       ch_Unlit, ch_SeasonedOff,ch_LagOff,
                              // Karma params
                              ch_newbKStaticFriction, ch_NoRagdolls,
                              // gibz
                              ch_GibControl,ch_GibUnlit, ch_GibHidden,ch_GibletsControl, ch_GibletUnlit,ch_GibletHidden, ch_GibUseDeferRendering,
                              ch_GibUseCollisionStaticMesh, ch_GibAcceptProjectors, ch_GibStaticLighting, ch_GibletsUseDeferRendering, ch_GibletsUseCollisionStaticMesh,
                              ch_GibletsAcceptProjectors, ch_GibletsStaticLighting,
                              //
                              ch_UseFireTweaks, ch_bDynamicLight, ch_bSpecialLit, ch_UseAdditionalTweaks, ch_FixDoshLighting,
                              // new flagz
                              ch_ConsNetSpeed, ch_bMonsterSpotted, ch_bStandard, ch_bCircus, ch_bHillbilly, ch_bXMas, ch_UserSettingsToEmitters;

var automated MoComboBox      mo_SoundOcclusion,  mo_GoreLevel, mo_MapSettings, mo_LightType, mo_WholeMapSearchMethod;
    
var automated moNumericEdit   nu_NewTicks, nu_SoundRadius, nu_default_NetSpeed, nu_new_NetSpeed, nu_AmbientGlow,
                              // Karma params
                              nu_newMaxRagdolls, nu_ZedSearchRadius,
                              // Fire and dosh
                              nu_LightBrightness, nu_LightSaturation, nu_LightHue, nu_GibletsMaxLights, nu_GibMaxLights;

var automated moFloatEdit     fl_CullDistance_Zeds, fl_Timer_for_Opt,
                              // Karma params
                              fl_newKarmaTimeScale, fl_newRagdollTimeScale, fl_newKarmaGravScale, fl_newRagdollLifeTime,
                              // gibs
                              fl_GibletLifespan, fl_GibLifespan,
                              // Fire and dosh
                              fl_LightRadius;

var automated GUISectionBackground  sb_Optimizer, sb_AssetLoader, sb_KarmaParams, sb_Log, sb_OptStarted, sb_GoreLevel, 
                                    sb_FireAndDosh, sb_ZedsPrefs, sb_NetPrefs, sb_ReplacerPrefs, sb_OptimizerButtons, sb_ZedSpy, sb_SwitchTo;

var automated GUIScrollTextBox      lb_Actions;


//================================================================Interface section ends

//==========================================Global config parameters
//*********Karma params for ragdolls

// Using LevelInfo default class pollution
// Cuz it's only way to go
struct KarmaParameters
{
  var bool  NoRagdolls;            // No ragdolls setting
  var float RagdollLifeTime;      // Ragdoll life time
  var int   MaxRagdolls;          // Maximum number of simultaneous rag-dolls.
  var float KarmaTimeScale;        // Karma physics timestep scaling.
  var float RagdollTimeScale;      // Ragdoll physics timestep scaling. This is applied on top of KarmaTimeScale.
  var float KarmaGravScale;        // Allows you to make ragdolls use lower friction than normal.
  var bool  bKStaticFriction;      // Better rag-doll/ground friction model, but more CPU.
};
var config KarmaParameters LevelKarmaParams;

// Karma params for ragdolls end
var config bool bOverrideMapParams, bStartOptimizer; // bLagOff; Flags for optimizer

//=========================================Map Specific config parameters
// Map specific optimizer parameters
struct MSParams
{
  var string MapName;
  var string ProfileName;
  var bool ActiveProfile;
  var a_MonsterOptimizer.OptParams OptimizerParams;
};
// =========================================  Map Specific config parameters
// ========================================== Global config parameters

var PlayerController PC;
var config a_MonsterOptimizer.OptParams MSOptGlobalParams;
var config a_MonsterOptimizer.EmitLightControl LC;
var config array<MSParams> MapSpecificParameters;    // Map specific settings for optimizer
var array<int> ProfileIndexes;                      // Profile Indexes for map specific parameters

// ========================================================== Interface section end

// =============================== Structures for optimizer paramas
enum ESoundOcclusion
{
  OCCLUSION_Default,
  OCCLUSION_None,
  OCCLUSION_BSP,
  OCCLUSION_StaticMeshes,
};
//===================================================================

simulated function InitComponent(GUIController MyController, GUIComponent MyOwner)
{
  super.InitComponent(MyController,MyOwner);

  mo_SoundOcclusion.AddItem("OCCLUSION_Default");
  mo_SoundOcclusion.AddItem("OCCLUSION_None");
  mo_SoundOcclusion.AddItem("OCCLUSION_BSP");
  mo_SoundOcclusion.AddItem("OCCLUSION_StaticMeshes");

  mo_GoreLevel.AddItem("TWI");
  mo_GoreLevel.AddItem("NO_GORE");
  mo_GoreLevel.AddItem("LOW_GORE");
  mo_GoreLevel.AddItem("OPTIMIZED_TWI");
  mo_GoreLevel.AddItem("GORY!");
  mo_GoreLevel.AddItem("BLOOD FOR THE BLOOD GOD!");

  mo_WholeMapSearchMethod.AddItem("DynamicActors");
  mo_WholeMapSearchMethod.AddItem("AllActors");
  mo_WholeMapSearchMethod.AddItem("ZoneActors");
  mo_WholeMapSearchMethod.AddItem("RadiusActors");

  mo_LightType.AddItem("LT_None");
  mo_LightType.AddItem("LT_Steady");
  mo_LightType.AddItem("LT_Pulse");
  mo_LightType.AddItem("LT_Blink");
  mo_LightType.AddItem("LT_Flicker");
  mo_LightType.AddItem("LT_Strobe");
  mo_LightType.AddItem("LT_BackdropLight");
  mo_LightType.AddItem("LT_SubtlePulse");
  mo_LightType.AddItem("LT_TexturePaletteOnce");
  mo_LightType.AddItem("LT_TexturePaletteLoop");
  mo_LightType.AddItem("LT_FadeOut");

  sb_SwitchTo.ManageComponent(b_OptimizerPrefs);
  sb_SwitchTo.ManageComponent(b_ZedsPrefs);
  sb_SwitchTo.ManageComponent(b_ReplacerPrefs);
  sb_SwitchTo.ManageComponent(b_NetPrefs);

  //=============================================Optimizer
  sb_ZedsPrefs.ManageComponent(fl_CullDistance_Zeds);
  sb_ZedsPrefs.ManageComponent(nu_SoundRadius);
  sb_ZedsPrefs.ManageComponent(mo_SoundOcclusion);
  sb_ZedsPrefs.ManageComponent(nu_AmbientGlow);  
  sb_ZedsPrefs.ManageComponent(ch_Unlit);
  sb_ZedsPrefs.ManageComponent(ch_bMonsterSpotted);

  sb_NetPrefs.ManageComponent(nu_default_NetSpeed);
  sb_NetPrefs.ManageComponent(nu_new_NetSpeed);
  sb_NetPrefs.ManageComponent(ch_ConsNetSpeed);

  sb_ReplacerPrefs.ManageComponent(ch_SeasonedOff);
  sb_ReplacerPrefs.ManageComponent(ch_bStandard);
  sb_ReplacerPrefs.ManageComponent(ch_bCircus);
  sb_ReplacerPrefs.ManageComponent(ch_bHillbilly);
  sb_ReplacerPrefs.ManageComponent(ch_bXMas);

  sb_Optimizer.ManageComponent(mo_MapSettings);
  sb_Optimizer.ManageComponent(mo_WholeMapSearchMethod);
  sb_Optimizer.ManageComponent(nu_ZedSearchRadius);
  sb_Optimizer.ManageComponent(fl_Timer_for_Opt);
  sb_Optimizer.ManageComponent(nu_NewTicks); 
  sb_Optimizer.ManageComponent(mo_GoreLevel);
  sb_Optimizer.ManageComponent(ch_LagOff);
  sb_Optimizer.ManageComponent(ch_UserSettingsToEmitters);

  sb_OptimizerButtons.ManageComponent(b_CullDistance_Zeds);
  sb_OptimizerButtons.ManageComponent(b_StopOptimizer_Zeds); 
  sb_OptimizerButtons.ManageComponent(b_GlobalSaveConfig);
  sb_OptimizerButtons.ManageComponent(b_GlobalLoadConfig);

  sb_AssetLoader.ManageComponent(b_LoadVanillaMonsters);
  sb_AssetLoader.ManageComponent(b_LoadHillbillyMonsters);
  sb_AssetLoader.ManageComponent(b_LoadXMASMonsters);
  sb_AssetLoader.ManageComponent(b_LoadCircusMonsters);
  sb_AssetLoader.ManageComponent(b_LoadCustomMonsters);

  //=============================================Optimizer
  sb_KarmaParams.ManageComponent(ch_NoRagdolls);
  sb_KarmaParams.ManageComponent(fl_newRagdollLifeTime);
  sb_KarmaParams.ManageComponent(ch_newbKStaticFriction);
  sb_KarmaParams.ManageComponent(nu_newMaxRagdolls);
  sb_KarmaParams.ManageComponent(fl_newKarmaTimeScale);
  sb_KarmaParams.ManageComponent(fl_newRagdollTimeScale);
  sb_KarmaParams.ManageComponent(fl_newKarmaGravScale);
  sb_KarmaParams.ManageComponent(b_ApplyKarmaParams);
  sb_KarmaParams.ManageComponent(b_LoadDefaultKarmaParams);
  sb_KarmaParams.ManageComponent(b_LoadConfigKarmaParams);
  sb_KarmaParams.ManageComponent(b_SaveConfigKarmaParams);
  sb_KarmaParams.ManageComponent(b_RemoveBodies);

  sb_GoreLevel.ManageComponent(ch_GibControl);
  sb_GoreLevel.ManageComponent(ch_GibUnlit);
  sb_GoreLevel.ManageComponent(ch_GibHidden);
  sb_GoreLevel.ManageComponent(fl_GibLifespan);
  sb_GoreLevel.ManageComponent(ch_GibUseDeferRendering);
  sb_GoreLevel.ManageComponent(nu_GibMaxLights);
  sb_GoreLevel.ManageComponent(ch_GibUseCollisionStaticMesh);
  sb_GoreLevel.ManageComponent(ch_GibAcceptProjectors);
  sb_GoreLevel.ManageComponent(ch_GibStaticLighting);

  sb_GoreLevel.ManageComponent(ch_GibletsControl);
  sb_GoreLevel.ManageComponent(ch_GibletUnlit);
  sb_GoreLevel.ManageComponent(ch_GibletHidden);
  sb_GoreLevel.ManageComponent(fl_GibletLifespan);
  sb_GoreLevel.ManageComponent(ch_GibletsUseDeferRendering);
  sb_GoreLevel.ManageComponent(nu_GibletsMaxLights);
  sb_GoreLevel.ManageComponent(ch_GibletsUseCollisionStaticMesh);
  sb_GoreLevel.ManageComponent(ch_GibletsAcceptProjectors);
  sb_GoreLevel.ManageComponent(ch_GibletsStaticLighting);

  sb_Log.ManageComponent(lb_Actions);
  sb_Log.ManageComponent(b_ClearLog);

  sb_FireAndDosh.ManageComponent(ch_UseFireTweaks);
  sb_FireAndDosh.ManageComponent(ch_UseAdditionalTweaks);
  sb_FireAndDosh.ManageComponent(ch_FixDoshLighting);
  sb_FireAndDosh.ManageComponent(nu_LightBrightness);
  sb_FireAndDosh.ManageComponent(nu_LightHue);
  sb_FireAndDosh.ManageComponent(nu_LightSaturation);
  sb_FireAndDosh.ManageComponent(mo_LightType);
  sb_FireAndDosh.ManageComponent(fl_LightRadius);
  sb_FireAndDosh.ManageComponent(ch_bSpecialLit);
  sb_FireAndDosh.ManageComponent(ch_bDynamicLight);

  sb_ZedSpy.ManageComponent(b_ToggleZedSpy);
  sb_ZedSpy.ManageComponent(b_Settings);

  // ControlsSizeScale();
  // Mopt.LC.UseFireTweaks;    // Use or not fire tweaks
  // Mopt.LC.LightRadius;      // Light radius for fire emitters
  // Mopt.LC.LightType;        // Light tyoe
  // Mopt.LC.LightBrightness;    
  // Mopt.LC.LightHue;        // Color
  // Mopt.LC.LightSaturation;  
  // Mopt.LC.bDynamicLight;    // Should be dynamic?
  // Mopt.LC.bSpecialLit;      // Don't lit dynamic actors
  // Mopt.LC.UseAdditionalTweaks;  // Use additional tweaks _> flashlight and etc.
  // Mopt.LC.FixDoshLighting;      // Attempt to dosh mesh lighting
}

function ShowPanel(bool bShow)
{
  super.ShowPanel(bShow);
  sb_ZedsPrefs.setVisibility(false);
  sb_NetPrefs.setVisibility(false);
  sb_ReplacerPrefs.setVisibility(false);
}

// ============== For controls resizing
function ControlsSizeScale()
{
  // Add this in init
  local GUIButton B;
  local int i;
  local string s;

  s = GetSizingCaption();

  for (i = 0; i < Controls.length; i++)
  {
    B = GUIButton(Controls[i]);
    if (B != none)
    {
      B.bAutoSize = true;
      B.SizingCaption = s;
      B.AutoSizePadding.HorzPerc = 0.04;
      B.AutoSizePadding.VertPerc = 0.6;
      continue;
    }
  }
}

function string GetSizingCaption()
{
  local int i;
  local string S;

  for (i = 0; i < Controls.length; i++)
  {
    if (GUIButton(Controls[i]) != none)
      if (S == "" || Len(GUIButton(Controls[i]).Caption) > Len(S))
        S = GUIButton(Controls[i]).Caption;
  }

  return S;
}


// ==================================================
event Opened(GUIComponent Sender)
{
  local int i, count, ActiveProfileIndex;
  local string MapName;

  super.Opened(Sender);
  PC = PlayerOwner();

  mapName = PC.Level.GetURLMap();
  if (!bIsConfigLoaded)
  {
    lb_Actions.AddText("Welcome to my Monster Optimizer!Here goes your logged actions, notifications and etc.");
    lb_Actions.AddText("|");
    LoadConfKarmaParams();
    lb_Actions.AddText("Loading config karma parameters...");
    lb_Actions.AddText("|");
  }

  if (bOverrideMapParams && !bIsConfigLoaded)
  {
    lb_Actions.AddText("GlobalOverride Flag detected. Loading config and iniatiliazing fields....");
    bIsConfigLoaded = true;
    GlobalLoadConfig();
    if (bStartOptimizer)
    {
      lb_Actions.AddText("Global AutoStart optimizer is set to true. Starting....");
      startOptimizer();  //Config load for function
    }
    else
      lb_Actions.AddText("Global AutoStart optimizer is set to false.");
    return;
  }

  // MSOptGlobalParams.ZedCullDistance
  // MSOptGlobalParams.Timer
  // MSOptGlobalParams.PC
  // MSOptGlobalParams.Ticks
  // MSOptGlobalParams.nozed_NetSpeed
  // MSOptGlobalParams.new_NetSpeed
  // MSOptGlobalParams.UseUnlit
  // MSOptGlobalParams.AmbientGlow
  // MSOptGlobalParams.bSeasonedOff
  // MSOptGlobalParams.bLagOff
  // MSOptGlobalParams.GoreLevel
  // MSOptGlobalParams.SoundOcclusion
  // MSOptGlobalParams.SoundRadius

  for (i = 0; i < MapSpecificParameters.Length; i++)
  {
    if (Instr(CAPS(MapSpecificParameters[i].MapName), CAPS(MapName)) != -1 )
    {
      if (MapSpecificParameters[i].OptimizerParams.ZedCullDistance > 0 )
      {
        ProfileIndexes[count] = i;    //Save profile indexes
        count++;      //Map specific parameters detected
        mo_MapSettings.AddItem(MapSpecificParameters[i].ProfileName);    //Add a profile name
        if (MapSpecificParameters[i].ActiveProfile)      //Saving Active profile for map
          ActiveProfileIndex = i;
      }
    }
  }

  if (count > 0 && !bOverrideMapParams)    //If map specific params detected
  {
    //Load active profile
    nu_NewTicks.SetValue(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.Ticks); 
    fl_CullDistance_Zeds.SetValue(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.ZedCullDistance); 
    fl_Timer_for_Opt.SetValue(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.Timer);  
    ch_Unlit.Checked(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.UseUnlit);
    ch_SeasonedOff.Checked(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.bSeasonedOff);
    nu_default_NetSpeed.SetValue(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.nozed_NetSpeed);
    nu_new_NetSpeed.SetValue(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.new_NetSpeed);
    ch_LagOff.Checked(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.bLagOff);
    nu_SoundRadius.SetValue(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.SoundRadius);
    mo_SoundOcclusion.SetIndex(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.SoundOcclusion);
    nu_AmbientGlow.SetValue(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.AmbientGlow);
    mo_GoreLevel.SetIndex(mo_GoreLevel.FindIndex(MapSpecificParameters[ActiveProfileIndex].OptimizerParams.GoreLevel));  
  }
}

//===============================================Karma related parameters for level info and monsters  
simulated function SetDefaultKarmaParams()
{
  //copy-pasted from default level info
  class'LevelInfo'.default.MaxRagdolls = 4;
  class'LevelInfo'.default.bKStaticFriction = true;
  class'LevelInfo'.default.KarmaTimeScale = 0.9;
  class'LevelInfo'.default.RagdollTimeScale = 1.0;
  class'LevelInfo'.default.KarmaGravScale=1.0;
  class'KFMonster'.default.RagdollLifeSpan = 30.00;

  if (MOpt == none)
  {
    MOpT = PC.Spawn(class'a_MonsterOptimizer', PC);
    MOpT.Level.MaxRagdolls = 4;
    MOpT.Level.bKStaticFriction = true;
    MOpT.Level.KarmaTimeScale = 0.9;
    MOpT.Level.RagdollTimeScale = 1.0;
    MOpT.Level.KarmaGravScale=1.0;
    MOpt.Destroy();
    MOpt = none;
  }
  else
  {
    MOpT.Level.MaxRagdolls = 4;
    MOpT.Level.bKStaticFriction = true;
    MOpT.Level.KarmaTimeScale = 0.9;
    MOpT.Level.RagdollTimeScale = 1.0;
    MOpT.Level.KarmaGravScale=1.0;
  }

  //copy-pasted from default level info
  ch_NoRagdolls.Checked(false);
  fl_newRagdollLifeTime.SetValue(30.00);  //KFMonster default shit
  ch_newbKStaticFriction.Checked(true);
  nu_newMaxRagdolls.SetValue(4);
  fl_newKarmaTimeScale.SetValue(0.9);
  fl_newRagdollTimeScale.SetValue(1.0);
  fl_newKarmaGravScale.SetValue(1.0);
  lb_Actions.AddText("Loaded default karma parameters.");
}

simulated function LoadConfKarmaParams()
{
  ch_NoRagdolls.Checked(LevelKarmaParams.NoRagdolls);
  fl_newRagdollLifeTime.SetValue(LevelKarmaParams.RagdollLifeTime);
  nu_newMaxRagdolls.SetValue(LevelKarmaParams.MaxRagdolls);
  fl_newKarmaTimeScale.SetValue(LevelKarmaParams.KarmaTimeScale);
  fl_newRagdollTimeScale.SetValue(LevelKarmaParams.RagdollTimeScale);
  fl_newKarmaGravScale.SetValue(LevelKarmaParams.KarmaGravScale);
  ch_newbKStaticFriction.Checked(LevelKarmaParams.bKStaticFriction);
  lb_Actions.AddText("Config karma parameters loaded.");
}

simulated function SaveConfKarmaParams()
{
  LevelKarmaParams.NoRagdolls = ch_NoRagdolls.IsChecked();
  LevelKarmaParams.RagdollLifeTime = fl_newRagdollLifeTime.GetValue();
  LevelKarmaParams.MaxRagdolls = nu_newMaxRagdolls.GetValue();
  LevelKarmaParams.KarmaTimeScale = fl_newKarmaTimeScale.GetValue();
  LevelKarmaParams.RagdollTimeScale = fl_newRagdollTimeScale.GetValue();
  LevelKarmaParams.KarmaGravScale = fl_newKarmaGravScale.GetValue();
  LevelKarmaParams.bKStaticFriction = ch_newbKStaticFriction.IsChecked();
  SaveConfig();
  lb_Actions.AddText("Config karma parameters saved.");
}

simulated function ApplyCurrentKarmaParams()
{
  if (!ch_NoRagdolls.IsChecked());
    class'LevelInfo'.default.MaxRagdolls = nu_newMaxRagdolls.GetValue();

  fl_newRagdollLifeTime.GetValue();
  class'LevelInfo'.default.bKStaticFriction = ch_newbKStaticFriction.IsChecked();
  class'LevelInfo'.default.KarmaTimeScale = fl_newKarmaTimeScale.GetValue();
  class'LevelInfo'.default.RagdollTimeScale = fl_newRagdollTimeScale.GetValue();
  class'LevelInfo'.default.KarmaGravScale=fl_newKarmaGravScale.GetValue();

  if (MOpt == none)
  {
    MOpT = PC.Spawn(class'a_MonsterOptimizer', PC);
    if (!ch_NoRagdolls.IsChecked())
      MOPT.Level.MaxRagdolls = nu_newMaxRagdolls.GetValue();
    MOPT.Level.bKStaticFriction = ch_newbKStaticFriction.IsChecked();
    MOPT.Level.KarmaTimeScale = fl_newKarmaTimeScale.GetValue();
    MOPT.Level.RagdollTimeScale = fl_newRagdollTimeScale.GetValue();
    MOPT.Level.KarmaGravScale=fl_newKarmaGravScale.GetValue();
    MOpt.Destroy();
    MOpt = none;
    lb_Actions.AddText("Karma parameters applied to LevelInfo default class.");
  }
  else
    lb_Actions.AddText("Stop optimizer before messing with params");
  //class'KFMonster'.default.RagdollLifeSpan = fl_newRagdollLifeTime.GetValue();   //Redundant and don't work TWI<3
}

//===============================================Karma related parameters for level info and monsters end
simulated function bool ButtonClicked(GUIComponent Sender)
{
  switch (Sender)
  {
    case b_CullDistance_Zeds:
      ApplyCurrentKarmaParams();
      startOptimizer();
      break;  

    case b_StopOptimizer_Zeds:
      stopOptimizer();
      break;  

    case b_GlobalSaveConfig:
      GlobalSaveConfig();
      break;

    case b_GlobalLoadConfig:
      GlobalLoadConfig();
      break;

    case b_LoadVanillaMonsters:
      OptimizerLoadAssets(0);    // Standard
      break;

    case b_LoadHillbillyMonsters:
      OptimizerLoadAssets(2);    // Halloween
      break;

    case b_LoadXMASMonsters:
      OptimizerLoadAssets(3);    // XMAS
      break;

    case b_LoadCircusMonsters:
      OptimizerLoadAssets(1);      // Circus
      break;

    case b_LoadCustomMonsters:
      OptimizerLoadAssets(4);      // Circus
      break;

    case b_ApplyKarmaParams:
      ApplyCurrentKarmaParams();
      break;

    case b_LoadDefaultKarmaParams:
      SetDefaultKarmaParams();
      break;

    case b_LoadConfigKarmaParams:
        LoadConfKarmaParams();
        break;

    case b_SaveConfigKarmaParams:
      SaveConfKarmaParams();
      break;

    case b_ClearLog:
      lb_Actions.SetContent("");
      break;

    case b_RemoveBodies:
      DestroyRagdolls();
      break;

    case b_OptimizerPrefs:
      sb_Optimizer.SetVisibility(true);
      sb_ReplacerPrefs.SetVisibility(false);
      sb_NetPrefs.SetVisibility(false);
      sb_ZedsPrefs.SetVisibility(false);
      break;

    case b_ReplacerPrefs:
      sb_Optimizer.SetVisibility(false);
      sb_ReplacerPrefs.SetVisibility(true);
      sb_NetPrefs.SetVisibility(false);
      sb_ZedsPrefs.SetVisibility(false);
      break;

    case b_NetPrefs:
      sb_Optimizer.SetVisibility(false);
      sb_ReplacerPrefs.SetVisibility(false);
      sb_NetPrefs.SetVisibility(true);
      sb_ZedsPrefs.SetVisibility(false);
      break;

    case b_ZedsPrefs:
      sb_Optimizer.SetVisibility(false);
      sb_ReplacerPrefs.SetVisibility(false);
      sb_NetPrefs.SetVisibility(false);
      sb_ZedsPrefs.SetVisibility(true);
      break;
  }
  return true;
}

//===============save and load config variables
simulated function GlobalSaveConfig()
{
  MSOptGlobalParams.Ticks = nu_NewTicks.GetValue();
  MSOptGlobalParams.ZedCullDistance = fl_CullDistance_Zeds.GetValue();
  MSOptGlobalParams.Timer = fl_Timer_for_Opt.GetValue();
  MSOptGlobalParams.UseUnlit = ch_Unlit.IsChecked();
  MSOptGlobalParams.bSeasonedOff = ch_SeasonedOff.IsChecked();
  MSOptGlobalParams.nozed_NetSpeed = nu_default_NetSpeed.GetValue();
  MSOptGlobalParams.new_NetSpeed =nu_new_NetSpeed.GetValue();
  MSOptGlobalParams.bLagOff = ch_LagOff.IsChecked();
  MSOptGlobalParams.SoundRadius = nu_SoundRadius.GetValue();
  MSOptGlobalParams.AmbientGlow = nu_AmbientGlow.GetValue();
  MSOptGlobalParams.GoreLevel = mo_GoreLevel.GetText();
  MSOptGlobalParams.bNoRagdolls = ch_NoRagdolls.IsChecked();

  MSOptGlobalParams.bAdvancedGiblets = ch_GibletsControl.IsChecked();
  MSOptGlobalParams.bAdvancedGibs = ch_GibControl.IsChecked();

  MSOptGlobalParams.bUnlitGibs = ch_GibUnlit.IsChecked();
  MSOptGlobalParams.bUnlitGiblets = ch_GibletUnlit.IsChecked();
  MSOptGlobalParams.bHideGibs = ch_GibHidden.IsChecked();
  MSOptGlobalParams.bHideGiblets= ch_GibletHidden.IsChecked();
  MSOptGlobalParams.GibsLifespan =  fl_GibLifespan.GetValue();
  MSOptGlobalParams.GibletsLifespan = fl_GibletLifespan.GetValue();
  MSOptGlobalParams.RagdollLifeSpan = fl_newRagdollLifeTime.GetValue();

  MsOptGlobalParams.GibUseDeferRendering = ch_GibUseDeferRendering.IsChecked();
  MsOptGlobalParams.GibMaxLights = nu_GibMaxLights.GetValue();
  MsOptGlobalParams.GibUseCollisionStaticMesh = ch_GibUseCollisionStaticMesh.IsChecked();
  MsOptGlobalParams.GibAcceptProjectors = ch_GibAcceptProjectors.IsChecked();
  MsOptGlobalParams.GibStaticLighting = ch_GibStaticLighting.IsChecked();

  MsOptGlobalParams.GibletsUseDeferRendering = ch_GibletsUseDeferRendering.IsChecked();
  MsOptGlobalParams.GibletsMaxLights = nu_GibletsMaxLights.GetValue();
  MsOptGlobalParams.GibletsUseCollisionStaticMesh = ch_GibletsUseCollisionStaticMesh.IsChecked();
  MsOptGlobalParams.GibletsAcceptProjectors = ch_GibletsAcceptProjectors.IsChecked();
  MsOptGlobalParams.GibletsStaticLighting = ch_GibletsStaticLighting.IsChecked();

  switch (mo_SoundOcclusion.GetIndex())
  {
    case 0:
      MSOptGlobalParams.SoundOcclusion = OCCLUSION_Default;
      break;
    case 1:
      MSOptGlobalParams.SoundOcclusion = OCCLUSION_None;
      break;
    case 2:
      MSOptGlobalParams.SoundOcclusion = OCCLUSION_BSP;
      break;
    case 3:
      MSOptGlobalParams.SoundOcclusion = OCCLUSION_StaticMeshes;
      break;
  }

  LC.UseFireTweaks = ch_UseFireTweaks.IsChecked();
  LC.LightRadius = fl_LightRadius.GetValue();

  LC.LightBrightness = nu_LightBrightness.GetValue();
  LC.LightHue = nu_LightHue.GetValue();
  LC.LightSaturation = nu_LightSaturation.GetValue();
  LC.bDynamicLight = ch_bDynamicLight.IsChecked();
  LC.bSpecialLit = ch_bSpecialLit.IsChecked();
  LC.UseAdditionalTweaks = ch_UseAdditionalTweaks.IsChecked();
  LC.FixDoshLighting = ch_FixDoshLighting.IsChecked();

  switch (mo_LightType.GetIndex())
  {
    case 0:
      LC.LightType = LT_None;
      break;
    case 1:
      LC.LightType = LT_Steady;
      break;
    case 2:
      LC.LightType = LT_Pulse;
      break;
    case 3:
      LC.LightType = LT_Blink;
      break;
    case 4:
      LC.LightType = LT_Flicker;
      break;
    case 5:
      LC.LightType = LT_Strobe;
      break;
    case 6:
      LC.LightType = LT_BackdropLight;
      break;
    case 7:
      LC.LightType = LT_SubtlePulse;
      break;
    case 8:
      LC.LightType = LT_TexturePaletteOnce;
      break;
    case 9:
      LC.LightType = LT_TexturePaletteLoop;
      break;
    case 10:
      LC.LightType = LT_FadeOut;
      break;
  } //;

  MsOptGlobalParams.ConsNetSpeed = ch_ConsNetSpeed.IsChecked();
  MsOptGlobalParams.bMonsterSpotted = ch_bMonsterSpotted.IsChecked();
  MsOptGlobalParams.bStandard = ch_bStandard.IsChecked();
  MsOptGlobalParams.bCircus = ch_bCircus.IsChecked();
  MsOptGlobalParams.bHillbilly = ch_bHillbilly.IsChecked();
  MsOptGlobalParams.bXMas = ch_bXMas.IsChecked();

  MsOptGlobalParams.WholeMapSearchMethod = mo_WholeMapSearchMethod.GetText();

  MsOptGlobalParams.UserSettingsToEmitters = ch_UserSettingsToEmitters.IsChecked();
  MsOptGlobalParams.ZedSearchRadius = nu_ZedSearchRadius.GetValue();
  SaveConfig();
  lb_Actions.AddText("Global parameters saved to config");
}

simulated function GlobalLoadConfig()
{
  if (MSOptGlobalParams.Timer > 0 && MSOptGlobalParams.nozed_NetSpeed > 0 && MSOptGlobalParams.new_NetSpeed > 0)
    bIsConfigLoaded = true;
  else
  {
    lb_Actions.AddText("You have corrupted global config variables. Can't load parameters...");
    bIsConfigLoaded = false;
    return;
  }

  nu_NewTicks.SetValue(MSOptGlobalParams.Ticks);
  fl_CullDistance_Zeds.SetValue(MSOptGlobalParams.ZedCullDistance);
  fl_Timer_for_Opt.SetValue(MSOptGlobalParams.Timer);
  ch_Unlit.Checked(MSOptGlobalParams.UseUnlit);
  ch_SeasonedOff.Checked(MSOptGlobalParams.bSeasonedOff);
  nu_default_NetSpeed.SetValue(MSOptGlobalParams.nozed_NetSpeed);
  nu_new_NetSpeed.SetValue(MSOptGlobalParams.new_NetSpeed);
  ch_LagOff.Checked(MSOptGlobalParams.bLagOff);
  nu_SoundRadius.SetValue(MSOptGlobalParams.SoundRadius);
  mo_SoundOcclusion.SetIndex(MSOptGlobalParams.SoundOcclusion);
  nu_AmbientGlow.SetValue(MSOptGlobalParams.AmbientGlow);
  mo_GoreLevel.SetIndex(mo_GoreLevel.FindIndex(CAPS(MSOptGlobalParams.GoreLevel)));
  ch_NoRagdolls.Checked(MSOptGlobalParams.bNoRagdolls);

  ch_GibletsControl.Checked(MSOptGlobalParams.bAdvancedGiblets);
  ch_GibControl.Checked(MSOptGlobalParams.bAdvancedGibs);

  ch_GibUnlit.Checked(MSOptGlobalParams.bUnlitGibs);
  ch_GibletUnlit.Checked(MSOptGlobalParams.bUnlitGiblets);
  ch_GibHidden.Checked(MSOptGlobalParams.bHideGibs);
  ch_GibletHidden.Checked(MSOptGlobalParams.bHideGiblets);
  fl_GibLifespan.SetValue(MSOptGlobalParams.GibsLifespan);
  fl_GibletLifespan.SetValue(MSOptGlobalParams.GibletsLifespan);

  fl_newRagdollLifeTime.SetValue(MSOptGlobalParams.RagdollLifeSpan);

  ch_GibUseDeferRendering.Checked(MsOptGlobalParams.GibUseDeferRendering);
  nu_GibMaxLights.SetValue(MsOptGlobalParams.GibMaxLights);
  ch_GibUseCollisionStaticMesh.Checked(MsOptGlobalParams.GibUseCollisionStaticMesh);
  ch_GibAcceptProjectors.Checked(MsOptGlobalParams.GibAcceptProjectors);
  ch_GibStaticLighting.Checked(MsOptGlobalParams.GibStaticLighting);

  ch_GibletsUseDeferRendering.Checked(MsOptGlobalParams.GibletsUseDeferRendering);
  nu_GibletsMaxLights.SetValue(MsOptGlobalParams.GibletsMaxLights);
  ch_GibletsUseCollisionStaticMesh.Checked(MsOptGlobalParams.GibletsUseCollisionStaticMesh);
  ch_GibletsAcceptProjectors.Checked(MsOptGlobalParams.GibletsAcceptProjectors);
  ch_GibletsStaticLighting.Checked(MsOptGlobalParams.GibletsStaticLighting);

  ch_UseFireTweaks.Checked(LC.UseFireTweaks);
  fl_LightRadius.SetValue(LC.LightRadius);

  nu_LightBrightness.SetValue(LC.LightBrightness);
  nu_LightHue.SetValue(LC.LightHue);
  nu_LightSaturation.SetValue(LC.LightSaturation);
  ch_bDynamicLight.Checked(LC.bDynamicLight);
  ch_bSpecialLit.Checked(LC.bSpecialLit);
  ch_UseAdditionalTweaks.Checked(LC.UseAdditionalTweaks);
  ch_FixDoshLighting.Checked(LC.FixDoshLighting);

  mo_LightType.SetIndex(LC.LightType);

  ch_ConsNetSpeed.Checked(MsOptGlobalParams.ConsNetSpeed);
  ch_bMonsterSpotted.Checked(MsOptGlobalParams.bMonsterSpotted);
  ch_bStandard.Checked(MsOptGlobalParams.bStandard);
  ch_bCircus.Checked(MsOptGlobalParams.bCircus);
  ch_bHillbilly.Checked(MsOptGlobalParams.bHillbilly);
  ch_bXMas.Checked(MsOptGlobalParams.bXMas);

  mo_WholeMapSearchMethod.SetIndex(mo_WholeMapSearchMethod.FindIndex(MsOptGlobalParams.WholeMapSearchMethod));

  ch_UserSettingsToEmitters.Checked(MsOptGlobalParams.UserSettingsToEmitters);
  nu_ZedSearchRadius.SetValue(MsOptGlobalParams.ZedSearchRadius);
  lb_Actions.AddText("Global parameters loaded from config");
}

//======================================Monster Optimizer and Firebug disabler
simulated function ToStructureVariables()
{
  Mopt.CurrentOptParams.ZedCullDistance = fl_CullDistance_Zeds.GetValue();
  Mopt.CurrentOptParams.Timer = fl_Timer_for_Opt.GetValue();
  Mopt.CurrentOptParams.Ticks = nu_NewTicks.GetValue(); 
  Mopt.CurrentOptParams.UseUnlit = ch_Unlit.IsChecked();
  Mopt.CurrentOptParams.bSeasonedOff = ch_SeasonedOff.IsChecked();
  Mopt.CurrentOptParams.nozed_NetSpeed = nu_default_NetSpeed.GetValue();
  Mopt.CurrentOptParams.new_NetSpeed = nu_new_NetSpeed.GetValue();
  Mopt.CurrentOptParams.AmbientGlow = nu_AmbientGlow.GetValue();
  Mopt.CurrentOptParams.bLagOff = ch_LagOff.IsChecked();
  Mopt.CurrentOptParams.SoundRadius = nu_SoundRadius.GetValue();
  Mopt.CurrentOptParams.AmbientGlow = nu_AmbientGlow.GetValue();
  Mopt.CurrentOptParams.GoreLevel = mo_GoreLevel.GetText();
  Mopt.CurrentOptParams.bNoRagdolls = ch_NoRagdolls.IsChecked();

  Mopt.CurrentOptParams.bAdvancedGiblets = ch_GibletsControl.IsChecked(); 
  Mopt.CurrentOptParams.bAdvancedGibs = ch_GibControl.IsChecked();      

  Mopt.CurrentOptParams.bUnlitGibs = ch_GibUnlit.IsChecked();
  Mopt.CurrentOptParams.bUnlitGiblets = ch_GibletUnlit.IsChecked();
  Mopt.CurrentOptParams.bHideGibs = ch_GibHidden.IsChecked();
  Mopt.CurrentOptParams.bHideGiblets= ch_GibletHidden.IsChecked();
  Mopt.CurrentOptParams.GibsLifespan =  fl_GibLifespan.GetValue();
  Mopt.CurrentOptParams.GibletsLifespan = fl_GibletLifespan.GetValue();
  Mopt.CurrentOptParams.RagdollLifeSpan = fl_newRagdollLifeTime.GetValue();

  Mopt.CurrentOptParams.GibUseDeferRendering = ch_GibUseDeferRendering.IsChecked();
  Mopt.CurrentOptParams.GibMaxLights = nu_GibMaxLights.GetValue();
  Mopt.CurrentOptParams.GibUseCollisionStaticMesh = ch_GibUseCollisionStaticMesh.IsChecked();
  Mopt.CurrentOptParams.GibAcceptProjectors = ch_GibAcceptProjectors.IsChecked();
  Mopt.CurrentOptParams.GibStaticLighting = ch_GibStaticLighting.IsChecked();

  Mopt.CurrentOptParams.GibletsUseDeferRendering= ch_GibletsUseDeferRendering.IsChecked();
  Mopt.CurrentOptParams.GibletsMaxLights = nu_GibletsMaxLights.GetValue();
  Mopt.CurrentOptParams.GibletsUseCollisionStaticMesh = ch_GibletsUseCollisionStaticMesh.IsChecked();
  Mopt.CurrentOptParams.GibletsAcceptProjectors = ch_GibletsAcceptProjectors.IsChecked();
  Mopt.CurrentOptParams.GibletsStaticLighting = ch_GibletsStaticLighting.IsChecked();

  // I tired of this compiler related bullshit
  switch (mo_SoundOcclusion.GetIndex())
  {
    case 0:
      Mopt.CurrentOptParams.SoundOcclusion = OCCLUSION_Default;
      break;
    case 1:
      Mopt.CurrentOptParams.SoundOcclusion = OCCLUSION_None;
      break;
    case 2:
      Mopt.CurrentOptParams.SoundOcclusion = OCCLUSION_BSP;
      break;
    case 3:
      Mopt.CurrentOptParams.SoundOcclusion = OCCLUSION_StaticMeshes;
      break;
  }

  Mopt.LC.UseFireTweaks = ch_UseFireTweaks.IsChecked();
  Mopt.LC.LightRadius = fl_LightRadius.GetValue();
 
  Mopt.LC.LightBrightness = nu_LightBrightness.GetValue();
  Mopt.LC.LightHue = nu_LightHue.GetValue();
  Mopt.LC.LightSaturation = nu_LightSaturation.GetValue();
  Mopt.LC.bDynamicLight = ch_bDynamicLight.IsChecked();
  Mopt.LC.bSpecialLit = ch_bSpecialLit.IsChecked();
  Mopt.LC.UseAdditionalTweaks = ch_UseAdditionalTweaks.IsChecked();
  Mopt.LC.FixDoshLighting = ch_FixDoshLighting.IsChecked();

  switch (mo_LightType.GetIndex())
  {
        case 0:
        Mopt.LC.LightType = LT_None;
        break;
        case 1:
        Mopt.LC.LightType = LT_Steady;
        break;
        case 2:
        Mopt.LC.LightType = LT_Pulse;
        break;
        case 3:
        Mopt.LC.LightType = LT_Blink;
        break;
        case 4:
        Mopt.LC.LightType = LT_Flicker;
        break;
        case 5:
        Mopt.LC.LightType = LT_Strobe;
        break;
        case 6:
        Mopt.LC.LightType = LT_BackdropLight;
        break;
        case 7:
        Mopt.LC.LightType = LT_SubtlePulse;
        break;
        case 8:
        Mopt.LC.LightType = LT_TexturePaletteOnce;
        break;
        case 9:
        Mopt.LC.LightType = LT_TexturePaletteLoop;
        break;
        case 10:
        Mopt.LC.LightType = LT_FadeOut;
        break;
  };

  Mopt.CurrentOptParams.ConsNetSpeed = ch_ConsNetSpeed.IsChecked();
  Mopt.CurrentOptParams.bMonsterSpotted = ch_bMonsterSpotted.IsChecked();
  Mopt.CurrentOptParams.bStandard = ch_bStandard.IsChecked();
  Mopt.CurrentOptParams.bCircus = ch_bCircus.IsChecked();
  Mopt.CurrentOptParams.bHillbilly = ch_bHillbilly.IsChecked();
  Mopt.CurrentOptParams.bXMas = ch_bXMas.IsChecked();

  Mopt.CurrentOptParams.WholeMapSearchMethod = mo_WholeMapSearchMethod.GetText();
  Mopt.CurrentOptParams.UserSettingsToEmitters = ch_UserSettingsToEmitters.IsChecked();

  Mopt.CurrentOptParams.ZedSearchRadius = nu_ZedSearchRadius.GetValue();
}

simulated function OptimizerLoadAssets(byte Asset)
{
  if (MOpt == none)
  {
    MOpT = PC.Spawn(class'a_MonsterOptimizer', PC);
    MOpT.LoadZedsAssets(Asset);
    MOpt.Destroy();
    MOpt = none;
  }
  else
    lb_Actions.AddText("You cannot load up zeds assets when optimizer is working!1111");
}

simulated function startOptimizer()
{
  if (fl_CullDistance_Zeds.GetValue() == 0)
  {
    lb_Actions.AddText("PLz input a culldistance");
    return;
  }

  if (fl_Timer_for_Opt.GetValue() == 0)
  {
    lb_Actions.AddText("PLz input a timer");
    return;
  }

  if (nu_SoundRadius.GetValue() == 0)
  {
    lb_Actions.AddText("SoundRadius is 0. Ambient sounds for zeds disabled...");
  }

  stopOptimizer();        //Destroy spawned actor
  MOpT = PC.Spawn(class'a_MonsterOptimizer', PC);

  lb_Actions.AddText("Starting optimizer....");
  if (MOpt != none)
  {
    ToStructureVariables();      //Get interface shit together
    MOpt.startOptimize();
  }
}

simulated function stopOptimizer()
{
  lb_Actions.AddText("Stopping optimizer....");
  if (MOpt == none)
    return;
  MOpt.stopOptimize();
  MOpt.Destroy();
  MOpt = none;
}

simulated function InternalOnChange(GUIComponent Sender){}

simulated function DestroyRagdolls()
{
  local KFMonster KFM;
  local KFPawn KFP;

  // Destroy monster bodies
  foreach AllObjects(class'KFMonster', KFM)
  {
    if (KFM.Physics == PHYS_KarmaRagdoll)
    {
      KFM.Destroy();
    }
  }

  // Destroy player bodies
  foreach AllObjects(class'KFPawn', KFP)
  {
    // After taking damage player body don't go to PHYS_Karmaragdoll instead it goes to PHYS_None cuz of retarded TWI code.
    // TWI are you lame or you don't know how ragdolls work?
    if (KFP.Health <= 0 )
    {
      KFP.Destroy();
    }
  }
}

defaultproperties
{
     Begin Object Class=GUIButton Name=CullDistance_Zeds_Button
         Caption="Start optimizer and apply ALL tweaks !"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=CullDistance_Zeds_Button.InternalOnKeyEvent
     End Object
     b_CullDistance_Zeds=GUIButton'HideMut.menu_c_Optimizer.CullDistance_Zeds_Button'

     Begin Object Class=GUIButton Name=StopOptimizer_Zeds_Button
         Caption="Stop Optimizer!"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=StopOptimizer_Zeds_Button.InternalOnKeyEvent
     End Object
     b_StopOptimizer_Zeds=GUIButton'HideMut.menu_c_Optimizer.StopOptimizer_Zeds_Button'

     Begin Object Class=GUIButton Name=SaveConfig_Button
         Caption="Save global config paratemers"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=SaveConfig_Button.InternalOnKeyEvent
     End Object
     b_GlobalSaveConfig=GUIButton'HideMut.menu_c_Optimizer.SaveConfig_Button'

     Begin Object Class=GUIButton Name=LoadConfig_Button
         Caption="Load global config paratemers"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadConfig_Button.InternalOnKeyEvent
     End Object
     b_GlobalLoadConfig=GUIButton'HideMut.menu_c_Optimizer.LoadConfig_Button'

     Begin Object Class=GUIButton Name=LoadVanillaMonsters
         Caption="Load up standard zed assets!"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadVanillaMonsters.InternalOnKeyEvent
     End Object
     b_LoadVanillaMonsters=GUIButton'HideMut.menu_c_Optimizer.LoadVanillaMonsters'

     Begin Object Class=GUIButton Name=LoadHillbillyMonsters
         Caption="Load up Hillbilly zed assets!"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadHillbillyMonsters.InternalOnKeyEvent
     End Object
     b_LoadHillbillyMonsters=GUIButton'HideMut.menu_c_Optimizer.LoadHillbillyMonsters'

     Begin Object Class=GUIButton Name=LoadXMASMonsters
         Caption="Load up Xmas zed assets!"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadXMASMonsters.InternalOnKeyEvent
     End Object
     b_LoadXMASMonsters=GUIButton'HideMut.menu_c_Optimizer.LoadXMASMonsters'

     Begin Object Class=GUIButton Name=LoadCircusMonsters
         Caption="Load up Circus zed assets!"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadCircusMonsters.InternalOnKeyEvent
     End Object
     b_LoadCircusMonsters=GUIButton'HideMut.menu_c_Optimizer.LoadCircusMonsters'

     Begin Object Class=GUIButton Name=LoadCustomMonsters
         Caption="Load up custom zed assets!"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadCustomMonsters.InternalOnKeyEvent
     End Object
     b_LoadCustomMonsters=GUIButton'HideMut.menu_c_Optimizer.LoadCustomMonsters'

     Begin Object Class=GUIButton Name=LoadDefaultKarmaParams
         Caption="Load default Karma Params"
         Hint="Load default karma parameters for LevelInfo"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadDefaultKarmaParams.InternalOnKeyEvent
     End Object
     b_LoadDefaultKarmaParams=GUIButton'HideMut.menu_c_Optimizer.LoadDefaultKarmaParams'

     Begin Object Class=GUIButton Name=LoadConfigKarmaParams
         Caption="Load config Karma Params"
         Hint="Load config karma parameters for LevelInfo"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=LoadConfigKarmaParams.InternalOnKeyEvent
     End Object
     b_LoadConfigKarmaParams=GUIButton'HideMut.menu_c_Optimizer.LoadConfigKarmaParams'

     Begin Object Class=GUIButton Name=SaveConfigKarmaParams
         Caption="Save config Karma Params"
         Hint="Save config karma parameters for LevelInfo"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=SaveConfigKarmaParams.InternalOnKeyEvent
     End Object
     b_SaveConfigKarmaParams=GUIButton'HideMut.menu_c_Optimizer.SaveConfigKarmaParams'

     Begin Object Class=GUIButton Name=ApplyKarmaParams
         Caption="Apply Karma Params to Level Info"
         Hint="Apply Karma Params to Level Info default properties"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=ApplyKarmaParams.InternalOnKeyEvent
     End Object
     b_ApplyKarmaParams=GUIButton'HideMut.menu_c_Optimizer.ApplyKarmaParams'

     Begin Object Class=GUIButton Name=RemoveBodies
         Caption="Removes all monster and player bodies"
         Hint="Removes all monster and player bodies"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=RemoveBodies.InternalOnKeyEvent
     End Object
     b_RemoveBodies=GUIButton'HideMut.menu_c_Optimizer.RemoveBodies'

     Begin Object Class=GUIButton Name=clearLog
         Caption="Clear log spam"
         Hint="Clear log"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=clearLog.InternalOnKeyEvent
     End Object
     b_ClearLog=GUIButton'HideMut.menu_c_Optimizer.clearLog'

     Begin Object Class=GUIButton Name=ToggleZedSpy
         Caption="Toggle Zed spy onoff"
         Hint="Toggle Zed spy onoff"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=ToggleZedSpy.InternalOnKeyEvent
     End Object
     b_ToggleZedSpy=GUIButton'HideMut.menu_c_Optimizer.ToggleZedSpy'

     Begin Object Class=GUIButton Name=Settings
         Caption="Zed spy settings"
         Hint="Zed spy settings"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=Settings.InternalOnKeyEvent
     End Object
     b_Settings=GUIButton'HideMut.menu_c_Optimizer.Settings'

     Begin Object Class=GUIButton Name=ReplacerPrefs
         Caption="Repl"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=ReplacerPrefs.InternalOnKeyEvent
     End Object
     b_ReplacerPrefs=GUIButton'HideMut.menu_c_Optimizer.ReplacerPrefs'

     Begin Object Class=GUIButton Name=NetPrefs
         Caption="Net"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=NetPrefs.InternalOnKeyEvent
     End Object
     b_NetPrefs=GUIButton'HideMut.menu_c_Optimizer.NetPrefs'

     Begin Object Class=GUIButton Name=ZedsPrefs
         Caption="Zed"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=ZedsPrefs.InternalOnKeyEvent
     End Object
     b_ZedsPrefs=GUIButton'HideMut.menu_c_Optimizer.ZedsPrefs'

     Begin Object Class=GUIButton Name=OptimizerPrefs
         Caption="Opt"
         OnClick=menu_c_Optimizer.ButtonClicked
         OnKeyEvent=OptimizerPrefs.InternalOnKeyEvent
     End Object
     b_OptimizerPrefs=GUIButton'HideMut.menu_c_Optimizer.OptimizerPrefs'

     Begin Object Class=moCheckBox Name=moUnlit
         Caption="Toggle lights on zeds"
         OnCreateComponent=moUnlit.InternalOnCreateComponent
         Hint="If checked all zeds will appear in full brightness and will NOT be affected by light. Use as a last resort if you can't get a good fps..."
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_Unlit=moCheckBox'HideMut.menu_c_Optimizer.moUnlit'

     Begin Object Class=moCheckBox Name=moSeasonedOff
         Caption="Replace seasoned zeds"
         OnCreateComponent=moSeasonedOff.InternalOnCreateComponent
         Hint="Replaces all seasoned zeds with default ones. ATTENTION: sound and other dynamic resources are replaced but that replacement maybe overrided..."
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_SeasonedOff=moCheckBox'HideMut.menu_c_Optimizer.moSeasonedOff'

     Begin Object Class=moCheckBox Name=moLagOff
         Caption="Use Alternative optimizer method"
         OnCreateComponent=moSeasonedOff.InternalOnCreateComponent
         Hint="Use non-laggy optimizer(default class pollution). WORK ON CUSTOM ZEDS!. You need to know class of custom zed and put that class in config(CustomZeds)"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_LagOff=moCheckBox'HideMut.menu_c_Optimizer.moLagOff'

     Begin Object Class=moCheckBox Name=monewbKStaticFriction
         Caption="Better friciton model for ragdolls"
         OnCreateComponent=monewbKStaticFriction.InternalOnCreateComponent
         Hint="Better rag-doll/ground friction model, but more CPU."
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_newbKStaticFriction=moCheckBox'HideMut.menu_c_Optimizer.monewbKStaticFriction'

     Begin Object Class=moCheckBox Name=moNoRagdolls
         Caption="Disables ragdolls for entire level"
         OnCreateComponent=moNoRagdolls.InternalOnCreateComponent
         Hint="Disables ragdolls for entire level. ATTENTION: Caches and destroys ALL ragdolls on level."
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_NoRagdolls=moCheckBox'HideMut.menu_c_Optimizer.moNoRagdolls'

     Begin Object Class=moCheckBox Name=moGibControl
         Caption="Enable advanced gib control"
         OnCreateComponent=moGibControl.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibControl=moCheckBox'HideMut.menu_c_Optimizer.moGibControl'

     Begin Object Class=moCheckBox Name=moGibUnlit
         Caption="Disable lighting for gibs"
         OnCreateComponent=moGibUnlit.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibUnlit=moCheckBox'HideMut.menu_c_Optimizer.moGibUnlit'

     Begin Object Class=moCheckBox Name=moGibHidden
         Caption="Hide gibs"
         OnCreateComponent=moGibHidden.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibHidden=moCheckBox'HideMut.menu_c_Optimizer.moGibHidden'

     Begin Object Class=moCheckBox Name=moGibletsControl
         Caption="Enable advanced giblets control"
         OnCreateComponent=moGibletsControl.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibletsControl=moCheckBox'HideMut.menu_c_Optimizer.moGibletsControl'

     Begin Object Class=moCheckBox Name=moGibletUnlit
         Caption="Disable lighting for gibslets"
         OnCreateComponent=moGibletUnlit.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibletUnlit=moCheckBox'HideMut.menu_c_Optimizer.moGibletUnlit'

     Begin Object Class=moCheckBox Name=moGibletHidden
         Caption="Hide giblets"
         OnCreateComponent=moGibletHidden.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibletHidden=moCheckBox'HideMut.menu_c_Optimizer.moGibletHidden'

     Begin Object Class=moCheckBox Name=moGibUseDeferRendering
         Caption="Use defer rendering on gibs"
         OnCreateComponent=moGibUseDeferRendering.InternalOnCreateComponent
         Hint="Use defer rendering on giblets style is (MSTY_Additive).Should halp with mass rendering giblets"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibUseDeferRendering=moCheckBox'HideMut.menu_c_Optimizer.moGibUseDeferRendering'

     Begin Object Class=moCheckBox Name=moGibUseCollisionStaticMesh
         Caption="Use static mesh collision"
         OnCreateComponent=moGibUseCollisionStaticMesh.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibUseCollisionStaticMesh=moCheckBox'HideMut.menu_c_Optimizer.moGibUseCollisionStaticMesh'

     Begin Object Class=moCheckBox Name=moGibAcceptProjectors
         Caption="Accept projectors on gibs"
         OnCreateComponent=moGibAcceptProjectors.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibAcceptProjectors=moCheckBox'HideMut.menu_c_Optimizer.moGibAcceptProjectors'

     Begin Object Class=moCheckBox Name=moGibStaticLighting
         Caption="Use raytraced lighting on gibs"
         OnCreateComponent=moGibStaticLighting.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibStaticLighting=moCheckBox'HideMut.menu_c_Optimizer.moGibStaticLighting'

     Begin Object Class=moCheckBox Name=moGibletsUseDeferRendering
         Caption="Use defer rendering on giblets"
         OnCreateComponent=moGibletsUseDeferRendering.InternalOnCreateComponent
         Hint="Use defer rendering on giblets style is (MSTY_Additive).Should halp with mass rendering giblets"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibletsUseDeferRendering=moCheckBox'HideMut.menu_c_Optimizer.moGibletsUseDeferRendering'

     Begin Object Class=moCheckBox Name=moGibletUCStaticMesh
         Caption="Use static mesh collision"
         OnCreateComponent=moGibletUCStaticMesh.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibletsUseCollisionStaticMesh=moCheckBox'HideMut.menu_c_Optimizer.moGibletUCStaticMesh'

     Begin Object Class=moCheckBox Name=moGibletProjectors
         Caption="Accept projectors on Giblets"
         OnCreateComponent=moGibletProjectors.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibletsAcceptProjectors=moCheckBox'HideMut.menu_c_Optimizer.moGibletProjectors'

     Begin Object Class=moCheckBox Name=moGibletLighting
         Caption="Use raytraced lighting on Giblets"
         OnCreateComponent=moGibletLighting.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_GibletsStaticLighting=moCheckBox'HideMut.menu_c_Optimizer.moGibletLighting'

     Begin Object Class=moCheckBox Name=moUseFireTweaks
         Caption="Use Fire Tweaks"
         OnCreateComponent=moUseFireTweaks.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_UseFireTweaks=moCheckBox'HideMut.menu_c_Optimizer.moUseFireTweaks'

     Begin Object Class=moCheckBox Name=mobDynamicLight
         Caption="Is Dynamic Light"
         OnCreateComponent=mobDynamicLight.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_bDynamicLight=moCheckBox'HideMut.menu_c_Optimizer.mobDynamicLight'

     Begin Object Class=moCheckBox Name=mobSpecialLit
         Caption="Special Lit"
         OnCreateComponent=mobSpecialLit.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_bSpecialLit=moCheckBox'HideMut.menu_c_Optimizer.mobSpecialLit'

     Begin Object Class=moCheckBox Name=moUseAdditionalTweaks
         Caption="Use additional tweaks"
         OnCreateComponent=moUseAdditionalTweaks.InternalOnCreateComponent
         Hint="Flashlight and some useless weapon lighting(Fixes pulse to Steady)"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_UseAdditionalTweaks=moCheckBox'HideMut.menu_c_Optimizer.moUseAdditionalTweaks'

     Begin Object Class=moCheckBox Name=moDoshLight
         Caption="Fix dosh light"
         OnCreateComponent=moDoshLight.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_FixDoshLighting=moCheckBox'HideMut.menu_c_Optimizer.moDoshLight'

     Begin Object Class=moCheckBox Name=moConsNetSpeed
         Caption="Use constant netspeed"
         OnCreateComponent=moConsNetSpeed.InternalOnCreateComponent
         Hint="NetSpeed will never change (NewNetspeed will be forced as default netspeed)"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_ConsNetSpeed=moCheckBox'HideMut.menu_c_Optimizer.moConsNetSpeed'

     Begin Object Class=moCheckBox Name=mobMonsterSpotted
         Caption="Disable HardPat bullshit"
         OnCreateComponent=mobMonsterSpotted.InternalOnCreateComponent
         Hint="Removes bHidden on HardPat... I don't care"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_bMonsterSpotted=moCheckBox'HideMut.menu_c_Optimizer.mobMonsterSpotted'

     Begin Object Class=moCheckBox Name=mobStandard
         Caption="Standard zeds"
         OnCreateComponent=mobStandard.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_bStandard=moCheckBox'HideMut.menu_c_Optimizer.mobStandard'

     Begin Object Class=moCheckBox Name=mobCircus
         Caption="Circus zeds"
         OnCreateComponent=mobCircus.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_bCircus=moCheckBox'HideMut.menu_c_Optimizer.mobCircus'

     Begin Object Class=moCheckBox Name=mobHillbilly
         Caption="Hillbilly zeds"
         OnCreateComponent=mobHillbilly.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_bHillbilly=moCheckBox'HideMut.menu_c_Optimizer.mobHillbilly'

     Begin Object Class=moCheckBox Name=mobXMas
         Caption="XMas zeds"
         OnCreateComponent=mobXMas.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_bXMas=moCheckBox'HideMut.menu_c_Optimizer.mobXMas'

     Begin Object Class=moCheckBox Name=moUserSettingsToEmitters
         CaptionWidth=0.000000
         Caption="User settings"
         OnCreateComponent=moUserSettingsToEmitters.InternalOnCreateComponent
         Hint="Applies only to bloat bile and other dynamically load emitters"
         WinWidth=0.000000
         bVisible=False
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     ch_UserSettingsToEmitters=moCheckBox'HideMut.menu_c_Optimizer.moUserSettingsToEmitters'

     Begin Object Class=moComboBox Name=coSoundOcclusion
         bReadOnly=True
         CaptionWidth=0.000000
         Caption="Sound Occlusion"
         OnCreateComponent=coSoundOcclusion.InternalOnCreateComponent
         Hint="Changes zed's ambient sound(only) occlusion. Will sound be affected by geometry and etc."
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     mo_SoundOcclusion=moComboBox'HideMut.menu_c_Optimizer.coSoundOcclusion'

     Begin Object Class=moComboBox Name=coGoreLevel
         bReadOnly=True
         CaptionWidth=0.000000
         Caption="GoreLevel"
         OnCreateComponent=coGoreLevel.InternalOnCreateComponent
         Hint="Gore level preset. Changes how much gore is detailed."
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     mo_GoreLevel=moComboBox'HideMut.menu_c_Optimizer.coGoreLevel'

     Begin Object Class=moComboBox Name=coMapSettings
         bReadOnly=True
         Caption="Map presets"
         OnCreateComponent=coMapSettings.InternalOnCreateComponent
         Hint="Config map presets(hidemut.ini -> MSParams)"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     mo_MapSettings=moComboBox'HideMut.menu_c_Optimizer.coMapSettings'

     Begin Object Class=moComboBox Name=coLightType
         bReadOnly=True
         Caption="Light Type"
         OnCreateComponent=coLightType.InternalOnCreateComponent
         Hint="Light Type of fire Emitters."
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     mo_LightType=moComboBox'HideMut.menu_c_Optimizer.coLightType'

     Begin Object Class=moComboBox Name=coWholeMapSearchMethod
         bReadOnly=True
         CaptionWidth=0.000000
         Caption="Search method"
         OnCreateComponent=coWholeMapSearchMethod.InternalOnCreateComponent
         Hint="Map search method for optimizer. if you have potato choose DynamicActors"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     mo_WholeMapSearchMethod=moComboBox'HideMut.menu_c_Optimizer.coWholeMapSearchMethod'

     Begin Object Class=moNumericEdit Name=NewTicks
         MinValue=0
         MaxValue=999
         Caption="Ticks"
         OnCreateComponent=NewTicks.InternalOnCreateComponent
         Hint="Each tick optimizer will detect headless zeds. Disabled when LowGore is false. 0 to disable"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_NewTicks=moNumericEdit'HideMut.menu_c_Optimizer.NewTicks'

     Begin Object Class=moNumericEdit Name=moSoundRadius
         MinValue=1
         MaxValue=50000
         Caption="SoundRadius"
         OnCreateComponent=moSoundRadius.InternalOnCreateComponent
         Hint="Sound radius for zed's ambient sounds"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_SoundRadius=moNumericEdit'HideMut.menu_c_Optimizer.moSoundRadius'

     Begin Object Class=moNumericEdit Name=modefault_NetSpeed
         MinValue=5000
         MaxValue=20000
         Caption="Def_NetSpeed"
         OnCreateComponent=modefault_NetSpeed.InternalOnCreateComponent
         Hint="default Netspeed. Without zeds netspeed will return to this value"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_default_NetSpeed=moNumericEdit'HideMut.menu_c_Optimizer.modefault_NetSpeed'

     Begin Object Class=moNumericEdit Name=monew_NetSpeed
         MinValue=5000
         MaxValue=20000
         Caption="New_Netspeed"
         OnCreateComponent=monew_NetSpeed.InternalOnCreateComponent
         Hint="new Netspeed will change when zeds are near"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_new_NetSpeed=moNumericEdit'HideMut.menu_c_Optimizer.monew_NetSpeed'

     Begin Object Class=moNumericEdit Name=moAmbientGlow
         MinValue=0
         MaxValue=255
         Caption="Glow"
         OnCreateComponent=moAmbientGlow.InternalOnCreateComponent
         Hint="Regulates how bright zed will be and how bright inner glow will be on that zed"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_AmbientGlow=moNumericEdit'HideMut.menu_c_Optimizer.moAmbientGlow'

     Begin Object Class=moNumericEdit Name=monewMaxRagdolls
         MinValue=1
         MaxValue=2000
         Caption="Max simultaneous ragdolls"
         OnCreateComponent=monewMaxRagdolls.InternalOnCreateComponent
         Hint="Max simultaneous ragdolls. Unfotunately can't be set to 0 cuz of engine bugz. Use NoRagdolls option"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_newMaxRagdolls=moNumericEdit'HideMut.menu_c_Optimizer.monewMaxRagdolls'

     Begin Object Class=moNumericEdit Name=moZedSearchRadius
         MinValue=1
         MaxValue=25000
         Caption="Search radius"
         OnCreateComponent=moZedSearchRadius.InternalOnCreateComponent
         Hint="Search radius used for radius zeds search"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_ZedSearchRadius=moNumericEdit'HideMut.menu_c_Optimizer.moZedSearchRadius'

     Begin Object Class=moNumericEdit Name=moLightBrightness
         MinValue=-1
         MaxValue=255
         Caption="Light Brightness"
         OnCreateComponent=moLightBrightness.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_LightBrightness=moNumericEdit'HideMut.menu_c_Optimizer.moLightBrightness'

     Begin Object Class=moNumericEdit Name=moLightSaturation
         MinValue=-1
         MaxValue=255
         Caption="Light Saturation"
         OnCreateComponent=moLightSaturation.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_LightSaturation=moNumericEdit'HideMut.menu_c_Optimizer.moLightSaturation'

     Begin Object Class=moNumericEdit Name=moLightHue
         MinValue=-1
         MaxValue=255
         Caption="Light Hue"
         OnCreateComponent=moLightHue.InternalOnCreateComponent
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_LightHue=moNumericEdit'HideMut.menu_c_Optimizer.moLightHue'

     Begin Object Class=moNumericEdit Name=moGibletsMaxLights
         MinValue=0
         MaxValue=20
         Caption="Max lights on giblet"
         OnCreateComponent=moGibletsMaxLights.InternalOnCreateComponent
         Hint="Max hardware lights on primitive(vertex lighting option). Moar == less perfomance"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_GibletsMaxLights=moNumericEdit'HideMut.menu_c_Optimizer.moGibletsMaxLights'

     Begin Object Class=moNumericEdit Name=moGibMaxLights
         MinValue=0
         MaxValue=20
         Caption="Max lights on gib"
         OnCreateComponent=moGibMaxLights.InternalOnCreateComponent
         Hint="Max hardware lights on primitive(vertex lighting option). Moar == less perfomance"
         OnChange=menu_c_Optimizer.InternalOnChange
     End Object
     nu_GibMaxLights=moNumericEdit'HideMut.menu_c_Optimizer.moGibMaxLights'

     Begin Object Class=moFloatEdit Name=CullDistance_Zeds
         MinValue=0.000000
         MaxValue=10000.000000
         Caption="CullDistance"
         OnCreateComponent=CullDistance_Zeds.InternalOnCreateComponent
         Hint="Adjust the cullDistances for zeds."
     End Object
     fl_CullDistance_Zeds=moFloatEdit'HideMut.menu_c_Optimizer.CullDistance_Zeds'

     Begin Object Class=moFloatEdit Name=Timer_for_Optimizer
         MinValue=0.100000
         MaxValue=35.000000
         Step=0.500000
         Caption="Timer"
         OnCreateComponent=Timer_for_Optimizer.InternalOnCreateComponent
         Hint="Adjust the timer for Optimizer(seconds). Timer is essential optimizer operation for caching zeds and ragdoll controlling."
     End Object
     fl_Timer_for_Opt=moFloatEdit'HideMut.menu_c_Optimizer.Timer_for_Optimizer'

     Begin Object Class=moFloatEdit Name=monewKarmaTimeScale
         MinValue=0.000000
         MaxValue=1000.000000
         Caption="Karma physics timestep scaling."
         OnCreateComponent=monewKarmaTimeScale.InternalOnCreateComponent
         Hint="Adjust the Karma physics timestep scaling: how fast ragdolls physics timer will tick"
     End Object
     fl_newKarmaTimeScale=moFloatEdit'HideMut.menu_c_Optimizer.monewKarmaTimeScale'

     Begin Object Class=moFloatEdit Name=monewRagdollTimeScale
         MinValue=0.000000
         MaxValue=1000.000000
         Caption="Karma physics timestep scaling."
         OnCreateComponent=monewRagdollTimeScale.InternalOnCreateComponent
         Hint="Ragdoll physics timestep scaling. This is applied on top of KarmaTimeScale."
     End Object
     fl_newRagdollTimeScale=moFloatEdit'HideMut.menu_c_Optimizer.monewRagdollTimeScale'

     Begin Object Class=moFloatEdit Name=monewKarmaGravScale
         MinValue=0.000000
         MaxValue=1000.000000
         Caption="Use lower friction model"
         OnCreateComponent=monewKarmaGravScale.InternalOnCreateComponent
         Hint="Allows you to make ragdolls use lower friction than normal."
     End Object
     fl_newKarmaGravScale=moFloatEdit'HideMut.menu_c_Optimizer.monewKarmaGravScale'

     Begin Object Class=moFloatEdit Name=monewRagdollLifeTime
         MinValue=0.000000
         Caption="Ragdoll life time"
         OnCreateComponent=monewRagdollLifeTime.InternalOnCreateComponent
         Hint="Ragdoll life time. Obsolete if Noragdolls option is on"
     End Object
     fl_newRagdollLifeTime=moFloatEdit'HideMut.menu_c_Optimizer.monewRagdollLifeTime'

     Begin Object Class=moFloatEdit Name=flGibletLifespan
         MinValue=0.000000
         Caption="Giblet Lifespan"
         OnCreateComponent=flGibletLifespan.InternalOnCreateComponent
     End Object
     fl_GibletLifespan=moFloatEdit'HideMut.menu_c_Optimizer.flGibletLifespan'

     Begin Object Class=moFloatEdit Name=flGibLifespan
         MinValue=0.000000
         Caption="Gib Lifespan"
         OnCreateComponent=flGibLifespan.InternalOnCreateComponent
     End Object
     fl_GibLifespan=moFloatEdit'HideMut.menu_c_Optimizer.flGibLifespan'

     Begin Object Class=moFloatEdit Name=flLightRadius
         MinValue=-1.000000
         Caption="Light Radius"
         OnCreateComponent=flGibletLifespan.InternalOnCreateComponent
     End Object
     fl_LightRadius=moFloatEdit'HideMut.menu_c_Optimizer.flLightRadius'

     Begin Object Class=GUISectionBackground Name=BGOptimizer
         bFillClient=True
         Caption="Optimizer Main features"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         MaxPerColumn=12
         WinTop=0.349012
         WinLeft=0.068462
         WinWidth=0.386539
         WinHeight=0.505876
         OnPreDraw=BGOptimizer.InternalPreDraw
     End Object
     sb_Optimizer=GUISectionBackground'HideMut.menu_c_Optimizer.BGOptimizer'

     Begin Object Class=GUISectionBackground Name=BGAssetLoader
         bFillClient=True
         Caption="Asset Loader"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         WinTop=0.010000
         WinLeft=0.755000
         WinWidth=0.250000
         WinHeight=0.250000
         OnPreDraw=BGAssetLoader.InternalPreDraw
     End Object
     sb_AssetLoader=GUISectionBackground'HideMut.menu_c_Optimizer.BGAssetLoader'

     Begin Object Class=GUISectionBackground Name=BGKarmaParams
         bFillClient=True
         Caption="Karma Parameters for whole level"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         WinTop=0.450000
         WinLeft=0.455000
         WinWidth=0.300000
         WinHeight=0.450000
         OnPreDraw=BGKarmaParams.InternalPreDraw
     End Object
     sb_KarmaParams=GUISectionBackground'HideMut.menu_c_Optimizer.BGKarmaParams'

     Begin Object Class=GUISectionBackground Name=BGLog
         bFillClient=True
         Caption="Logged Actions"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         WinTop=0.010000
         WinLeft=0.155000
         WinWidth=0.300000
         WinHeight=0.340000
         OnPreDraw=BGKarmaParams.InternalPreDraw
     End Object
     sb_Log=GUISectionBackground'HideMut.menu_c_Optimizer.BGLog'

     Begin Object Class=GUISectionBackground Name=BGOptStarted
         bFillClient=True
         Caption="Optimizer: status"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         WinTop=0.010000
         WinWidth=0.150000
         WinHeight=0.340000
         OnPreDraw=BGOptStarted.InternalPreDraw
     End Object
     sb_OptStarted=GUISectionBackground'HideMut.menu_c_Optimizer.BGOptStarted'

     Begin Object Class=GUISectionBackground Name=BGGoreLevel
         bFillClient=True
         Caption="Gore level: advanced gore and etc."
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         WinTop=0.262000
         WinLeft=0.755000
         WinWidth=0.250000
         WinHeight=0.735000
         OnPreDraw=BGGoreLevel.InternalPreDraw
     End Object
     sb_GoreLevel=GUISectionBackground'HideMut.menu_c_Optimizer.BGGoreLevel'

     Begin Object Class=GUISectionBackground Name=BGFireAndDosh
         bFillClient=True
         Caption="Fire, light and dosh fixes."
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         WinTop=0.010000
         WinLeft=0.455000
         WinWidth=0.300000
         WinHeight=0.440000
         OnPreDraw=BGFireAndDosh.InternalPreDraw
     End Object
     sb_FireAndDosh=GUISectionBackground'HideMut.menu_c_Optimizer.BGFireAndDosh'

     Begin Object Class=GUISectionBackground Name=BGZedPrefs
         bFillClient=True
         Caption="Optimizer Zeds Prefs"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         MaxPerColumn=12
         WinTop=0.349012
         WinLeft=0.068462
         WinWidth=0.386539
         WinHeight=0.505876
         OnPreDraw=BGZedPrefs.InternalPreDraw
     End Object
     sb_ZedsPrefs=GUISectionBackground'HideMut.menu_c_Optimizer.BGZedPrefs'

     Begin Object Class=GUISectionBackground Name=BGNetPrefs
         bFillClient=True
         Caption="Optimizer Net Prefs"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         MaxPerColumn=12
         WinTop=0.349012
         WinLeft=0.068462
         WinWidth=0.386539
         WinHeight=0.505876
         OnPreDraw=BGNetPrefs.InternalPreDraw
     End Object
     sb_NetPrefs=GUISectionBackground'HideMut.menu_c_Optimizer.BGNetPrefs'

     Begin Object Class=GUISectionBackground Name=BGReplacerPrefs
         bFillClient=True
         Caption="Optimizer Replacer Prefs"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         MaxPerColumn=12
         WinTop=0.349012
         WinLeft=0.068462
         WinWidth=0.386539
         WinHeight=0.505876
         OnPreDraw=BGReplacerPrefs.InternalPreDraw
     End Object
     sb_ReplacerPrefs=GUISectionBackground'HideMut.menu_c_Optimizer.BGReplacerPrefs'

     Begin Object Class=GUISectionBackground Name=BGOptimizerButtons
         bFillClient=True
         Caption="Optimizer Actions"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         NumColumns=2
         MaxPerColumn=2
         WinTop=0.852000
         WinWidth=0.455000
         WinHeight=0.148000
         OnPreDraw=BGOptimizerButtons.InternalPreDraw
     End Object
     sb_OptimizerButtons=GUISectionBackground'HideMut.menu_c_Optimizer.BGOptimizerButtons'

     Begin Object Class=GUISectionBackground Name=BGZedSpy
         bFillClient=True
         Caption="Debug framework for analyzing zeds"
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         NumColumns=2
         MaxPerColumn=1
         WinTop=0.895000
         WinLeft=0.455000
         WinWidth=0.300000
         WinHeight=0.100000
         OnPreDraw=BGZedSpy.InternalPreDraw
     End Object
     sb_ZedSpy=GUISectionBackground'HideMut.menu_c_Optimizer.BGZedSpy'

     Begin Object Class=GUISectionBackground Name=BGSwitchTo
         bFillClient=True
         ColPadding=0.020000
         LeftPadding=0.000000
         RightPadding=0.000000
         TopPadding=0.000000
         BottomPadding=0.000000
         MaxPerColumn=12
         WinTop=0.349012
         WinWidth=0.060000
         WinHeight=0.505876
         OnPreDraw=BGSwitchTo.InternalPreDraw
     End Object
     sb_SwitchTo=GUISectionBackground'HideMut.menu_c_Optimizer.BGSwitchTo'

     Begin Object Class=GUIScrollTextBox Name=lbActions
         bNoTeletype=True
         CharDelay=0.000000
         EOLDelay=0.000000
         RepeatDelay=0.000000
         OnCreateComponent=lbActions.InternalOnCreateComponent
         FontScale=FNS_Small
         bNeverFocus=True
     End Object
     lb_Actions=GUIScrollTextBox'HideMut.menu_c_Optimizer.lbActions'

}
