mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Add ability to import flag JSON from file (#1092)
This commit is contained in:
parent
2cc2373830
commit
25866849c0
18
Bloxstrap/Resources/Strings.Designer.cs
generated
18
Bloxstrap/Resources/Strings.Designer.cs
generated
@ -368,6 +368,15 @@ namespace Bloxstrap.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Import from file.
|
||||||
|
/// </summary>
|
||||||
|
public static string Common_ImportFromFile {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Common.ImportFromFile", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Import JSON.
|
/// Looks up a localized string similar to Import JSON.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -1242,6 +1251,15 @@ namespace Bloxstrap.Resources {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to JSON files.
|
||||||
|
/// </summary>
|
||||||
|
public static string FileTypes_JSONFiles {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("FileTypes.JSONFiles", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Bloxstrap has detected a drive letter change and has reconfigured its install location from the {0} drive to the {1} drive.
|
/// Looks up a localized string similar to Bloxstrap has detected a drive letter change and has reconfigured its install location from the {0} drive to the {1} drive.
|
||||||
///
|
///
|
||||||
|
@ -1066,4 +1066,10 @@ Selecting 'No' will ignore this warning and continue installation.</value>
|
|||||||
<data name="Dialog.Connectivity.UnableToDownloadReason" xml:space="preserve">
|
<data name="Dialog.Connectivity.UnableToDownloadReason" xml:space="preserve">
|
||||||
<value>Roblox cannot be downloaded at this time. Please read the following help page for more information: {0}</value>
|
<value>Roblox cannot be downloaded at this time. Please read the following help page for more information: {0}</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Common.ImportFromFile" xml:space="preserve">
|
||||||
|
<value>Import from file</value>
|
||||||
|
</data>
|
||||||
|
<data name="FileTypes.JSONFiles" xml:space="preserve">
|
||||||
|
<value>JSON files</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
@ -50,8 +50,12 @@
|
|||||||
</TabItem>
|
</TabItem>
|
||||||
<TabItem Header="{x:Static resources:Strings.Common_ImportJson}">
|
<TabItem Header="{x:Static resources:Strings.Common_ImportJson}">
|
||||||
<Grid Margin="11">
|
<Grid Margin="11">
|
||||||
<TextBox x:Name="JsonTextBox" Margin="5" AcceptsTab="True" AcceptsReturn="True" MinHeight="80" MaxHeight="480" />
|
<Grid.RowDefinitions>
|
||||||
<TextBlock IsHitTestVisible="False" Margin="18,14,0,0" Foreground="DarkGray" Text="{}{ "FFlagDebugDisplayFPS": "True" }">
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBox Grid.Row="0" x:Name="JsonTextBox" Margin="5" AcceptsTab="True" AcceptsReturn="True" MinHeight="80" MaxHeight="480" />
|
||||||
|
<TextBlock Grid.Row="0" IsHitTestVisible="False" Margin="18,14,0,0" Foreground="DarkGray" Text="{}{ "FFlagDebugDisplayFPS": "True" }">
|
||||||
<TextBlock.Style>
|
<TextBlock.Style>
|
||||||
<Style TargetType="{x:Type TextBlock}">
|
<Style TargetType="{x:Type TextBlock}">
|
||||||
<Setter Property="Visibility" Value="Collapsed"/>
|
<Setter Property="Visibility" Value="Collapsed"/>
|
||||||
@ -63,6 +67,7 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</TextBlock.Style>
|
</TextBlock.Style>
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
<ui:Button Grid.Row="1" Margin="4" Icon="DocumentArrowUp16" Content="{x:Static resources:Strings.Common_ImportFromFile}" HorizontalAlignment="Stretch" Click="ImportButton_Click" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
using System;
|
using Microsoft.Win32;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using Bloxstrap.Resources;
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Bloxstrap.UI.Elements.Dialogs
|
namespace Bloxstrap.UI.Elements.Dialogs
|
||||||
{
|
{
|
||||||
@ -26,6 +16,19 @@ namespace Bloxstrap.UI.Elements.Dialogs
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ImportButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
var dialog = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Filter = $"{Strings.FileTypes_JSONFiles}|*.json"
|
||||||
|
};
|
||||||
|
|
||||||
|
if (dialog.ShowDialog() != true)
|
||||||
|
return;
|
||||||
|
|
||||||
|
JsonTextBox.Text = File.ReadAllText(dialog.FileName);
|
||||||
|
}
|
||||||
|
|
||||||
private void OKButton_Click(object sender, RoutedEventArgs e)
|
private void OKButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Result = MessageBoxResult.OK;
|
Result = MessageBoxResult.OK;
|
||||||
|
@ -580,6 +580,7 @@
|
|||||||
<controls:MarkdownTextBlock MarkdownText="[CfwSky](https://www.roblox.com/users/129425241/profile)" />
|
<controls:MarkdownTextBlock MarkdownText="[CfwSky](https://www.roblox.com/users/129425241/profile)" />
|
||||||
<controls:MarkdownTextBlock MarkdownText="[ruubloo](https://www.roblox.com/users/158082266/profile)" />
|
<controls:MarkdownTextBlock MarkdownText="[ruubloo](https://www.roblox.com/users/158082266/profile)" />
|
||||||
<controls:MarkdownTextBlock MarkdownText="[toyoda165](https://www.roblox.com/users/923416649/profile)" />
|
<controls:MarkdownTextBlock MarkdownText="[toyoda165](https://www.roblox.com/users/923416649/profile)" />
|
||||||
|
<controls:MarkdownTextBlock MarkdownText="[ShadowCodeX](https://github.com/ShadowCodeX-debug)" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</controls:Expander>
|
</controls:Expander>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user