Hammer context menu entity list access?
Discussion in 'Rust Development' started by ÆthyrSurfer, Feb 27, 2016.
-
I dont think there is a active list, but you can make your own list using testing and entity names.
-
How do you mean?
-
Hold that thought, jut found something in Hammer.cs inside the assembly:
"BuildingBlock buildingBlock = this.GetBuildingBlock();"Code:private void OpenContextMenu() { BuildingBlock buildingBlock = this.GetBuildingBlock(); if ((Object) buildingBlock == (Object) null) return; GameMenu.Option[] buildMenu = buildingBlock.GetBuildMenu(this.ownerPlayer); if (buildMenu.Length == 0) return; ContextMenuUI.Open(buildMenu, ContextMenuUI.MenuType.RightClick); }
You can use that to see if something is rigthclickable with a hammer. -
In Hammer.cs I only see CanHit and DoAttackShared
-
What do you use to decompile the assembly?
-
dotPeek
-
Same, odd. Search for just "hammer"
-
This is all I see in Hammer.cs
Code:using Oxide.Core; using UnityEngine;public class Hammer : BaseMelee { public Hammer() { base.\u002Ector(); } public override bool CanHit(HitTest info) { if ((Object) info.HitEntity == (Object) null || info.HitEntity is BasePlayer) return false; return info.HitEntity is BaseCombatEntity; } public override void DoAttackShared(HitInfo info) { if (this.isServer && !this.VerifyClientAttack(info)) return; BaseCombatEntity baseCombatEntity = info.HitEntity as BaseCombatEntity; if (Interface.CallHook("OnHammerHit", (object) this.ownerPlayer, (object) info) != null) return; if ((Object) baseCombatEntity != (Object) null && this.isServer) { using (TimeWarning.New("DoRepair", 50L)) baseCombatEntity.DoRepair(this.ownerPlayer); } if (this.isServer) Effect.server.ImpactEffect(info); else Effect.client.ImpactEffect(info); } }Last edited by a moderator: Feb 28, 2016 -
Code:
using UnityEngine;public class Hammer : BaseMelee { public Hammer() { base.\u002Ector(); } private BuildingBlock GetBuildingBlock() { return this.ownerPlayer.lookingAtEntity as BuildingBlock; } public override void Frame() { base.Frame(); BuildingBlock buildingBlock = this.GetBuildingBlock(); if (!((Object) buildingBlock != (Object) null)) return; buildingBlock.DrawHighlight(); } public override void OnTick(float delta) { base.OnTick(delta); if (!this.ownerPlayer.input.state.WasJustPressed(BUTTON.FIRE_SECONDARY) || !this.ownerPlayer.CanBuild() && !this.ownerPlayer.IsAdmin()) return; this.OpenContextMenu(); } private void OpenContextMenu() { BuildingBlock buildingBlock = this.GetBuildingBlock(); if ((Object) buildingBlock == (Object) null) return; GameMenu.Option[] buildMenu = buildingBlock.GetBuildMenu(this.ownerPlayer); if (buildMenu.Length == 0) return; ContextMenuUI.Open(buildMenu, ContextMenuUI.MenuType.RightClick); } public override bool CanHit(HitTest info) { if ((Object) info.HitEntity == (Object) null || info.HitEntity is BasePlayer) return false; return info.HitEntity is BaseCombatEntity; } public override void DoAttackShared(HitInfo info) { if (!((Object) (info.HitEntity as BaseCombatEntity) != (Object) null)) ; if (this.isServer) Effect.server.ImpactEffect(info); else Effect.client.ImpactEffect(info); } } -
This isn't from Rust Legacy is it?
-
Shouldn't be, I get all of my code straight from the assembly of rust data, are you getting yours from legacy?
[DOUBLEPOST=1456693899][/DOUBLEPOST]Cant be actually, that assembly I use contains the helicopter files and legacy doesnt have a helicopter.
