feat: Shrink Hammer, and Alt + scroll to size pieces with both hammers
A player asked to build below vanilla size for small details. The new Shrink Hammer, craftable by any race, builds from 0.25 to 1; Trol's Hammer keeps 1 to 3. With either hammer, Alt + scroll in build mode changes the size in steps of 0.05, an Alt: Size row joins the build hints, and the size floats over the ghost when it is not the default. With the repair tool, the aimed piece shows the size it was built at. Both hammers get icons of their own.
This commit is contained in:
parent
16cacde532
commit
0d1f655598
17 changed files with 414 additions and 14 deletions
|
|
@ -110,9 +110,7 @@ namespace RacesOfValheim
|
|||
|
||||
if (ghost != m_tracked) Adopt(ghost);
|
||||
|
||||
float desired = TrolsHammerItem.IsTrolsHammer(player.RightItem)
|
||||
? TrolsHammerConfig.ActiveFactor()
|
||||
: 1f;
|
||||
float desired = BuildScale.For(player.RightItem);
|
||||
|
||||
if (Mathf.Approximately(desired, m_applied)) return;
|
||||
|
||||
|
|
@ -158,9 +156,8 @@ namespace RacesOfValheim
|
|||
private static void Prefix(Player __instance)
|
||||
{
|
||||
if (__instance == null || __instance != Player.m_localPlayer) return;
|
||||
if (!TrolsHammerItem.IsTrolsHammer(__instance.RightItem)) return;
|
||||
|
||||
float factor = TrolsHammerConfig.ActiveFactor();
|
||||
// Trol's Hammer or the Shrink Hammer; any other tool builds at 1 and leaves here.
|
||||
float factor = BuildScale.For(__instance.RightItem);
|
||||
if (Mathf.Approximately(factor, 1f)) return;
|
||||
|
||||
TrolsHammerScaling.Placing = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue