Skip to content

Commit

Permalink
v1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Adriano committed May 5, 2021
1 parent 9003645 commit 0436bbc
Show file tree
Hide file tree
Showing 28 changed files with 503 additions and 302 deletions.
6 changes: 6 additions & 0 deletions Tools/PetEditor/EditWindows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,12 @@ private void timer1_Tick(object sender, EventArgs e)
}
pictureBox2.Image = listView1.LargeImageList.Images[imageIndex];
pictureBox2.Tag = val;
if (stats.SubSteps.Count <= 0)
{
timer1.Enabled = false;
return;
}

int nextIndex = (int.Parse(timer1.Tag.ToString()) + 1) % stats.SubSteps.Count;
timer1.Tag = nextIndex;
timer1.Interval = stats.SubSteps[nextIndex].Interval;
Expand Down
3 changes: 3 additions & 0 deletions Tools/PetEditor/MainWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public void SelectSection(string section)
editWindows.SelectSection(section);
if (!editWindows.Visible)
{
formChat.Hide();
xmlViewer.Hide();
editWindows.Show();
}
Expand All @@ -286,6 +287,7 @@ public void SelectSection(string section)
if (editWindows.Visible)
{
xmlViewer.Show();
formChat.Hide();
editWindows.Hide();
}
}
Expand Down Expand Up @@ -359,6 +361,7 @@ private void toolStripButton1_Click(object sender, EventArgs e)
private void toolStripButton2_Click(object sender, EventArgs e)
{
if (editWindows == null || xmlViewer == null) return;
if (formChat != null) formChat.Hide();
editWindows.Hide();
xmlViewer.Show();
formProject.XmlView();
Expand Down
6 changes: 3 additions & 3 deletions Tools/PetEditor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PetEditor")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyCopyright("Copyright © 2019-2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.4.0.0")]
[assembly: AssemblyFileVersion("0.4.0.0")]
[assembly: AssemblyVersion("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
4 changes: 4 additions & 0 deletions Tools/PetEditor/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,10 @@ private void button3_Click(object sender, EventArgs e)
{
listView2.Items.Add("ANIMATION " + animation.Id).SubItems.Add("There is no frame inside this animation, this list can't be empty");
}
if(animation.Sequence.RepeatFromFrame >= animation.Sequence.Frame.Length)
{
listView2.Items.Add("ANIMATION " + animation.Id).SubItems.Add("Repeat-from index is higher than the number of frames");
}
animationIds.Add(animation.Id);
animationNames.Add(animation.Name);
}
Expand Down
5 changes: 4 additions & 1 deletion Tools/PetEditor/WebForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public WebForm()
private void WebForm_Load(object sender, EventArgs e)
{
//chat link: http://www.e-chat.co/room/19829319
webViewCompatible1.Source = new Uri("http://www.e-chat.co/room/19829319");
//webViewCompatible1.Source = new Uri("http://www.e-chat.co/room/19829319");

// chat link2: https://tlk.io/esheep_editor
webViewCompatible1.Source = new Uri("https://tlk.io/esheep_editor");
}
}
}
19 changes: 18 additions & 1 deletion src/AppWins/AppOptionsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,24 @@ public AppOptionsPage()

private async void AppOptionsPage_Loaded(object sender, RoutedEventArgs e)
{
StartupTask startupTask = await StartupTask.GetAsync("eSheepId");
StartupTask startupTask = null;
try
{
startupTask = await StartupTask.GetAsync("eSheepId");
}
catch(Exception)
{
startupTask = null;
}

if (startupTask == null)
{
MessageDialog dialog = new MessageDialog(
"Unable to get application Id",
"eSheep Id");
await dialog.ShowAsync();
return;
}

switch (startupTask.State)
{
Expand Down
5 changes: 5 additions & 0 deletions src/AppWins/PetOptionsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
<ToggleSwitch Margin="10" OnContent="Foreground enabled" OffContent="Foreground disabled" x:Name="foregroundWindowToggle"></ToggleSwitch>
<TextBlock>The original eSheep was able to bring to front the touched window. If you activate this option, your productivity will decrease ;)</TextBlock>
</StackPanel>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Padding="0,20,0,0">Steal Taskbar Focus</TextBlock>
<StackPanel Margin="30,0,0,0">
<ToggleSwitch Margin="10" OnContent="Steal focus" OffContent="Stay behind taskbar" x:Name="stealTaskbarToggle"></ToggleSwitch>
<TextBlock>Windows Taskbar is on topmost. Mate can "steal" the focus, but the tray icon will disappear if this occours.</TextBlock>
</StackPanel>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Padding="0,20,0,0">Multi Screen</TextBlock>
<StackPanel Margin="30,0,0,0">
<ToggleSwitch Margin="10" OnContent="Allow multiscreen" OffContent="Only on mainscreen" x:Name="multiScreenToggle"></ToggleSwitch>
Expand Down
7 changes: 7 additions & 0 deletions src/AppWins/PetOptionsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,22 @@ private void PetOptionsPage_Loaded(object sender, RoutedEventArgs e)

volumeSlider.Value = App.MyData.GetVolume();
foregroundWindowToggle.IsOn = App.MyData.GetWindowForeground();
stealTaskbarToggle.IsOn = App.MyData.GetStealTaskbarFocus();
multiScreenToggle.IsOn = App.MyData.GetMultiscreen();

volumeSlider.Header = ((int)(volumeSlider.Value * 100)).ToString() + " %";

volumeSlider.ValueChanged += VolumeSlider_ValueChanged;
foregroundWindowToggle.Toggled += ForegroundWindowToggle_Toggled;
stealTaskbarToggle.Toggled += StealTaskbarToggle_Toggled;
multiScreenToggle.Toggled += MultiScreenToggle_Toggled;
}

private void StealTaskbarToggle_Toggled(object sender, RoutedEventArgs e)
{
App.MyData.SetStealTaskbarFocus(stealTaskbarToggle.IsOn);
}

private void MultiScreenToggle_Toggled(object sender, RoutedEventArgs e)
{
App.MyData.SetMultiscreen(multiScreenToggle.IsOn);
Expand Down
17 changes: 13 additions & 4 deletions src/AppWins/PetSelectionPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,25 @@
<TextBlock x:Name="loadingText" Text="Loading XML..." TextAlignment="Center" Padding="5" />
</StackPanel>

<ListView x:Name="PetsBox" HorizontalAlignment="Stretch" VerticalAlignment="Top" IsItemClickEnabled="True" ItemClick="PetsBox_ItemClick">
<ListView
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollMode="Enabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
Margin="30"
x:Name="PetsBox"
HorizontalAlignment="Center"
VerticalAlignment="Top"
IsItemClickEnabled="True"
ItemClick="PetsBox_ItemClick">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel Orientation="Horizontal"/>
<ItemsWrapGrid Orientation="Horizontal" HorizontalAlignment="Stretch"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>

<ListView.ItemTemplate>
<DataTemplate>
<Grid Width="80" Height="110" CornerRadius="2" Background="{Binding ItemColor}">
<Grid Margin="5" Width="80" Height="110" CornerRadius="2" Background="{Binding ItemColor}">
<ProgressRing Width="80" Height="80" IsActive="{Binding IsLoading}" VerticalAlignment="Top"></ProgressRing>
<Image Source="{Binding Image}" Stretch="None" Width="80" Height="80" VerticalAlignment="Top" />
<Viewbox StretchDirection="DownOnly" Stretch="Uniform" VerticalAlignment="Bottom" Width="80" Height="50" >
Expand Down
5 changes: 3 additions & 2 deletions src/DesktopPet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Windows">
<HintPath>C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.17763.0\Windows.winmd</HintPath>
<Reference Include="Windows, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0\Windows.winmd</HintPath>
</Reference>
<Reference Include="WindowsBase" />
</ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/DesktopPet_Portable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll</HintPath>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down
36 changes: 29 additions & 7 deletions src/LocalData/Class1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Settings
{
public double Volume { get; set; } = 0.3;
public bool WinForeGround { get; set; } = false;
public bool StealTaskbarFocus { get; set; } = false;
public int AutostartPets { get; set; } = 1;
public bool MultiScreenEnabled { get; set; } = true;
public string CurrentPet { get; set; } = "esheep64";
Expand Down Expand Up @@ -126,6 +127,20 @@ public bool GetWindowForeground()
return LocalSettings.WinForeGround;
}

public void SetStealTaskbarFocus(bool steal)
{
if (LocalSettings.StealTaskbarFocus != steal)
{
LocalSettings.StealTaskbarFocus = steal;
SaveSettings();
}
}

public bool GetStealTaskbarFocus()
{
return LocalSettings.StealTaskbarFocus;
}

public void SetAutoStartPets(int startingPets)
{
if (LocalSettings.AutostartPets != startingPets)
Expand Down Expand Up @@ -247,14 +262,21 @@ private void LoadImages()
fs.Close();
}
Images = "";
var f = File.OpenRead(LocalFolder + "\\images.xml");
int bytesRead;
do
try
{
bytesRead = f.Read(buffer, 0, 1024 * 64);
Images += Encoding.UTF8.GetString(buffer, 0, bytesRead);
} while (bytesRead > 0);
f.Close();
var f = File.OpenRead(LocalFolder + "\\images.xml");
int bytesRead;
do
{
bytesRead = f.Read(buffer, 0, 1024 * 64);
Images += Encoding.UTF8.GetString(buffer, 0, bytesRead);
} while (bytesRead > 0);
f.Close();
}
catch(Exception)
{
Images = "";
}
}

public bool NeedToLoadNew(string petFolder, DateTimeOffset lastUpdate)
Expand Down
11 changes: 9 additions & 2 deletions src/Portable/FormOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ private void FormOptions_Load(object sender, EventArgs e)
checkBox1.Enabled = false;
}
checkBox2.Checked = Program.MyData.GetWindowForeground();
trackBar2.Value = Program.MyData.GetAutoStartPets();
checkBox4.Checked = Program.MyData.GetStealTaskbarFocus();
trackBar2.Value = Program.MyData.GetAutoStartPets();
label5.Text = trackBar2.Value.ToString();
label2.Text = trackBar1.Value.ToString();
checkBox3.Checked = Program.MyData.GetMultiscreen();
Expand Down Expand Up @@ -124,7 +125,12 @@ private void checkBox2_Click(object sender, EventArgs e)
Program.MyData.SetWindowForeground(checkBox2.Checked);
}

private void trackBar2_Scroll(object sender, EventArgs e)
private void checkBox4_CheckedChanged(object sender, EventArgs e)
{
Program.MyData.SetStealTaskbarFocus(checkBox4.Checked);
}

private void trackBar2_Scroll(object sender, EventArgs e)
{
Program.MyData.SetAutoStartPets(trackBar2.Value);
label5.Text = trackBar2.Value.ToString();
Expand All @@ -134,5 +140,6 @@ private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
Program.MyData.SetMultiscreen(checkBox3.Checked);
}

}
}
Loading

0 comments on commit 0436bbc

Please sign in to comment.