mirror of
https://github.com/HistacomUnity/Histacom2-old.git
synced 2025-01-22 09:02:01 -05:00
winxp template needs fixing
This commit is contained in:
parent
a9fc08f91f
commit
5e91513731
3 changed files with 64 additions and 9 deletions
|
@ -16,6 +16,7 @@ public partial class WinXP : Form
|
||||||
public WinXP()
|
public WinXP()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
DoubleBuffered = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void WinXP_Load(object sender, EventArgs e)
|
private void WinXP_Load(object sender, EventArgs e)
|
||||||
|
|
|
@ -36,11 +36,6 @@ public WinClassic Init(UserControl content, string title, Image icon, bool MaxBu
|
||||||
app = new WinClassic();
|
app = new WinClassic();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "XP":
|
|
||||||
{
|
|
||||||
// app = new WinXP();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
app = new WinClassic();
|
app = new WinClassic();
|
||||||
|
@ -111,9 +106,69 @@ public WinClassic Init(UserControl content, string title, Image icon, bool MaxBu
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A THING TM
|
public WinXP InitXP(UserControl content, string title, Image icon, bool MaxButton, bool MinButton, bool ShowApplicationAsDialog = false, bool resize = true)
|
||||||
|
{
|
||||||
|
WinXP app = new WinXP();
|
||||||
|
|
||||||
|
app.Text = title;
|
||||||
|
app.programname.Text = title;
|
||||||
|
app.Width = content.Width + 8;
|
||||||
|
app.Height = content.Height + 26;
|
||||||
|
// Initialize Font
|
||||||
|
pfc.AddFontFile(SaveSystem.GameDirectory + "\\Data\\LeviWindows.ttf");
|
||||||
|
Font fnt = new Font(pfc.Families[0], 16F, FontStyle.Regular, GraphicsUnit.Point, ((0)));
|
||||||
|
app.fnt = fnt;
|
||||||
|
app.Title.Font = new Font(pfc.Families[0], 16F, FontStyle.Bold, GraphicsUnit.Point, ((0)));
|
||||||
|
// Setup UC
|
||||||
|
content.Parent = app.programContent;
|
||||||
|
content.BringToFront();
|
||||||
|
content.Dock = DockStyle.Fill;
|
||||||
|
app.progContent = content;
|
||||||
|
|
||||||
// A THING TM
|
// Check if icon is null
|
||||||
|
if (icon == null)
|
||||||
|
{
|
||||||
|
app.programIcon.Hide();
|
||||||
|
app.programIcon.Image = Engine.Properties.Resources.nullIcon;
|
||||||
|
app.programname.Location = new Point(2, 1);
|
||||||
|
}
|
||||||
|
else app.programIcon.Image = icon;
|
||||||
|
|
||||||
|
// Check if Max button is enabled and set proper X for Min button
|
||||||
|
if (MaxButton == false)
|
||||||
|
{
|
||||||
|
app.maximizebutton.Visible = false;
|
||||||
|
app.minimizebutton.Location = new Point(app.closebutton.Location.X - 14, app.minimizebutton.Location.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if Min button is enabled
|
||||||
|
if (MinButton == false)
|
||||||
|
{
|
||||||
|
app.minimizebutton.Visible = false;
|
||||||
|
app.minimizebutton.Location = new Point(app.minimizebutton.Location.X, app.minimizebutton.Location.Y);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Resize
|
||||||
|
app.resizable = resize;
|
||||||
|
|
||||||
|
// Convert an image to an icon (for the taskbar)
|
||||||
|
if (icon != null)
|
||||||
|
{
|
||||||
|
Bitmap theBitmap = new Bitmap(icon, new Size(icon.Width, icon.Height));
|
||||||
|
IntPtr Hicon = theBitmap.GetHicon(); // Get an Hicon for myBitmap.
|
||||||
|
Icon newIcon = Icon.FromHandle(Hicon); // Create a new icon from the handle.
|
||||||
|
app.Icon = newIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set some values (for the taskbar)
|
||||||
|
app.Tag = TaskBarController.AvalibleApplicationID;
|
||||||
|
app.Text = title;
|
||||||
|
|
||||||
|
// Show the app
|
||||||
|
app.TopMost = true;
|
||||||
|
if (ShowApplicationAsDialog == false) { app.Show(); } else { app.ShowDialog(); }
|
||||||
|
return app;
|
||||||
|
}
|
||||||
|
|
||||||
public WinClassic StartInfobox95(string title, string text, InfoboxType type, InfoboxButtons btns)
|
public WinClassic StartInfobox95(string title, string text, InfoboxType type, InfoboxButtons btns)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,8 +15,7 @@ public class Hack4 : object
|
||||||
public static async void StartObjective()
|
public static async void StartObjective()
|
||||||
{
|
{
|
||||||
Win95.Win95Apps.WinClassicTerminal Console = new Win95.Win95Apps.WinClassicTerminal(true);
|
Win95.Win95Apps.WinClassicTerminal Console = new Win95.Win95Apps.WinClassicTerminal(true);
|
||||||
Random r = new Random();
|
WinXP app = wm.InitXP(Console, "MS-DOS Prompt", null, true, true);
|
||||||
WinClassic app = wm.Init(Console, "MS-DOS Prompt", null, true, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue