From 1fd19f9fac63cd404e4c6c60ebc953c830ad8bc5 Mon Sep 17 00:00:00 2001 From: Jonathan Riedel Date: Wed, 10 May 2023 23:55:22 +0200 Subject: [PATCH] UI things --- .mgstats | 1 + CityGame/CityGame.csproj | 18 +- CityGame/Licenses/SIXLABORS.FONTS-LICENSE.txt | 201 ++++++++++++++++++ CityGame/Program.cs | 14 +- CityGame/Resources/CNRGN Builder.ttf | Bin 0 -> 9232 bytes 5 files changed, 224 insertions(+), 10 deletions(-) create mode 100644 .mgstats create mode 100644 CityGame/Licenses/SIXLABORS.FONTS-LICENSE.txt create mode 100644 CityGame/Resources/CNRGN Builder.ttf diff --git a/.mgstats b/.mgstats new file mode 100644 index 0000000..eab26b3 --- /dev/null +++ b/.mgstats @@ -0,0 +1 @@ +Source File,Dest File,Processor Type,Content Type,Source File Size,Dest File Size,Build Seconds diff --git a/CityGame/CityGame.csproj b/CityGame/CityGame.csproj index 739ee12..088528d 100644 --- a/CityGame/CityGame.csproj +++ b/CityGame/CityGame.csproj @@ -2,11 +2,17 @@ WinExe - net6.0-windows + net7.0-windows enable False + + + + + + @@ -55,6 +61,9 @@ Always + + Always + PreserveNewest @@ -100,6 +109,9 @@ PreserveNewest + + Always + PreserveNewest @@ -159,10 +171,6 @@ - - - - ..\..\..\RE-UI-a-Monogame-GUI\MGUI\bin\Debug\net6.0\MGUI.dll diff --git a/CityGame/Licenses/SIXLABORS.FONTS-LICENSE.txt b/CityGame/Licenses/SIXLABORS.FONTS-LICENSE.txt new file mode 100644 index 0000000..8d5852d --- /dev/null +++ b/CityGame/Licenses/SIXLABORS.FONTS-LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (c) Six Labors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/CityGame/Program.cs b/CityGame/Program.cs index 7e1be47..42df02f 100644 --- a/CityGame/Program.cs +++ b/CityGame/Program.cs @@ -1,26 +1,30 @@ -using Microsoft.Xna.Framework.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using WPFGame; namespace CityGame { public class Program { public static void Main() { - var menu = new MainWindow(); + var menu = new MenuWindow(); } } public class MenuWindow : Window { - private GraphicsDevice graphics; public MenuWindow() { - + UICanvas = new Canvas(); + UICanvas.Children.Add(new ReflectedUIWindow(new GenerationSettings(), "CNRGN Builder", 24) { Height = 1080, Width = 300 }); Show(); } } public class GenerationSettings { - public int Seed; + [RUITextField(TextColor = 0xFFFF0000, Lines = 2)] + public string WelcomeText { get; set; } = "Welcome!\nTest"; + [RUITextField(TextColor = 0xFF00FF00, Lines = 2)] + public int Seed { get; set; } = 0; public GenerationSettings() { diff --git a/CityGame/Resources/CNRGN Builder.ttf b/CityGame/Resources/CNRGN Builder.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e65937a99fde06fdef48c54c8088da5c7cffd1dd GIT binary patch literal 9232 zcmeHNeQ;dWbwB66{gABH$9g5LEXnI#tv-ysdXjdvk}ZGRU<1a+F^*%{O@lB(@*qn> zk}=LS4g)EPUD9IGCg6|`P!pvsowzOI-JvbGWC9sN3v^maDTUyof+3!iG)_%y?e=%> zdrw-)CMErt{=Irr^b5ff24-AM+GY}~kG%hAQZkBMjuAN89qzhWa@ zM%Q8N!#H&9b#3wCBmK2Rdq@yu0^H zuOE5|^jG5kLwkGg7@_;=9o*Z6ad@bAZ{N@ZJ9>#0-b>_qWMp`3{M5?7>mX`q$NiUY z2Y=7;;-5kup>Mn${NLO2!F?DHV*DtH?x=rx{=FxwSGxG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