Changed quick task info defaults, removed one easter egg

This commit is contained in:
Jaex 2016-02-06 22:56:48 +02:00
parent 7ff74dcdb3
commit 5e02df215f
14 changed files with 29 additions and 345 deletions

View file

@ -267,7 +267,7 @@ protected override void OnDragDrop(DragEventArgs drgevent)
}
lineIndex = lastLineIndex = -1;
Update();
Invalidate();
}
protected void OnItemMoved(int oldIndex, int newIndex)

View file

@ -1,46 +0,0 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2016 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using System.Drawing;
namespace ShareX
{
public class CompanionCube
{
public bool IsActive { get; set; }
public Point Location { get; set; }
public Size Size { get; set; }
public Rectangle Rectangle => new Rectangle(Location, Size);
public Point Center => new Point(Location.X + (Size.Width / 2), Location.Y + (Size.Height / 2));
public int Speed { get; set; }
public CompanionCube(int size, int speed)
{
Size = new Size(size, size);
Speed = speed;
IsActive = true;
}
}
}

View file

@ -1,189 +0,0 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2016 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.Properties;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
namespace ShareX
{
public static class CompanionCubeManager
{
public static bool IsActive { get; set; }
public static int CubeCount { get; } = 50;
public static List<CompanionCube> Cubes { get; private set; }
private static CompanionCubesForm cubesForm;
private static Timer timer;
private static Stopwatch startTime;
private static TimeSpan previousElapsed;
private static Rectangle area;
private static Bitmap companionCube;
public static void Toggle()
{
if (!IsActive)
{
Start();
}
else
{
Stop();
}
}
public static void Start()
{
if (!IsActive)
{
IsActive = true;
companionCube = Resources.CompanionCube;
if (cubesForm != null) cubesForm.Close();
cubesForm = new CompanionCubesForm();
cubesForm.MouseClick += CubesForm_MouseClick;
cubesForm.Show();
area = new Rectangle(0, 0, cubesForm.Width, cubesForm.Height);
Cubes = new List<CompanionCube>(CubeCount);
for (int i = 0; i < CubeCount; i++)
{
CompanionCube cube = new CompanionCube(MathHelpers.Random(50, 100), MathHelpers.Random(250, 500));
cube.Location = new Point(MathHelpers.Random(area.X, area.X + area.Width - cube.Size.Width),
MathHelpers.Random(area.Y - cube.Size.Height - 500, area.Y - cube.Size.Height));
Cubes.Add(cube);
}
previousElapsed = TimeSpan.Zero;
startTime = Stopwatch.StartNew();
timer = new Timer();
timer.Interval = 20;
timer.Tick += Timer_Tick;
timer.Start();
}
}
private static void CubesForm_MouseClick(object sender, MouseEventArgs e)
{
foreach (CompanionCube cube in Cubes.Where(x => x.Rectangle.Contains(e.Location)))
{
cube.IsActive = false;
}
}
public static void Stop()
{
if (IsActive)
{
if (timer != null)
{
timer.Dispose();
timer = null;
}
if (cubesForm != null)
{
cubesForm.Close();
cubesForm = null;
}
if (companionCube != null)
{
companionCube.Dispose();
companionCube = null;
}
if (Cubes != null)
{
Cubes.Clear();
Cubes = null;
}
IsActive = false;
}
}
private static void Timer_Tick(object sender, EventArgs e)
{
TimeSpan elapsed = startTime.Elapsed - previousElapsed;
previousElapsed = startTime.Elapsed;
IEnumerable<CompanionCube> cubes = Cubes.Where(x => x.IsActive).OrderBy(x => x.Rectangle.Bottom);
foreach (CompanionCube cube in cubes)
{
int velocityY = (int)(cube.Speed * elapsed.TotalSeconds);
Point newLocation = new Point(cube.Location.X, cube.Location.Y + velocityY);
Rectangle newRectangle = new Rectangle(newLocation, cube.Size);
bool intersect = false;
foreach (CompanionCube cube2 in cubes)
{
if (cube != cube2 && (newRectangle.IntersectsWith(cube2.Rectangle) || cube.Rectangle.IntersectsWith(cube2.Rectangle)))
{
intersect = true;
newLocation = new Point(cube.Location.X, cube2.Location.Y - cube.Size.Height);
break;
}
}
if (!intersect && newLocation.Y + cube.Size.Height > area.Y + area.Height)
{
newLocation = new Point(cube.Location.X, area.Height - cube.Size.Height);
}
cube.Location = newLocation;
}
DrawCubes();
}
private static void DrawCubes()
{
using (Bitmap surface = new Bitmap(area.Width, area.Height))
using (Graphics g = Graphics.FromImage(surface))
{
foreach (CompanionCube cube in Cubes)
{
if (cube.IsActive && area.IntersectsWith(cube.Rectangle))
{
g.DrawImage(companionCube, new Rectangle(cube.Location, cube.Size));
}
}
cubesForm.SelectBitmap(surface);
}
}
}
}

View file

@ -193,7 +193,6 @@ private void InitializeComponent()
this.Controls.Add(this.cLogo);
this.MaximizeBox = false;
this.Name = "AboutForm";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.AboutForm_FormClosed);
this.Shown += new System.EventHandler(this.AboutForm_Shown);
((System.ComponentModel.ISupportInitialize)(this.pbMikeURL)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbAU)).EndInit();

View file

@ -158,11 +158,6 @@ private void rtb_LinkClicked(object sender, LinkClickedEventArgs e)
URLHelpers.OpenURL(e.LinkText);
}
private void AboutForm_FormClosed(object sender, FormClosedEventArgs e)
{
CompanionCubeManager.Stop();
}
#region Animation
private const int w = 200;
@ -245,20 +240,6 @@ private void cLogo_Draw(Graphics g)
private void cLogo_MouseDown(object sender, MouseEventArgs e)
{
#if STEAM
if (e.Button == MouseButtons.Middle)
{
cLogo.Stop();
CompanionCubeManager.Toggle();
return;
}
if (CompanionCubeManager.IsActive)
{
CompanionCubeManager.Stop();
}
#endif
if (!isEasterEggStarted)
{
isPaused = !isPaused;

View file

@ -212,7 +212,7 @@
</data>
<data name="rtbCredits.Text" xml:space="preserve">
<value />
<comment>@Invariant</comment></data>
</data>
<data name="rtbCredits.WordWrap" type="System.Boolean, mscorlib">
<value>False</value>
</data>
@ -239,7 +239,7 @@
</data>
<data name="rtbShareXInfo.Text" xml:space="preserve">
<value />
<comment>@Invariant</comment></data>
</data>
<data name="&gt;&gt;rtbShareXInfo.Name" xml:space="preserve">
<value>rtbShareXInfo</value>
</data>

View file

@ -1,46 +0,0 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright (c) 2007-2016 ShareX Team
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Optionally you can also view the license at <http://www.gnu.org/licenses/>.
*/
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using System;
using System.Windows.Forms;
namespace ShareX
{
public class CompanionCubesForm : LayeredForm
{
public CompanionCubesForm()
{
StartPosition = FormStartPosition.Manual;
Bounds = CaptureHelpers.GetScreenWorkingArea();
Shown += CompanionCubesForm_Shown;
}
private void CompanionCubesForm_Shown(object sender, EventArgs e)
{
this.ShowActivate();
}
}
}

View file

@ -35,6 +35,7 @@ private void InitializeComponent()
this.btnRemove = new System.Windows.Forms.Button();
this.btnReset = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lvPresets
@ -53,7 +54,7 @@ private void InitializeComponent()
this.lvPresets.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
this.lvPresets.Location = new System.Drawing.Point(8, 8);
this.lvPresets.Name = "lvPresets";
this.lvPresets.Size = new System.Drawing.Size(448, 352);
this.lvPresets.Size = new System.Drawing.Size(448, 328);
this.lvPresets.TabIndex = 0;
this.lvPresets.UseCompatibleStateImageBehavior = false;
this.lvPresets.View = System.Windows.Forms.View.Details;
@ -98,6 +99,7 @@ private void InitializeComponent()
//
// btnReset
//
this.btnReset.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnReset.Location = new System.Drawing.Point(272, 400);
this.btnReset.Name = "btnReset";
this.btnReset.Size = new System.Drawing.Size(184, 23);
@ -108,6 +110,7 @@ private void InitializeComponent()
//
// btnClose
//
this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnClose.Location = new System.Drawing.Point(8, 400);
this.btnClose.Name = "btnClose";
this.btnClose.Size = new System.Drawing.Size(256, 23);
@ -116,21 +119,32 @@ private void InitializeComponent()
this.btnClose.UseVisualStyleBackColor = true;
this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
//
// QuickTaskPresetsEditorForm
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(8, 344);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(341, 13);
this.label1.TabIndex = 6;
this.label1.Text = "Tip: If you add empty task it will be converted to separator line in menu.";
//
// QuickTaskMenuEditorForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(464, 432);
this.Controls.Add(this.label1);
this.Controls.Add(this.btnClose);
this.Controls.Add(this.btnReset);
this.Controls.Add(this.btnRemove);
this.Controls.Add(this.btnEdit);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.lvPresets);
this.Name = "QuickTaskPresetsEditorForm";
this.Name = "QuickTaskMenuEditorForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ShareX - Quick task menu editor";
this.ResumeLayout(false);
this.PerformLayout();
}
@ -143,5 +157,6 @@ private void InitializeComponent()
private System.Windows.Forms.Button btnRemove;
private System.Windows.Forms.Button btnReset;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.Label label1;
}
}

View file

@ -551,16 +551,6 @@ public static System.Drawing.Bitmap color {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap CompanionCube {
get {
object obj = ResourceManager.GetObject("CompanionCube", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -916,16 +906,6 @@ public static System.Drawing.Bitmap globe_share {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap google_plus {
get {
object obj = ResourceManager.GetObject("google_plus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View file

@ -160,9 +160,6 @@ Press 'No' to cancel the current upload and disable screenshot auto uploading.</
<data name="bin" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="google_plus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\google_plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="toolbox" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\toolbox.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -696,9 +693,6 @@ Would you like to restart ShareX?</value>
<data name="es" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\es.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CompanionCube" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\CompanionCube.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layer_shape_polygon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-polygon.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>

View file

@ -45,14 +45,17 @@ public bool IsValid
}
}
public static List<QuickTaskInfo> DefaultPresets = new List<QuickTaskInfo>()
public static List<QuickTaskInfo> DefaultPresets { get; } = new List<QuickTaskInfo>()
{
new QuickTaskInfo("Save, upload & copy URL", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard),
new QuickTaskInfo("Save & copy image", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.CopyImageToClipboard),
new QuickTaskInfo("Annotate, save, upload & copy URL", AfterCaptureTasks.AnnotateImage | AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard),
new QuickTaskInfo("Save, Upload, Copy URL", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard),
new QuickTaskInfo("Save, Copy image", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.CopyImageToClipboard),
new QuickTaskInfo("Save, Copy image file", AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.CopyFileToClipboard),
new QuickTaskInfo("Annotate, Save, Upload, Copy URL", AfterCaptureTasks.AnnotateImage | AfterCaptureTasks.SaveImageToFile | AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard),
new QuickTaskInfo(),
new QuickTaskInfo("Upload, Copy URL", AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard),
new QuickTaskInfo("Save", AfterCaptureTasks.SaveImageToFile),
new QuickTaskInfo("Copy image", AfterCaptureTasks.CopyImageToClipboard),
new QuickTaskInfo("Upload & copy URL", AfterCaptureTasks.UploadImageToHost, AfterUploadTasks.CopyURLToClipboard)
new QuickTaskInfo("Annotate", AfterCaptureTasks.AnnotateImage)
};
public QuickTaskInfo()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -97,8 +97,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CompanionCube.cs" />
<Compile Include="CompanionCubeManager.cs" />
<Compile Include="Controls\BeforeUploadControl.cs">
<SubType>UserControl</SubType>
</Compile>
@ -123,9 +121,6 @@
<Compile Include="Forms\ClipboardFormatForm.Designer.cs">
<DependentUpon>ClipboardFormatForm.cs</DependentUpon>
</Compile>
<Compile Include="Forms\CompanionCubesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\EncoderProgramForm.cs">
<SubType>Form</SubType>
</Compile>
@ -1227,7 +1222,6 @@
<None Include="Resources\crown.png" />
<None Include="Resources\layer--pencil.png" />
<None Include="Resources\globe-share.png" />
<None Include="Resources\google_plus.png" />
<None Include="Resources\document-copy.png" />
<None Include="Resources\image--pencil.png" />
<None Include="Resources\exclamation-button.png" />
@ -1263,7 +1257,6 @@
<None Include="Resources\cross.png" />
<None Include="Resources\arrow-270.png" />
<None Include="Resources\ru.png" />
<None Include="Resources\CompanionCube.png" />
<None Include="Resources\ui-scroll-pane-image.png" />
<None Include="Resources\document-break.png" />
<None Include="Resources\vn.png" />