Skip to content

Commit

Permalink
v0.1.0r9
Browse files Browse the repository at this point in the history
- Fixes for Financial Districts update
  • Loading branch information
klyte45 committed Dec 16, 2022
1 parent 5a83192 commit 431e313
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 20 deletions.
1 change: 1 addition & 0 deletions ImprovedTransportManager/ImprovedTransportManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ set "ModDirWS=$(SolutionDir)..\_wsMods\%25wsId%25\"
rmdir /s /q "%25ModDirWS%25"
mkdir "%25ModDirWS%25"
xcopy /y /e "$(TargetDir)*" "%25ModDirWS%25"
copy "$(SolutionDir)/PreviewImage.png" "%25ModDirWS%25"
del "%25ModDirWS%25*.pdb"</PostBuildEvent>
</PropertyGroup>
</Project>
34 changes: 17 additions & 17 deletions ImprovedTransportManager/LiteUI/World/Map/ITMLineStopsWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ public partial class ITMLineStopsWindow : GUIOpacityChanging
protected override float FontSizeMultiplier => .9f;
protected bool Resizable => true;
protected string InitTitle => Str.itm_lineMap_title;
protected Vector2 StartSize => new Vector2(700, 700) ;
protected Vector2 StartSize => new Vector2(700, 700);
protected Vector2 StartPosition => default;
protected Vector2 MinSize => new Vector2(700, 300) ;
protected Vector2 MaxSize => new Vector2(700, 999999) ;
protected Vector2 MinSize => new Vector2(700, 300);
protected Vector2 MaxSize => new Vector2(700, 999999);


private const int STATION_SIZE = 120;
Expand Down Expand Up @@ -168,7 +168,7 @@ protected override void DrawWindow(Vector2 size)
var contrastColor = m_currentLineData.LineColor.ContrastColor();
GUI.DrawTexture(iconRect, GUIKwyttoCommons.whiteTexture);

var subRect = new Rect(iconRect.position + new Vector2(2, 2) , iconRect.size - new Vector2(4, 4) );
var subRect = new Rect(iconRect.position + new Vector2(2, 2), iconRect.size - new Vector2(4, 4));

GUI.DrawTexture(subRect, m_currentLineData.m_uiTextureColor);
var identifier = m_currentLineData.LineIdentifier();
Expand All @@ -185,23 +185,23 @@ protected override void DrawWindow(Vector2 size)

using (var scroll = new GUILayout.ScrollViewScope(m_mapScroll))
{
var leftPivotLine = (size.x - TexLineBg.width ) * .5f;
var lineLengthPixels = (m_loadedStopData.Count + .125f) * STATION_SIZE ;
var leftPivotLine = (size.x - TexLineBg.width) * .5f;
var lineLengthPixels = (m_loadedStopData.Count + .125f) * STATION_SIZE;
GUIKwyttoCommons.Space(lineLengthPixels);
GUI.DrawTexture(new Rect(leftPivotLine, 0, TexLineBg.width, lineLengthPixels), TexLineBg, ScaleMode.StretchToFill);
for (int i = 0; i < m_loadedStopData.Count; i++)
{
StationData stop = m_loadedStopData[i];
stop.GetUpdated();
var targetTex = GetStationImage(stop);
var labelWidth = size.x - leftPivotLine - targetTex.width - 20;
var stationPosMapY = ((i + .25f) * STATION_SIZE ) - (targetTex.height * .5f);
var stationIconRect = new Rect(leftPivotLine, stationPosMapY , targetTex.width , targetTex.height );
var labelWidth = size.x - leftPivotLine - targetTex.width - 20;
var stationPosMapY = ((i + .25f) * STATION_SIZE) - (targetTex.height * .5f);
var stationIconRect = new Rect(leftPivotLine, stationPosMapY, targetTex.width, targetTex.height);
GUI.Label(stationIconRect, targetTex, m_stationBtn);
RunContextMenuStop(i, stop, stationIconRect);
var textsBasePosition = new Vector2((targetTex.width + leftPivotLine + 6) , stationPosMapY);
var textsBasePosition = new Vector2((targetTex.width + leftPivotLine + 6), stationPosMapY);
var boredPercent = 1 - (stop.timeUntilBored * (1f / 255));
var stopNameRect = new Rect(textsBasePosition, new Vector2(labelWidth, 24) );
var stopNameRect = new Rect(textsBasePosition, new Vector2(labelWidth, 24));

var ctrlNameStopNameEditor = $"{stop.stopId}_NAMEEDIT_$$_";
if (m_currentStopNameEdit == ctrlNameStopNameEditor)
Expand Down Expand Up @@ -234,18 +234,18 @@ protected override void DrawWindow(Vector2 size)
GUI.FocusControl(ctrlNameStopNameEditor);
m_tempValue = stop.cachedName;
}
GUI.Label(new Rect(textsBasePosition + new Vector2(0, 25) , new Vector2(labelWidth, 24) ), $"{Str.itm_lineMap_earningsCurrentPeriodAcronym} {stop.EarningCurrentWeek.ToString(Settings.moneyFormat, LocaleManager.cultureInfo)}; {Str.itm_lineMap_earningsLastPeriodAcronym} {stop.EarningLastWeek.ToString(Settings.moneyFormat, LocaleManager.cultureInfo)}; {Str.itm_lineMap_earningsAllTimeAcronym} {stop.EarningAllTime.ToString(Settings.moneyFormatNoCents, LocaleManager.cultureInfo)}", m_smallLabel);
GUI.Label(new Rect(textsBasePosition + new Vector2(0, 50) , new Vector2(labelWidth, 24) ), string.Format(Str.itm_lineMap_waitingTemplate, stop.residentsWaiting, stop.touristsWaiting, boredPercent * 100, Color.Lerp(Color.white, Color.Lerp(Color.yellow, Color.red, (boredPercent * 2) - 1), boredPercent * 2).ToRGB()), m_smallLabel);
GUI.Label(new Rect(new Vector2(textsBasePosition.x, stationPosMapY + (STATION_SIZE * .66f )), new Vector2(labelWidth, 24) ), $"<i><color=cyan>{stop.distanceNextStop:N0}m</color></i>");
GUI.Label(new Rect(textsBasePosition + new Vector2(0, 25), new Vector2(labelWidth, 24)), $"{Str.itm_lineMap_earningsCurrentPeriodAcronym} {stop.EarningCurrentWeek.ToString(Settings.moneyFormat, LocaleManager.cultureInfo)}; {Str.itm_lineMap_earningsLastPeriodAcronym} {stop.EarningLastWeek.ToString(Settings.moneyFormat, LocaleManager.cultureInfo)}; {Str.itm_lineMap_earningsAllTimeAcronym} {stop.EarningAllTime.ToString(Settings.moneyFormatNoCents, LocaleManager.cultureInfo)}", m_smallLabel);
GUI.Label(new Rect(textsBasePosition + new Vector2(0, 50), new Vector2(labelWidth, 24)), string.Format(Str.itm_lineMap_waitingTemplate, stop.residentsWaiting, stop.touristsWaiting, boredPercent * 100, Color.Lerp(Color.white, Color.Lerp(Color.yellow, Color.red, (boredPercent * 2) - 1), boredPercent * 2).ToRGB()), m_smallLabel);
GUI.Label(new Rect(new Vector2(textsBasePosition.x, stationPosMapY + (STATION_SIZE * .66f)), new Vector2(labelWidth, 24)), $"<i><color=cyan>{stop.distanceNextStop:N0}m</color></i>");

}
if (m_currentLineData.m_type.HasVehicles())
{
foreach (var vehicle in m_loadedVehiclesData)
{
var position = vehicle.GetPositionOffset(leftPivotLine - 4 , STATION_SIZE );
var position = vehicle.GetPositionOffset(leftPivotLine - 4, STATION_SIZE);
var content = vehicle.GetContentFor(m_currentVehicleDataShow);
if (GUI.Button(new Rect(position, new Vector2(leftPivotLine * .25f, 20) ), content, vehicle.CachedStyle))
if (GUI.Button(new Rect(position, new Vector2(leftPivotLine * .25f, 20)), content, vehicle.CachedStyle))
{
DefaultTool.OpenWorldInfoPanel(new InstanceID { Vehicle = vehicle.VehicleId }, default);
ToolsModifierControl.cameraController.SetTarget(new InstanceID { Vehicle = vehicle.VehicleId }, default, false);
Expand Down Expand Up @@ -589,7 +589,7 @@ private void UpdateVehicleButtons(ushort lineID, bool force = false)
: VehicleStopProgressState.ON_ROUTE;

currentVehicle.m_progressItemIdx = idx == 0 ? 0 : m_loadedVehiclesData.Take(idx).Count(x => currentVehicle.m_nextStopIdx == x.m_nextStopIdx && currentVehicle.m_progressState == x.m_progressState);
currentVehicle.VehicleColor = info.m_vehicleAI.GetColor(vehicleId, ref vehicleData, 0);
currentVehicle.VehicleColor = info.m_vehicleAI.GetColor(vehicleId, ref vehicleData, 0, 0);

info.m_vehicleAI.GetBufferStatus(vehicleId, ref vehicleData, out _, out currentVehicle.m_passengers, out currentVehicle.m_capacity);

Expand Down
2 changes: 1 addition & 1 deletion ImprovedTransportManager/ModInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Reflection;
using UnityEngine;

[assembly: AssemblyVersion("0.1.0.8")]
[assembly: AssemblyVersion("0.1.0.9")]
namespace ImprovedTransportManager
{
public class ModInstance : BasicIUserMod<ModInstance, ITMMainController>
Expand Down
8 changes: 6 additions & 2 deletions ImprovedTransportManager/UI/VersionNotes.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<color=green>Update r9 (17/DEC/22):</color>
- Fixes for Financial Districts update

<color=green>Update r8 (17/NOV/22)</color>
- Fixing integration with WE

<color=green>Update r7 (16/NOV/22)</color>
- Fixed BG color to not be too dark nor saturated
- Fixed non-full hd window sizes
- Fixed ELT issues
- Added some language translations (specially cn, ja and it)

<color=green>Update r8 (17/NOV/22)</color>
- Fixing integration with WE

<color=yellow>Welcome to Improved Transport Manager, the ITM!</color>

Expand Down
Binary file added PreviewImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 431e313

Please sign in to comment.