Skip to content

Commit

Permalink
removal
Browse files Browse the repository at this point in the history
  • Loading branch information
Killface1980 committed May 26, 2017
1 parent 41c4894 commit f767ef7
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 304 deletions.
4 changes: 3 additions & 1 deletion About/About.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>Outfitter 0.17.0</name>
<name>Outfitter 0.17.1</name>
<author>Killface</author>
<url></url>
<targetVersion>0.17.1533</targetVersion>
Expand All @@ -13,6 +13,8 @@

Original version of 'Outfitter™' by Fluffy. Original version of 'AutoEquip™' by soulkata.
This is a fusion of both mods.

REQUIRES HUGSLIB

Patch for the Infused mod:
http://steamcommunity.com/sharedfiles/filedetails/?id=818051679
Expand Down
Binary file modified Assemblies/Outfitter.dll
Binary file not shown.
Binary file modified Source/.vs/Outfitter/v14/.suo
Binary file not shown.
88 changes: 0 additions & 88 deletions Source/Outfitter/ApparelStatCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,94 +445,6 @@ public float ApparelScoreRaw_Temperature(Apparel apparel, Pawn pawn)

return temperatureScoreOffset / 10;
}
/*
public float ApparelScoreRaw_TemperatureOld(Apparel apparel, Pawn pawn)
{
// temperature
FloatRange targetTemperatures = pawn.GetWeaponStatCache().TargetTemperatures;
float minComfyTemperature = pawn.SafeTemperatureRange().min;
float maxComfyTemperature = pawn.SafeTemperatureRange().max;
//float minComfyTemperature = pawn.GetStatValue(StatDefOf.ComfyTemperatureMin);
//float maxComfyTemperature = pawn.GetStatValue(StatDefOf.ComfyTemperatureMax);
if (_pawn.story.traits.DegreeOfTrait(TraitDef.Named("TemperaturePreference")) != 0)
{
//calculating trait offset because there's no way to get comfytemperaturemin without clothes
List<Trait> traitList = (
from trait in _pawn.story.traits.allTraits
where trait.CurrentData.statOffsets != null && trait.CurrentData.statOffsets.Any(se => se.stat == StatDefOf.ComfyTemperatureMin || se.stat == StatDefOf.ComfyTemperatureMax)
select trait
).ToList();
foreach (Trait t in traitList)
{
minComfyTemperature += t.CurrentData.statOffsets.First(se => se.stat == StatDefOf.ComfyTemperatureMin).value;
maxComfyTemperature += t.CurrentData.statOffsets.First(se => se.stat == StatDefOf.ComfyTemperatureMax).value;
}
}
// offsets on apparel
float insulationCold = apparel.GetStatValue(StatDefOf.Insulation_Cold);
float insulationHeat = apparel.GetStatValue(StatDefOf.Insulation_Heat);
// offsets on apparel infusions
DoApparelScoreRaw_PawnStatsHandlers(_pawn, apparel, StatDefOf.ComfyTemperatureMin, ref insulationCold);
DoApparelScoreRaw_PawnStatsHandlers(_pawn, apparel, StatDefOf.ComfyTemperatureMax, ref insulationHeat);
// if this gear is currently worn, we need to make sure the contribution to the pawn's comfy temps is removed so the gear is properly scored
if (pawn.apparel.WornApparel.Contains(apparel))
{
minComfyTemperature -= insulationCold;
maxComfyTemperature -= insulationHeat;
}
// now for the interesting bit.
float temperatureScoreOffset = 0f;
float tempWeight = pawn.GetWeaponStatCache().TemperatureWeight;
// isolation_cold is given as negative numbers < 0 means we're underdressed
float neededInsulation_Cold = targetTemperatures.min - minComfyTemperature;
// isolation_warm is given as positive numbers.
float neededInsulation_Warmth = targetTemperatures.max - maxComfyTemperature;
// currently too cold
if (neededInsulation_Cold < 0)
{
temperatureScoreOffset += -insulationCold * tempWeight;
}
// currently warm enough
else
{
// this gear would make us too cold
if (insulationCold > neededInsulation_Cold)
{
temperatureScoreOffset += (neededInsulation_Cold - insulationCold) * tempWeight;
}
}
// currently too warm
if (neededInsulation_Warmth > 0)
{
temperatureScoreOffset += insulationHeat * tempWeight;
}
// currently cool enough
else
{
// this gear would make us too warm
if (insulationHeat < neededInsulation_Warmth)
{
temperatureScoreOffset += -(neededInsulation_Warmth - insulationHeat) * tempWeight;
}
}
return temperatureScoreOffset;
}
*/

public static float ApparelScoreRaw_ProtectionBaseStat(Apparel ap)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Outfitter/ApparelStatsHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Outfitter/WeaponStatsHelper.cs
// Outfitter/ApparelStatsHelper.cs
//
// Copyright Karel Kroeze, 2016.
//
Expand Down
5 changes: 3 additions & 2 deletions Source/Outfitter/Saveables/Saveable_Pawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public enum MainJob
public MainJob mainJob;

public List<Saveable_Pawn_StatDef> Stats = new List<Saveable_Pawn_StatDef>();
public List<Saveable_Pawn_StatDef> WeaponStats = new List<Saveable_Pawn_StatDef>();
public List<Saveable_Pawn_StatDef> ApparelStats = new List<Saveable_Pawn_StatDef>();
public bool SetRealComfyTemperatures;
public bool AutoEquipWeapon;

Expand All @@ -65,7 +65,8 @@ public void ExposeData()
Scribe_Values.Look(ref RealComfyTemperatures, "RealComfyTemperatures");
Scribe_Values.Look(ref Temperatureweight, "Temperatureweight");
Scribe_Collections.Look(ref Stats, "Stats", LookMode.Deep);
Scribe_Collections.Look(ref WeaponStats, "WeaponStats", LookMode.Deep);
// to do: rename with next big version
Scribe_Collections.Look(ref ApparelStats, "WeaponStats", LookMode.Deep);
Scribe_Values.Look(ref AddWorkStats, "AddWorkStats", true);
Scribe_Values.Look(ref AddIndividualStats, "AddIndividualStats", true);
Scribe_Values.Look(ref mainJob, "mainJob");
Expand Down
214 changes: 2 additions & 212 deletions Source/Outfitter/Window/ITab_Pawn_Outfitter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ protected override void FillTab()
// isApparel = true;
//
// if (!peacefulPawn)
// if (GUILayout.Button("WeaponStats".Translate()))
// if (GUILayout.Button("ApparelStats".Translate()))
// isApparel = false;

//update outfit
Expand Down Expand Up @@ -292,7 +292,7 @@ private void DrawApparelStats(SaveablePawn pawnSave, Vector2 cur, Rect canvas)
ApparelStatCache.DrawStatRow(ref cur, viewRect.width, stat, selPawnForGear, out stop_UI);
if (stop_UI)
{
// DrawWeaponStatRow can change the StatCache, invalidating the loop. So if it does that, stop looping - we'll redraw on the next tick.
// DrawWApparelStatRow can change the StatCache, invalidating the loop. So if it does that, stop looping - we'll redraw on the next tick.
break;
}
}
Expand Down Expand Up @@ -359,222 +359,12 @@ orderby ap.def.apparel.bodyPartGroups[0].listOrder descending

#endregion
}
//
// private void DrawWeaponStats(SaveablePawn pawnSave, Vector2 cur, Rect canvas)
// {
//
// // header
// Rect statsHeaderRect = new Rect(cur.x, cur.y, canvas.width, 30f);
// cur.y += 30f;
// Text.Anchor = TextAnchor.LowerLeft;
// Text.Font = GameFont.Small;
// Widgets.Label(statsHeaderRect, "PreferredWeaponStats".Translate());
// Text.Anchor = TextAnchor.UpperLeft;
//
// // add button
// Rect addStatRect = new Rect(statsHeaderRect.xMax - 16f, statsHeaderRect.yMin + 10f, 16f, 16f);
// if (Widgets.ButtonImage(addStatRect, OutfitterTextures.addButton))
// {
// List<FloatMenuOption> options = new List<FloatMenuOption>();
// foreach (StatDef def in selPawnForGear.NotYetAssignedWeaponStatDefs().OrderBy(i => i.label.ToString()))
// {
// options.Add(new FloatMenuOption(def.LabelCap, delegate
// {
// selPawnForGear.GetWeaponStatCache()
// .StatCache.Insert(0, new WeaponStatCache.StatPriority(def, 0f, StatAssignment.Manual));
// //pawnStatCache.Stats.Insert(0, new Saveable_Pawn_StatDef(def, 0f, StatAssignment.Manual));
// }));
// }
// Find.WindowStack.Add(new FloatMenu(options));
// }
// TooltipHandler.TipRegion(addStatRect, "StatPriorityAdd".Translate());
//
// // line
// GUI.color = Color.grey;
// Widgets.DrawLineHorizontal(cur.x, cur.y, canvas.width);
// GUI.color = Color.white;
//
// // some padding
// cur.y += 10f;
//
// // main content in scrolling view
// Rect contentRect = new Rect(cur.x, cur.y, canvas.width, canvas.height - cur.y);
// Rect viewRect = contentRect;
// viewRect.height = selPawnForGear.GetWeaponStatCache().StatCache.Count * 30f + 10f;
// if (viewRect.height > contentRect.height)
// {
// viewRect.width -= 20f;
// }
//
// Widgets.BeginScrollView(contentRect, ref _scrollPosition, viewRect);
// GUI.BeginGroup(viewRect);
// cur = Vector2.zero;
//
// // none label
// if (!selPawnForGear.GetWeaponStatCache().StatCache.Any())
// {
// Rect noneLabel = new Rect(cur.x, cur.y, viewRect.width, 30f);
// GUI.color = Color.grey;
// Text.Anchor = TextAnchor.MiddleCenter;
// Widgets.Label(noneLabel, "None".Translate());
// Text.Anchor = TextAnchor.UpperLeft;
// GUI.color = Color.white;
// cur.y += 30f;
// }
// else
// {
// // legend kind of thingy.
// Rect legendRect = new Rect(cur.x + (viewRect.width - 24) / 2, cur.y, (viewRect.width - 24) / 2, 20f);
// Text.Font = GameFont.Tiny;
// GUI.color = Color.grey;
// Text.Anchor = TextAnchor.LowerLeft;
// Widgets.Label(legendRect, "-2.5");
// Text.Anchor = TextAnchor.LowerRight;
// Widgets.Label(legendRect, "2.5");
// Text.Anchor = TextAnchor.UpperLeft;
// Text.Font = GameFont.Small;
// GUI.color = Color.white;
// cur.y += 15f;
//
// // stat weight sliders
// foreach (WeaponStatCache.StatPriority stat in selPawnForGear.GetWeaponStatCache().StatCache)
// {
// bool stop_UI;
// WeaponStatCache.DrawWeaponStatRow(ref cur, viewRect.width, stat, selPawnForGear, out stop_UI);
// if (stop_UI)
// {
// // DrawWeaponStatRow can change the StatCache, invalidating the loop. So if it does that, stop looping - we'll redraw on the next tick.
// break;
// }
// }
// }
//
// GUI.EndGroup();
// Widgets.EndScrollView();
//
// GUI.EndGroup();
//
//
// #region Weapon List
//
// // main canvas
//
// Rect rect = new Rect(432, 20, 338, 530);
//
// Text.Font = GameFont.Small;
// // Rect rect2 = rect.ContractedBy(10f);
// Rect calcScore = new Rect(rect.x, rect.y, rect.width, rect.height);
// GUI.BeginGroup(calcScore);
// Text.Font = GameFont.Small;
// GUI.color = Color.white;
// Rect outRect = new Rect(0f, 0f, calcScore.width, calcScore.height);
// Rect viewRect1 = outRect;
// viewRect1.height = scrollViewHeight;
// if (viewRect1.height > outRect.height)
// {
// viewRect1.width -= 20f;
// }
// Widgets.BeginScrollView(outRect, ref scrollPosition, viewRect1);
// float num = 0f;
//
// {
// Widgets.ListSeparator(ref num, viewRect1.width, "Weapons".Translate());
// if (selPawnForGear.equipment.Primary!=null)
// {
// DrawThingRowModded(ref num, viewRect1.width, selPawnForGear.equipment.Primary);
//
// }
// List<Thing> weaponList = selPawnForGear.Map.listerThings.ThingsInGroup(ThingRequestGroup.Weapon);
//
// foreach (Thing current2 in weaponList)
// {
// string bp = "";
// string layer = "";
//
// DrawThingRowModded(ref num, viewRect1.width, current2);
// }
// }
//
//
// if (Event.current.type == EventType.Layout)
// {
// scrollViewHeight = num + 30f;
// }
// Widgets.EndScrollView();
// GUI.EndGroup();
// GUI.color = Color.white;
// Text.Anchor = TextAnchor.UpperLeft;
//
// #endregion
// }
//

private static void DrawCheckBoxArea(string name, ref bool stat)
{
stat = GUILayout.Toggle(stat, name);
}

/*
private Job WearApparel()
{
Outfit currentOutfit = selPawnForGear.outfits.CurrentOutfit;
List<Apparel> wornApparel = selPawnForGear.apparel.WornApparel;
for (int i = wornApparel.Count - 1; i >= 0; i--)
{
if (!currentOutfit.filter.Allows(wornApparel[i]) &&
selPawnForGear.outfits.forcedHandler.AllowedToAutomaticallyDrop(wornApparel[i]))
{
return new Job(JobDefOf.RemoveApparel, wornApparel[i])
{
haulDroppedApparel = true
};
}
}
Thing thing = null;
float num = 0f;
List<Thing> list = Find.ListerThings.ThingsInGroup(ThingRequestGroup.Apparel);
if (list.Count == 0)
{
return null;
}
foreach (Thing apparelthing in list)
{
Apparel apparel = (Apparel) apparelthing;
if (currentOutfit.filter.Allows(apparel))
{
if (Find.SlotGroupManager.SlotGroupAt(apparel.Position) != null)
{
if (!apparel.IsForbidden(selPawnForGear))
{
float num2 = WeaponStatsHelper.ApparelScoreGain(selPawnForGear, apparel);
if (num2 >= 0.09f && num2 >= num)
{
if (ApparelUtility.HasPartsToWear(selPawnForGear, apparel.def))
{
if (selPawnForGear.CanReserveAndReach(apparel, PathEndMode.OnCell,
selPawnForGear.NormalMaxDanger(), 1))
{
thing = apparel;
num = num2;
}
}
}
}
}
}
}
if (thing == null)
{
return null;
}
return new Job(JobDefOf.Wear, thing);
}
*/


public override bool IsVisible
{
get
Expand Down
Binary file modified Source/Outfitter/obj/NoCCL/Outfitter.dll
Binary file not shown.

0 comments on commit f767ef7

Please sign in to comment.