Ludeon Forums

RimWorld => Mods => Help => Topic started by: sibile on April 05, 2017, 03:48:45 AM

Title: where is the why to the do helping of the what
Post by: sibile on April 05, 2017, 03:48:45 AM
[DebuggerHidden]
public override IEnumerable<Gizmo> GetGizmos()
{
Building_Door.<GetGizmos>c__Iterator13C <GetGizmos>c__Iterator13C = new Building_Door.<GetGizmos>c__Iterator13C();
<GetGizmos>c__Iterator13C.<>f__this = this;
Building_Door.<GetGizmos>c__Iterator13C expr_0E = <GetGizmos>c__Iterator13C;
expr_0E.$PC = -2;
return expr_0E;
}


what is it
what does it do
why does it break every compiler
how do i make it stop
Title: Re: where is the why to the do helping of the what
Post by: skullywag on April 05, 2017, 06:31:02 AM
go get this:

https://github.com/Zhentar/ILSpy/releases/tag/v1.0.1

then decompile it again. Then thank zhentar.
Title: Re: where is the why to the do helping of the what
Post by: RawCode on April 05, 2017, 06:46:40 AM
this is result of "yield return" syntax sugar compilation
Title: Re: where is the why to the do helping of the what
Post by: sibile on April 05, 2017, 12:25:22 PM
now the old thing is gone but it has issues with the new one

[DebuggerHidden]
public override IEnumerable<Gizmo> GetGizmos()
{
foreach (Gizmo g in base.GetGizmos())
{
yield return g;
}
if (base.Faction == Faction.OfPlayer)
{
yield return new Command_Toggle
{
defaultLabel = "CommandToggleDoorHoldOpen".Translate(),
defaultDesc = "CommandToggleDoorHoldOpenDesc".Translate(),
hotKey = KeyBindingDefOf.Misc3,
icon = TexCommand.HoldOpen,
isActive = (() => this.<>f__this.holdOpenInt),
toggleAction = delegate
{
this.<>f__this.holdOpenInt = !this.<>f__this.holdOpenInt;
this.<>f__this.Map.reachability.ClearCache();
if (this.<>f__this.Open && this.<>f__this.holdOpenInt)
{
this.<>f__this.freePassageUntilClosed = true;
}
}
};
}
}
Title: Re: where is the why to the do helping of the what
Post by: sibile on April 05, 2017, 02:26:13 PM
ok I actually figured it out by just going to the source code for the door and now my totally original door works but it has no animations and i totally dont know why
Title: Re: where is the why to the do helping of the what
Post by: RawCode on April 05, 2017, 06:13:19 PM
you should try dnspy with compilergenerated code displayed, to make sure, that entire code is present and nothing is missed.
Title: Re: where is the why to the do helping of the what
Post by: sibile on April 05, 2017, 08:07:00 PM
Kk ill try that after my comp is done getting deep fried by tropical storm thx guys

Im just trying to make an exact copy of the base door class with a different class name so that i can use the copied class for different doors that are affected by dooropenspeed differently since its hardcoded how much an autodoor is faster than a normal door
Title: Re: where is the why to the do helping of the what
Post by: skullywag on April 06, 2017, 03:06:34 AM
Just so you know core has hard coded references to the core door class you will have to detour every pathfinding method etc that mentions the core one to also check for your one. This is why modders dont mod doors...