parent
3e6f8c44fe
commit
7ef631924d
|
@ -0,0 +1,21 @@
|
||||||
|
using WatchFace.Parser.Attributes;
|
||||||
|
|
||||||
|
namespace WatchFace.Parser.Elements.WeatherElements
|
||||||
|
{
|
||||||
|
public class CustomWeatherIcon
|
||||||
|
{
|
||||||
|
[ParameterId(1)]
|
||||||
|
public long X { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(2)]
|
||||||
|
public long Y { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(3)]
|
||||||
|
[ParameterImageIndex]
|
||||||
|
public long ImageIndex { get; set; }
|
||||||
|
|
||||||
|
[ParameterId(4)]
|
||||||
|
[ParameterImagesCount]
|
||||||
|
public long ImagesCount { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -10,7 +10,8 @@ namespace WatchFace.Parser.Elements.WeatherElements
|
||||||
[ParameterId(1)]
|
[ParameterId(1)]
|
||||||
public Coordinates Coordinates { get; set; }
|
public Coordinates Coordinates { get; set; }
|
||||||
|
|
||||||
// TODO: Looks like here should be Id 2 also
|
[ParameterId(2)]
|
||||||
|
public CustomWeatherIcon CustomIcon { get; set; }
|
||||||
|
|
||||||
[ParameterId(3)]
|
[ParameterId(3)]
|
||||||
public Coordinates CoordinatesAlt { get; set; }
|
public Coordinates CoordinatesAlt { get; set; }
|
||||||
|
|
|
@ -10,6 +10,7 @@ namespace WatchFace.Parser.Models.Elements
|
||||||
base(parameter, parent, name) { }
|
base(parameter, parent, name) { }
|
||||||
|
|
||||||
public CoordinatesElement Current { get; set; }
|
public CoordinatesElement Current { get; set; }
|
||||||
|
public ImageSetElement CustomIcon { get; set; }
|
||||||
public CoordinatesElement CurrentAlt { get; set; }
|
public CoordinatesElement CurrentAlt { get; set; }
|
||||||
public CoordinatesElement Unknown4 { get; set; }
|
public CoordinatesElement Unknown4 { get; set; }
|
||||||
|
|
||||||
|
@ -18,7 +19,11 @@ namespace WatchFace.Parser.Models.Elements
|
||||||
var useAltCoordinates = CurrentAlt != null && state.CurrentTemperature == null;
|
var useAltCoordinates = CurrentAlt != null && state.CurrentTemperature == null;
|
||||||
var iconCoordinates = useAltCoordinates ? CurrentAlt : Current;
|
var iconCoordinates = useAltCoordinates ? CurrentAlt : Current;
|
||||||
|
|
||||||
|
if (iconCoordinates != null)
|
||||||
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), iconCoordinates.X, iconCoordinates.Y);
|
drawer.DrawImage(LoadWeatherImage(state.CurrentWeather), iconCoordinates.X, iconCoordinates.Y);
|
||||||
|
|
||||||
|
if (CustomIcon != null)
|
||||||
|
drawer.DrawImage(resources[CustomIcon.ImageIndex + 1], CustomIcon.X, CustomIcon.Y);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Bitmap LoadWeatherImage(WeatherCondition weather)
|
private static Bitmap LoadWeatherImage(WeatherCondition weather)
|
||||||
|
@ -35,6 +40,9 @@ namespace WatchFace.Parser.Models.Elements
|
||||||
case 1:
|
case 1:
|
||||||
Current = new CoordinatesElement(parameter, this);
|
Current = new CoordinatesElement(parameter, this);
|
||||||
return Current;
|
return Current;
|
||||||
|
case 2:
|
||||||
|
CustomIcon = new ImageSetElement(parameter, this);
|
||||||
|
return CustomIcon;
|
||||||
case 3:
|
case 3:
|
||||||
CurrentAlt = new CoordinatesElement(parameter, this);
|
CurrentAlt = new CoordinatesElement(parameter, this);
|
||||||
return CurrentAlt;
|
return CurrentAlt;
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
<Compile Include="Elements\TimeElements\AmPm.cs" />
|
<Compile Include="Elements\TimeElements\AmPm.cs" />
|
||||||
<Compile Include="Elements\TimeElements\TwoDigits.cs" />
|
<Compile Include="Elements\TimeElements\TwoDigits.cs" />
|
||||||
<Compile Include="Elements\Weather.cs" />
|
<Compile Include="Elements\Weather.cs" />
|
||||||
|
<Compile Include="Elements\WeatherElements\CustomWeatherIcon.cs" />
|
||||||
<Compile Include="Elements\WeatherElements\AirPollution.cs" />
|
<Compile Include="Elements\WeatherElements\AirPollution.cs" />
|
||||||
<Compile Include="Elements\WeatherElements\OneLineTemperature.cs" />
|
<Compile Include="Elements\WeatherElements\OneLineTemperature.cs" />
|
||||||
<Compile Include="Elements\WeatherElements\SeparateTemperature.cs" />
|
<Compile Include="Elements\WeatherElements\SeparateTemperature.cs" />
|
||||||
|
|
Loading…
Reference in New Issue