Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
1.3.4
Browse files Browse the repository at this point in the history
- Add mouse scroll wheel adjustments to numerical fields.
- Fix missing localization for modes panel title.
- Add Traditional Chinese localization from CrowdIn translation volunteers.
- Adjust starting position for curves when using fence mode.
  • Loading branch information
algernon-A committed Jan 8, 2024
1 parent 8e82b5e commit 5d08361
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 55 deletions.
2 changes: 1 addition & 1 deletion BepInEx/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace LineTool
/// <summary>
/// BepInEx plugin to substitute for IMod support.
/// </summary>
[BepInPlugin(GUID, "Line Tool Lite", "1.3.3")]
[BepInPlugin(GUID, "Line Tool Lite", "1.3.4")]
[HarmonyPatch]
public class Plugin : BaseUnityPlugin
{
Expand Down
2 changes: 1 addition & 1 deletion BepInEx/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Line_Tool_Lite",
"version_number": "1.3.3",
"version_number": "1.3.4",
"website_url": "https://github.com/algernon-A/LineToolLite",
"description": "Place objects in lines, curves, or circles. A variety of options and controls are availalbe to specify and fine-tune results.",
"dependencies": [
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 1.3.4
- Add mouse scroll wheel adjustments to numerical fields.
- Fix missing localization for modes panel title.
- Add Traditional Chinese localization from CrowdIn translation volunteers.
- Adjust starting position for curves when using fence mode.

## 1.3.3
- Ensure new trees have default growth state.

Expand Down
3 changes: 2 additions & 1 deletion Code/LineModes/SimpleCurve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ public override void CalculatePoints(float3 currentPos, SpacingMode spacingMode,
// Randomizer.
System.Random random = new ((int)(currentPos.x + currentPos.z) * 1000);

float tFactor = 0f;
// For fence mode offset initial spacing by object half-length (so start of item aligns with the line start point).
float tFactor = spacingMode == SpacingMode.FenceMode ? BezierStep(0, spacing / 2f) : 0f;
float distanceTravelled = 0f;
while (tFactor < 1.0f)
{
Expand Down
9 changes: 2 additions & 7 deletions LineToolLite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<AssemblyTitle>$(Title)</AssemblyTitle>
<Description>A Cities: Skylines 2 mod.</Description>
<Authors>algernon</Authors>
<Copyright>Copyright © 2023 algernon (github.com/algernon-A). All rights reserved.</Copyright>
<Copyright>Copyright © 2023-24 algernon (github.com/algernon-A). All rights reserved.</Copyright>
<Product>$(Title)</Product>
<Version>1.3.3</Version>
<Version>1.3.4</Version>
<LangVersion>9.0</LangVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
Expand All @@ -15,11 +15,6 @@
<Import Project="Config/Targets.csproj" />
<Import Project="Config/References.csproj" />
<Import Project="BepInEx/BepInEx.csproj" />
<ItemGroup>
<None Remove="UI\common.js" />
<None Remove="UI\modes.html" />
<None Remove="UI\modes.js" />
</ItemGroup>

<ItemGroup>
<AdditionalFiles Include="stylecop.json" />
Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Line Tool Lite
github.com/Algernon-A/LineToolLite
Copyright (c) 2023 algernon (K. Algernon A. Sheppard).
Copyright (c) 2023-24 algernon (K. Algernon A. Sheppard).

A modified version of the full Line Tool mod for Cities: Skylines II (github.com/Algernon-A/LineTool-CS2) with alterations and removals to make it compatible with BepInEx and usable with Cities: Skylines public builds from version 1.0.14 which do not have official modding support.
Copyright (c) 2023 algernon (K. Algernon A. Sheppard; github.com/Algernon-A). All rights reserved.
Copyright (c) 2023-24 algernon (K. Algernon A. Sheppard; github.com/Algernon-A). All rights reserved.
10 changes: 10 additions & 0 deletions UI/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ if (typeof lineTool.setupClickButton !== 'function') {
}
}

// Function to setup controls with a scrollwheel component.
if (typeof lineTool.setupWheel !== 'function') {
lineTool.setupWheel = function (id, onwheel) {
let newControl = document.getElementById(id);
if (newControl) {
newControl.onwheel = onwheel;
}
}
}

// Function to setup tooltip.
if (typeof lineTool.setTooltip !== 'function') {
lineTool.setTooltip = function (id, toolTipKey) {
Expand Down
2 changes: 1 addition & 1 deletion UI/modes.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="item_bZY" id="line-tool-modes">
<div class="item-content_nNz">
<div class="label_RZX">Line mode</div>
<div class="label_RZX" localeKey="LINETOOL.LineMode"></div>
<div class="content_ZIz">
<button id="line-tool-mode-point" class="button_KVN selected">
<img class="icon_Ysc" src="Media/Tools/Net Tool/Point.svg">
Expand Down
3 changes: 3 additions & 0 deletions UI/modes.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ lineTool.setupClickButton("line-tool-mode-point", lineTool.handlePointMode, "Poi
lineTool.setupClickButton("line-tool-mode-straight", lineTool.handleStraightMode, "StraightLine");
lineTool.setupClickButton("line-tool-mode-simplecurve", lineTool.handleSimpleCurveMode, "SimpleCurve");
lineTool.setupClickButton("line-tool-mode-circle", lineTool.handleCircleMode, "Circle");

// Apply translations.
lineTool.applyLocalization(lineTool.modeDiv);
5 changes: 5 additions & 0 deletions UI/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@ lineTool.setTooltip("line-tool-rotation-field", "Rotation");
lineTool.setTooltip("line-tool-xOffset-field", "SpacingVariation");
lineTool.setTooltip("line-tool-zOffset-field", "OffsetVariation");

lineTool.setupWheel("line-tool-spacing-field", (event) => { lineTool.adjustSpacing(event, event.deltaY / 30); });
lineTool.setupWheel("line-tool-rotation-field", (event) => { lineTool.adjustRotation(event, event.deltaY / 30); });
lineTool.setupWheel("line-tool-xOffset-field", (event) => { lineTool.adjustRandomSpacing(event, event.deltaY / 30); });
lineTool.setupWheel("line-tool-zOffset-field", (event) => { lineTool.adjustRandomOffset(event, event.deltaY / 30); });

// Apply translations.
lineTool.applyLocalization(lineTool.div);

Expand Down
Loading

0 comments on commit 5d08361

Please sign in to comment.