Improved Layout in SettingsPage.cs (#1137)

* Modified SettingsPage.cs for improved layout

* Use Bootstrap classes

* Form-group

---------

Co-authored-by: Jeremy Pritts <49847914+ds5678@users.noreply.github.com>
This commit is contained in:
TridleGames 2023-12-24 01:06:49 +01:00 committed by GitHub
parent 896d4feba0
commit 3b44aaa974
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 123 additions and 23 deletions

View File

@ -10,9 +10,9 @@ public sealed class IndexPage : DefaultPage
public override void WriteInnerContent(TextWriter writer)
{
using (new Div(writer).WithClass("text-center").End())
using (new Div(writer).WithClass("text-center container mt-5").End())
{
new H1(writer).WithClass("display-4").Close(Localization.Welcome);
new H1(writer).WithClass("display-4 mb-4").Close(Localization.Welcome);
if (GameFileLoader.IsLoaded)
{
PathLinking.WriteLink(writer, GameFileLoader.GameBundle, Localization.ViewLoadedFiles, "btn btn-success");
@ -27,10 +27,8 @@ public sealed class IndexPage : DefaultPage
}
else
{
new Br(writer).Close();
new Br(writer).Close();
new P(writer).Close(Localization.DonationMessage);
using (new Div(writer).End())
new P(writer).WithClass("mt-4").Close(Localization.DonationMessage);
using (new Div(writer).WithClass("d-flex justify-content-center mt-3").End())
{
new A(writer).WithClass("btn btn-primary m-1").WithNewTabAttributes().WithHref("https://patreon.com/ds5678").Close("Patreon");
new A(writer).WithClass("btn btn-primary m-1").WithNewTabAttributes().WithHref("https://paypal.me/ds5678").Close("Paypal");

View File

@ -16,7 +16,7 @@ public sealed partial class SettingsPage : DefaultPage
public override void WriteInnerContent(TextWriter writer)
{
new H1(writer).Close(Localization.ConfigOptions);
new H1(writer).WithClass("text-center").Close(Localization.ConfigOptions);
if (GameFileLoader.IsLoaded)
{
using (new Div(writer).WithClass("text-center").End())
@ -28,24 +28,126 @@ public sealed partial class SettingsPage : DefaultPage
{
using (new Form(writer).WithAction("/Settings/Update").WithMethod("post").End())
{
WriteCheckBoxForEnablePrefabOutlining(writer, Localization.EnablePrefabOutlining);
WriteCheckBoxForIgnoreStreamingAssets(writer, Localization.SkipStreamingAssets);
WriteCheckBoxForIgnoreEngineAssets(writer, Localization.IgnoreEngineAssets);
WriteTextAreaForDefaultVersion(writer);
WriteDropDownForAudioExportFormat(writer);
WriteDropDownForBundledAssetsExportMode(writer);
WriteDropDownForImageExportFormat(writer);
WriteDropDownForMeshExportFormat(writer);
WriteDropDownForSpriteExportMode(writer);
WriteDropDownForTerrainExportMode(writer);
WriteDropDownForTextExportMode(writer);
WriteDropDownForShaderExportMode(writer);
WriteDropDownForScriptExportMode(writer);
WriteDropDownForScriptContentLevel(writer);
WriteDropDownForScriptLanguageVersion(writer);
using (new Div(writer).WithClass("form-group").End())
{
new Input(writer).WithClass("btn btn-primary").WithType("submit").WithValue(Localization.Save).Close();
using (new Div(writer).WithClass("border rounded p-3 m-2").End())
{
new H2(writer).Close("Import");
using (new Div(writer).End())
{
using (new Div(writer).WithClass("row").End())
{
using (new Div(writer).WithClass("col").End())
{
WriteCheckBoxForIgnoreStreamingAssets(writer, Localization.SkipStreamingAssets);
}
}
using (new Div(writer).WithClass("row").End())
{
using (new Div(writer).WithClass("col").End())
{
WriteTextAreaForDefaultVersion(writer);
}
}
using (new Div(writer).WithClass("row").End())
{
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForBundledAssetsExportMode(writer);
}
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForScriptContentLevel(writer);
}
}
}
new Hr(writer).Close();
using (new Div(writer).End())
{
new H3(writer).Close("Experimental");
WriteCheckBoxForEnablePrefabOutlining(writer, Localization.EnablePrefabOutlining);
}
}
using (new Div(writer).WithClass("border rounded p-3 m-2").End())
{
new H2(writer).Close(Localization.MenuExport);
using (new Div(writer).End())
{
using (new Div(writer).WithClass("row").End())
{
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForAudioExportFormat(writer);
}
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForImageExportFormat(writer);
}
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForMeshExportFormat(writer);
}
}
using (new Div(writer).WithClass("row").End())
{
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForSpriteExportMode(writer);
}
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForTerrainExportMode(writer);
}
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForTextExportMode(writer);
}
}
using (new Div(writer).WithClass("row").End())
{
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForShaderExportMode(writer);
}
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForScriptLanguageVersion(writer);
}
using (new Div(writer).WithClass("col").End())
{
WriteDropDownForScriptExportMode(writer);
}
}
}
new Hr(writer).Close();
using (new Div(writer).End())
{
new H3(writer).Close("Experimental");
WriteCheckBoxForIgnoreEngineAssets(writer,
Localization.IgnoreEngineAssets);
}
}
using (new Div(writer).WithClass("text-center").End())
{
new Input(writer).WithType("submit").WithValue(Localization.Save).Close();
}
}
}
}