Skip to content

Commit

Permalink
Ready for first release!
Browse files Browse the repository at this point in the history
Some more notifications to help players.
Help window not finished.
Disabled panel animation on packBlock.
Ready for real world testing!
  • Loading branch information
serialtasted committed Oct 12, 2018
1 parent fcfa0c1 commit 60cf504
Show file tree
Hide file tree
Showing 10 changed files with 2,554 additions and 2,489 deletions.
2 changes: 1 addition & 1 deletion App.config
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<value />
</setting>
<setting name="firstLaunch" serializeAs="String">
<value>False</value>
<value>True</value>
</setting>
<setting name="UpdateSettings" serializeAs="String">
<value>True</value>
Expand Down
10 changes: 5 additions & 5 deletions Controls/PackBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public partial class PackBlock : UserControl
private List<string> addonsName = new List<string>();
private bool isOptionalAllowed = false;

private PanelIO moreInfoPanelIO;
//private PanelIO moreInfoPanelIO;
private PanelIO packInfoPanelIO;

private Fonts customFont = new Fonts();
Expand Down Expand Up @@ -66,7 +66,7 @@ private void setPanelWidth(Panel control, int width)
public async void fadeIn()
{
while (GlobalVar.isAnimating)
await taskDelay(100);
await taskDelay(200);

await taskDelay(rnd.Next(350, 700));
effectIn.Interval = 7;
Expand Down Expand Up @@ -110,7 +110,7 @@ private void EffectIn_Tick(object sender, EventArgs e)
}
}

this.moreInfoPanelIO.ShowPanelSingle();
//this.moreInfoPanelIO.ShowPanelSingle();
}
}

Expand All @@ -129,7 +129,7 @@ public PackBlock(MainForm2 mainForm, string packTitle, string packID, string pac

this.flowpanel_packContent.Controls.Clear();

this.moreInfoPanelIO = new PanelIO(panel_moreInfo, 120, 33);
//this.moreInfoPanelIO = new PanelIO(panel_moreInfo, 120, 33);
this.packInfoPanelIO = new PanelIO(panel_packInfo, 410, 33);

this.packsPan = packsPanel;
Expand Down Expand Up @@ -337,7 +337,7 @@ private void btn_playTop_Click(object sender, EventArgs e)

private void playAction()
{
Properties.Settings.Default.lastAddonPack = packID;
Properties.Settings.Default.lastAddonPack = packID + "*" + txt_title.Text;
Properties.Settings.Default.Save();
this.mainForm.LaunchGame(false);
}
Expand Down
4,756 changes: 2,389 additions & 2,367 deletions MainForm2.Designer.cs

Large diffs are not rendered by default.

53 changes: 48 additions & 5 deletions MainForm2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public partial class MainForm2 : Form
private bool hasShown = false;
private bool sideMenuOpen = false;

// MaterialSkin Colors
Primary primeColor = Primary.LightGreen700;
Primary darkThemeColor = Primary.LightGreen800;
Primary lightThemeColor = Primary.LightGreen500;
Accent accentColor = Accent.Lime700;

// Move window stuff
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HT_CAPTION = 0x2;
Expand All @@ -95,7 +101,7 @@ public MainForm2()

// Init Material Skin Properties
MaterialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
MaterialSkinManager.ColorScheme = new ColorScheme(Primary.LightGreen700, Primary.LightGreen800, Primary.LightGreen500, Accent.Lime700, TextShade.WHITE);
MaterialSkinManager.ColorScheme = new ColorScheme(primeColor, darkThemeColor, lightThemeColor, accentColor, TextShade.WHITE);

// Init Components
InitializeComponent();
Expand Down Expand Up @@ -275,7 +281,7 @@ private void MainForm2_Activated(object sender, EventArgs e)
{
// Re-apply Material Skin Properties
MaterialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
MaterialSkinManager.ColorScheme = new ColorScheme(Primary.LightGreen700, Primary.LightGreen800, Primary.LightGreen500, Accent.Lime700, TextShade.WHITE);
MaterialSkinManager.ColorScheme = new ColorScheme(primeColor, darkThemeColor, lightThemeColor, accentColor, TextShade.WHITE);
}

private void MainForm2_Shown(object sender, EventArgs e)
Expand Down Expand Up @@ -384,10 +390,13 @@ private void MainForm2_Load(object sender, EventArgs e)
}
else if (Properties.Settings.Default.firstLaunch)
{
Properties.Settings.Default.firstLaunch = false;
if (GlobalVar.isServer) { chb_pref_startGame.Checked = true; }

GlobalVar.menuSelected = 3;
HideUnhide(GlobalVar.menuSelected);

new Windows.MessageBox().Show("Welcome!\nYou must setup the necessary directories before continuing.", "First Launch", MessageBoxButtons.OK, MessageIcon.Exclamation);
}
else if (Properties.Settings.Default.Arma3Folder.Equals(string.Empty) ||
Properties.Settings.Default.AddonsFolder.Equals(string.Empty) ||
Expand All @@ -398,6 +407,8 @@ private void MainForm2_Load(object sender, EventArgs e)
{
GlobalVar.menuSelected = 3;
HideUnhide(GlobalVar.menuSelected);

new Windows.MessageBox().Show("You are missing some important directories!\nPlease fix it before continuing.", "Missing directories", MessageBoxButtons.OK, MessageIcon.Stop);
}
else
{
Expand Down Expand Up @@ -1163,7 +1174,7 @@ public void FetchRemoteSettings(bool refreshPacks, bool isAutoRun)
if (isAutoRun)
packID = (string)cb_serverPack.SelectedItem;
else
packID = Properties.Settings.Default.lastAddonPack;
packID = Properties.Settings.Default.lastAddonPack.Split('*')[0];

XmlDocument RemoteXmlInfo = new XmlDocument();
RemoteXmlInfo.Load(Properties.GlobalValues.S_VersionXML);
Expand Down Expand Up @@ -1291,14 +1302,17 @@ public async void LaunchGame(bool isAutoRun)
Arguments = PrepareLaunch.GetArguments();
SaveSettings();

while (GlobalVar.isReadingRepo)
await taskDelay(500);

if (packID == "arma3" || GlobalVar.repoChecked)
{
hideDownloadPanel();
await taskDelay(800);
showSnackBar("Launching " + Properties.Settings.Default.lastAddonPack.Split('*')[1] + "...", 2000, true, true, Primary.LightGreen800);
await taskDelay(2000);

PrepareLaunch.LaunchGame(
Arguments,
txt_progressStatus,
flowpanel_addonPacks,
remoteReader.ServerInfo(),
remoteReader.TeamSpeakInfo(),
Expand Down Expand Up @@ -1486,10 +1500,39 @@ private async void btn_openArmaholic_Click(object sender, EventArgs e)

private async void btn_reinstallTFRPlugins_Click(object sender, EventArgs e)
{
showSnackBar("Task Force Radio plugin installation...", 2500, true, true, Primary.LightGreen800);
await taskDelay(1500);
installer.installTeamSpeakPlugin();
}

public void showSnackBar(string Message, int Delay, bool Primary)
{
snackbar_mainWindow.Text = Message;
snackbar_mainWindow.Primary = Primary;
snackbar_mainWindow.ShowSnackbar(Delay);
}

public void showSnackBar (string Message, int Delay, bool Primary, bool SetCustomColor, Primary Color)
{
snackbar_mainWindow.Text = Message;
snackbar_mainWindow.Primary = Primary;

if(SetCustomColor)
MaterialSkinManager.ColorScheme = new ColorScheme(Color, darkThemeColor, lightThemeColor, accentColor, TextShade.WHITE);

snackbar_mainWindow.ShowSnackbar(Delay);
}

public void showSnackBar(string Message, bool Button, string ButtonText)
{
snackbar_mainWindow.Text = Message;
snackbar_mainWindow.Primary = false;
snackbar_mainWindow.ShowButton = true;
snackbar_mainWindow.ButtonText = ButtonText;

snackbar_mainWindow.ShowSnackbar();
}

public void updateCurrentPack(bool refreshPacks, bool revealPacks)
{ FetchRemoteSettings(refreshPacks, false); GetWorkshopAddons(); GetOptionalAddons(); if (revealPacks) { fetchAddonPacks.RevealPacks(flowpanel_addonPacks); } }

Expand Down
Loading

0 comments on commit 60cf504

Please sign in to comment.