From c3a79164a4303ef559612f0aaed7b36ae68428d9 Mon Sep 17 00:00:00 2001 From: Tony Bark <35226681+tonytins@users.noreply.github.com> Date: Mon, 31 May 2021 02:35:52 -0400 Subject: [PATCH 1/3] Changed license to Artistic-2.0 - Updated and simplified license headers. --- LICENSE | 518 ++++++++++------------------- README.md | 8 +- scenes/game.tscn | 32 +- scripts/Character.gd | 2 +- scripts/autoload/game_data.gd | 2 + scripts/autoload/game_events.gd | 2 + scripts/clothing/accessory_base.gd | 2 +- scripts/clothing/bottoms_base.gd | 2 +- scripts/clothing/clothing_base.gd | 2 +- scripts/clothing/tops_base.gd | 2 +- scripts/clothing/undies_base.gd | 2 +- scripts/game.gd | 19 +- scripts/spinner.gd | 2 + scripts/ui.gd | 2 +- scripts/wardrobe.gd | 2 +- 15 files changed, 211 insertions(+), 388 deletions(-) diff --git a/LICENSE b/LICENSE index a612ad9..aa674ff 100644 --- a/LICENSE +++ b/LICENSE @@ -1,373 +1,201 @@ -Mozilla Public License Version 2.0 -================================== + The Artistic License 2.0 -1. Definitions --------------- + Copyright (c) 2000-2006, The Perl Foundation. -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. +Preamble -1.3. "Contribution" - means Covered Software of a particular Contributor. +This license establishes the terms under which a given free software +Package may be copied, modified, distributed, and/or redistributed. +The intent is that the Copyright Holder maintains some artistic +control over the development of that Package while still keeping the +Package available as open source and free software. -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. +You are always permitted to make arrangements wholly outside of this +license directly with the Copyright Holder of a given Package. If the +terms of this license do not permit the full use that you propose to +make of the Package, you should contact the Copyright Holder and seek +a different licensing arrangement. -1.5. "Incompatible With Secondary Licenses" - means +Definitions - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or + "Copyright Holder" means the individual(s) or organization(s) + named in the copyright notice for the entire Package. - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. + "Contributor" means any party that has contributed code or other + material to the Package, in accordance with the Copyright Holder's + procedures. -1.6. "Executable Form" - means any form of the work other than Source Code Form. + "You" and "your" means any person who would like to copy, + distribute, or modify the Package. -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. + "Package" means the collection of files distributed by the + Copyright Holder, and derivatives of that collection and/or of + those files. A given Package may consist of either the Standard + Version, or a Modified Version. -1.8. "License" - means this document. + "Distribute" means providing a copy of the Package or making it + accessible to anyone else, or in the case of a company or + organization, to others outside of your company or organization. -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. + "Distributor Fee" means any fee that you charge for Distributing + this Package or providing support for this Package to another + party. It does not mean licensing fees. -1.10. "Modifications" - means any of the following: + "Standard Version" refers to the Package if it has not been + modified, or has been modified only in ways explicitly requested + by the Copyright Holder. - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or + "Modified Version" means the Package, if it has been changed, and + such changes were not explicitly requested by the Copyright + Holder. - (b) any new file in Source Code Form that contains any Covered - Software. + "Original License" means this Artistic License as Distributed with + the Standard Version of the Package, in its current version or as + it may be modified by The Perl Foundation in the future. -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. + "Source" form means the source code, documentation source, and + configuration files for the Package. -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. + "Compiled" form means the compiled bytecode, object code, binary, + or any other form resulting from mechanical transformation or + translation of the Source form. -1.13. "Source Code Form" - means the form of the work preferred for making modifications. -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. +Permission for Use and Modification Without Distribution -2. License Grants and Conditions --------------------------------- +(1) You are permitted to use the Standard Version and create and use +Modified Versions for any purpose without restriction, provided that +you do not Distribute the Modified Version. -2.1. Grants -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: +Permissions for Redistribution of the Standard Version -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and +(2) You may Distribute verbatim copies of the Source form of the +Standard Version of this Package in any medium without restriction, +either gratis or for a Distributor Fee, provided that you duplicate +all of the original copyright notices and associated disclaimers. At +your discretion, such verbatim copies may or may not include a +Compiled form of the Package. -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. +(3) You may apply any bug fixes, portability changes, and other +modifications made available from the Copyright Holder. The resulting +Package will still be considered the Standard Version, and as such +will be subject to the Original License. -2.2. Effective Date -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. +Distribution of Modified Versions of the Package as Source -2.3. Limitations on Grant Scope +(4) You may Distribute your Modified Version as Source (either gratis +or for a Distributor Fee, and with or without a Compiled form of the +Modified Version) provided that you clearly document how it differs +from the Standard Version, including, but not limited to, documenting +any non-standard features, executables, or modules, and provided that +you do at least ONE of the following: -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. + (a) make the Modified Version available to the Copyright Holder + of the Standard Version, under the Original License, so that the + Copyright Holder may include your modifications in the Standard + Version. + + (b) ensure that installation of your Modified Version does not + prevent the user installing or running the Standard Version. In + addition, the Modified Version must bear a name that is different + from the name of the Standard Version. + + (c) allow anyone who receives a copy of the Modified Version to + make the Source form of the Modified Version available to others + under + + (i) the Original License or + + (ii) a license that permits the licensee to freely copy, + modify and redistribute the Modified Version using the same + licensing terms that apply to the copy that the licensee + received, and requires that the Source form of the Modified + Version, and of any works derived from it, be made freely + available in that license fees are prohibited but Distributor + Fees are allowed. + + +Distribution of Compiled Forms of the Standard Version +or Modified Versions without the Source + +(5) You may Distribute Compiled forms of the Standard Version without +the Source, provided that you include complete instructions on how to +get the Source of the Standard Version. Such instructions must be +valid at the time of your distribution. If these instructions, at any +time while you are carrying out such distribution, become invalid, you +must provide new instructions on demand or cease further distribution. +If you provide valid instructions or cease distribution within thirty +days after you become aware that the instructions are invalid, then +you do not forfeit any of your rights under this license. + +(6) You may Distribute a Modified Version in Compiled form without +the Source, provided that you comply with Section 4 with respect to +the Source of the Modified Version. + + +Aggregating or Linking the Package + +(7) You may aggregate the Package (either the Standard Version or +Modified Version) with other packages and Distribute the resulting +aggregation provided that you do not charge a licensing fee for the +Package. Distributor Fees are permitted, and licensing fees for other +components in the aggregation are permitted. The terms of this license +apply to the use and Distribution of the Standard or Modified Versions +as included in the aggregation. + +(8) You are permitted to link Modified and Standard Versions with +other works, to embed the Package in a larger work of your own, or to +build stand-alone binary or bytecode versions of applications that +include the Package, and Distribute the result without restriction, +provided the result does not expose a direct interface to the Package. + + +Items That are Not Considered Part of a Modified Version + +(9) Works (including, but not limited to, modules and scripts) that +merely extend or make use of the Package, do not, by themselves, cause +the Package to be a Modified Version. In addition, such works are not +considered parts of the Package itself, and are not subject to the +terms of this license. + + +General Provisions + +(10) Any use, modification, and distribution of the Standard or +Modified Versions is governed by this Artistic License. By using, +modifying or distributing the Package, you accept this license. Do not +use, modify, or distribute the Package, if you do not accept this +license. + +(11) If your Modified Version has been derived from a Modified +Version made by someone other than you, you are nevertheless required +to ensure that your Modified Version complies with the requirements of +this license. + +(12) This license does not grant you the right to use any trademark, +service mark, tradename, or logo of the Copyright Holder. + +(13) This license includes the non-exclusive, worldwide, +free-of-charge patent license to make, have made, use, offer to sell, +sell, import and otherwise transfer the Package with respect to any +patent claims licensable by the Copyright Holder that are necessarily +infringed by the Package. If you institute patent litigation +(including a cross-claim or counterclaim) against any party alleging +that the Package constitutes direct or contributory patent +infringement, then this Artistic License to you shall terminate on the +date that such litigation is filed. + +(14) Disclaimer of Warranty: +THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS +IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR +NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL +LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/README.md b/README.md index 514c41f..1d62d06 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,16 @@ ![](screenshot.gif) -​Tony's Dress Up is a re-imagining of my first Flash game, ZC's Dress Up, developed back in 2007. I've included the Flash copies in the ``/archive`` directory. They can be played using [Ruffle](https://ruffle.rs/)'s demo page. +Tony's Dress Up is a re-imagining of my first (and only) Flash game series, ZC's Dress Up , developed back in 2007. Both this and the originals are heavily inspired by The Sims 2: Body Shop in their own unique ways. + +I've included the original Flash releases in the ``/archive`` directory. They can be played using [Ruffle](https://ruffle.rs/)'s demo page. ​ ## Getting Started ### Prerequisites -- Godot Engine 3.2 +- Godot Engine 3.2 LTS or later ## Authors @@ -24,7 +26,7 @@ ## License -The source and assets are licensed under the MPL 2.0 License and CC-BY, respectfully - see the [LICENSE](LICENSE) and [ASSET-LICENSE](ASSET-LICENSE) for more details. +The source and assets are licensed under the Artistic-2.0 License and CC-BY, respectfully - see the [LICENSE](LICENSE) and [ASSET-LICENSE](ASSET-LICENSE) for more details. The Flash games included are closed source, but considered abandonware. Feel free to share them on archives. diff --git a/scenes/game.tscn b/scenes/game.tscn index 34a413c..1bc2e2b 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -39,7 +39,7 @@ position = Vector2( 133.807, 230.615 ) [node name="Controls" type="CanvasLayer" parent="."] -[node name="DressUp" type="Control" parent="Controls"] +[node name="Container" type="Control" parent="Controls"] anchor_right = 1.0 anchor_bottom = 1.0 script = ExtResource( 8 ) @@ -49,14 +49,14 @@ __meta__ = { } version = "1.10" -[node name="wardrobe" parent="Controls/DressUp" instance=ExtResource( 4 )] +[node name="Wardrobe" parent="Controls/Container" instance=ExtResource( 4 )] anchor_left = 0.33875 anchor_top = 0.054 anchor_right = 1.05 anchor_bottom = 0.9 margin_right = 6.10352e-05 -[node name="Spinner" type="TextureRect" parent="Controls/DressUp"] +[node name="Spinner" type="TextureRect" parent="Controls/Container"] visible = false anchor_left = 0.945785 anchor_top = 0.153026 @@ -68,10 +68,10 @@ __meta__ = { "_edit_use_anchors_": true } -[node name="Timer" type="Timer" parent="Controls/DressUp/Spinner"] +[node name="Timer" type="Timer" parent="Controls/Container/Spinner"] wait_time = 2.0 -[node name="CenterBtns" type="CenterContainer" parent="Controls/DressUp"] +[node name="CenterBtns" type="CenterContainer" parent="Controls/Container"] anchor_left = 0.35875 anchor_top = 0.792 anchor_right = 0.99625 @@ -80,29 +80,29 @@ __meta__ = { "_edit_use_anchors_": true } -[node name="ButtonCtr" type="HBoxContainer" parent="Controls/DressUp/CenterBtns"] +[node name="ButtonCtr" type="HBoxContainer" parent="Controls/Container/CenterBtns"] margin_left = 179.0 margin_top = 4.0 margin_right = 330.0 margin_bottom = 42.0 custom_constants/separation = 20 -[node name="SaveBtn" type="Button" parent="Controls/DressUp/CenterBtns/ButtonCtr"] +[node name="ExportBtn" type="Button" parent="Controls/Container/CenterBtns/ButtonCtr"] margin_right = 37.0 margin_bottom = 38.0 -hint_tooltip = "Save" +hint_tooltip = "Export" icon = ExtResource( 7 ) flat = true -[node name="LoadBtn" type="Button" parent="Controls/DressUp/CenterBtns/ButtonCtr"] +[node name="ImportBtn" type="Button" parent="Controls/Container/CenterBtns/ButtonCtr"] margin_left = 57.0 margin_right = 94.0 margin_bottom = 38.0 -hint_tooltip = "Load" +hint_tooltip = "Import" icon = ExtResource( 9 ) flat = true -[node name="clearBtn" type="Button" parent="Controls/DressUp/CenterBtns/ButtonCtr"] +[node name="ClearBtn" type="Button" parent="Controls/Container/CenterBtns/ButtonCtr"] margin_left = 114.0 margin_right = 151.0 margin_bottom = 38.0 @@ -110,7 +110,7 @@ hint_tooltip = "Clear" icon = ExtResource( 3 ) flat = true -[node name="versionLbl" type="Label" parent="Controls/DressUp"] +[node name="versionLbl" type="Label" parent="Controls/Container"] anchor_left = 0.88125 anchor_top = 0.944 anchor_right = 0.9825 @@ -122,7 +122,7 @@ __meta__ = { "_edit_use_anchors_": true } -[connection signal="timeout" from="Controls/DressUp/Spinner/Timer" to="Controls/DressUp/Spinner" method="_on_Timer_timeout"] -[connection signal="pressed" from="Controls/DressUp/CenterBtns/ButtonCtr/SaveBtn" to="characterBase" method="_on_SaveBtn_pressed"] -[connection signal="pressed" from="Controls/DressUp/CenterBtns/ButtonCtr/LoadBtn" to="characterBase" method="_on_LoadBtn_pressed"] -[connection signal="pressed" from="Controls/DressUp/CenterBtns/ButtonCtr/clearBtn" to="characterBase" method="_on_clearBtn_pressed"] +[connection signal="timeout" from="Controls/Container/Spinner/Timer" to="Controls/Container/Spinner" method="_on_Timer_timeout"] +[connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ExportBtn" to="characterBase" method="_on_SaveBtn_pressed"] +[connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ImportBtn" to="characterBase" method="_on_LoadBtn_pressed"] +[connection signal="pressed" from="Controls/Container/CenterBtns/ButtonCtr/ClearBtn" to="characterBase" method="_on_clearBtn_pressed"] diff --git a/scripts/Character.gd b/scripts/Character.gd index 7f1f8e0..d3d2111 100644 --- a/scripts/Character.gd +++ b/scripts/Character.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends Resource diff --git a/scripts/autoload/game_data.gd b/scripts/autoload/game_data.gd index aa3ca29..50cb78d 100644 --- a/scripts/autoload/game_data.gd +++ b/scripts/autoload/game_data.gd @@ -1,3 +1,5 @@ +# This project is licensed under the Artistic-2.0 license. +# See the LICENSE file in the project root for more information. extends Node var version = "0.0.0" diff --git a/scripts/autoload/game_events.gd b/scripts/autoload/game_events.gd index b22164d..205a81c 100644 --- a/scripts/autoload/game_events.gd +++ b/scripts/autoload/game_events.gd @@ -1,3 +1,5 @@ +# This project is licensed under the Artistic-2.0 license. +# See the LICENSE file in the project root for more information. extends Node signal indicate diff --git a/scripts/clothing/accessory_base.gd b/scripts/clothing/accessory_base.gd index ff515fe..ad1030e 100644 --- a/scripts/clothing/accessory_base.gd +++ b/scripts/clothing/accessory_base.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends "res://scripts/clothing/clothing_base.gd" diff --git a/scripts/clothing/bottoms_base.gd b/scripts/clothing/bottoms_base.gd index 387654a..f02bf1f 100644 --- a/scripts/clothing/bottoms_base.gd +++ b/scripts/clothing/bottoms_base.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends "res://scripts/clothing/clothing_base.gd" diff --git a/scripts/clothing/clothing_base.gd b/scripts/clothing/clothing_base.gd index f6c4272..b36190e 100644 --- a/scripts/clothing/clothing_base.gd +++ b/scripts/clothing/clothing_base.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends TextureButton diff --git a/scripts/clothing/tops_base.gd b/scripts/clothing/tops_base.gd index bae9b4f..3848a51 100644 --- a/scripts/clothing/tops_base.gd +++ b/scripts/clothing/tops_base.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends "res://scripts/clothing/clothing_base.gd" diff --git a/scripts/clothing/undies_base.gd b/scripts/clothing/undies_base.gd index 2327ae3..e764089 100644 --- a/scripts/clothing/undies_base.gd +++ b/scripts/clothing/undies_base.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends "res://scripts/clothing/clothing_base.gd" diff --git a/scripts/game.gd b/scripts/game.gd index d144d48..6aea0f7 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -1,16 +1,3 @@ -extends Node2D - - -# Declare member variables here. Examples: -# var a = 2 -# var b = "text" - - -# Called when the node enters the scene tree for the first time. -func _ready(): - pass # Replace with function body. - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -#func _process(delta): -# pass +# This project is licensed under the Artistic-2.0 license. +# See the LICENSE file in the project root for more information. +extends Node2D \ No newline at end of file diff --git a/scripts/spinner.gd b/scripts/spinner.gd index 85da75b..0d450a2 100644 --- a/scripts/spinner.gd +++ b/scripts/spinner.gd @@ -1,3 +1,5 @@ +# This project is licensed under the Artistic-2.0 license. +# See the LICENSE file in the project root for more information. extends TextureRect onready var timer = $Timer diff --git a/scripts/ui.gd b/scripts/ui.gd index 6a1789e..d588ce2 100644 --- a/scripts/ui.gd +++ b/scripts/ui.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends Control diff --git a/scripts/wardrobe.gd b/scripts/wardrobe.gd index 080191b..6490997 100644 --- a/scripts/wardrobe.gd +++ b/scripts/wardrobe.gd @@ -1,4 +1,4 @@ -# This project is licensed under the MPL license. +# This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. extends TabContainer From 230af8d840cd5a03d1968b4af5b0a856e291ac98 Mon Sep 17 00:00:00 2001 From: Tony Bark <35226681+tonytins@users.noreply.github.com> Date: Mon, 31 May 2021 02:37:29 -0400 Subject: [PATCH 2/3] character_base code is now in an external script --- scenes/character_base.tscn | 114 ++--------------------------- scripts/autoload/character_base.gd | 22 ------ scripts/character_base.gd | 103 ++++++++++++++++++++++++++ 3 files changed, 108 insertions(+), 131 deletions(-) delete mode 100644 scripts/autoload/character_base.gd create mode 100644 scripts/character_base.gd diff --git a/scenes/character_base.tscn b/scenes/character_base.tscn index 949bbd2..0d83121 100644 --- a/scenes/character_base.tscn +++ b/scenes/character_base.tscn @@ -28,112 +28,7 @@ [ext_resource path="res://sprites/clothes/blank_top.png" type="Texture" id=26] [ext_resource path="res://sprites/character/character_base_head.svg" type="Texture" id=27] [ext_resource path="res://sprites/character/mouth/mouth11.png" type="Texture" id=28] - -[sub_resource type="GDScript" id=1] -script/source = "# Anthony Wilcox licenses this file to you under the MPL license. -# See the LICENSE file in the project root for more information. -extends Node2D - -const _TDU_VERSION = \"0.2\" -const _SAVE_FILE = \"user://character.tdu\" - -onready var character = preload(\"res://resources/character.tres\") -onready var blank_accessory = preload(\"res://sprites/clothes/blank_top.png\") -onready var base_top = preload(\"res://sprites/character/character_base_top.svg\") -onready var base_bottom = preload(\"res://sprites/character/character_base_legs.svg\") - -onready var accessory = $body/accessory -#onready var underwear = $Undies -onready var bottom = $body/legs -onready var top = $body/top -onready var eyes = $body/head/eyes -onready var mouth = $body/head/mouth - -func _process(delta): - - if character.accessory != null: - accessory.texture = character.accessory - -# if character.underwear != null: -# underwear.texture = character.underwear - - if character.bottom != null: - bottom.texture = character.bottom - - if character.top != null: - top.texture = character.top - -func save_game(): - var data_file = { - \"version\": _TDU_VERSION, - \"game_ver\": GameData.version, - \"accessory\": \"res://sprites/clothes/blank_top.png\", - \"top\": \"res://sprites/clothes/blank_top.png\", - \"bottom\": \"res://sprites/character/character_base_legs.svg\", - } - - data_file[\"accessory\"] = accessory.texture.resource_path - data_file[\"top\"] = top.texture.resource_path - data_file[\"bottom\"] = bottom.texture.resource_path - var file = File.new() - if file.open(_SAVE_FILE, File.WRITE) != 0: - print(\"Error opening file\") - return - var json_file = to_json(data_file) - file.store_line(json_file) - print_debug(json_file) - file.close() - -func load_game(): - var file = File.new() - - if not file.file_exists(_SAVE_FILE): - print(\"File not found!\") - return - - if file.open(_SAVE_FILE, File.READ) != 0: - print(\"Error opening file\") - return - - var data = parse_json(file.get_line()) - - var top_texture = ImageTexture.new() - var accessory_texture = ImageTexture.new() - var bottom_texture = ImageTexture.new() - var top_image = Image.new() - var accessory_image = Image.new() - var bottom_image = Image.new() - - top_image.load(data[\"top\"]) - top_texture.create_from_image(top_image) - top.texture = top_texture - - bottom_image.load(data[\"bottom\"]) - top_texture.create_from_image(top_image) - bottom.texture = top_texture - - accessory_image.load(data[\"accessory\"]) - accessory_texture.create_from_image(top_image) - accessory.texture = accessory_texture - - file.close() - -func _on_clearBtn_pressed(): - $Click.play() - character.accessory = blank_accessory - character.bottom = base_bottom - character.top = base_top - -func _on_SaveBtn_pressed(): - $Click.play() - GameEvents.emit_signal(\"indicate\") - save_game() - -func _on_LoadBtn_pressed(): - $Click.play() - GameEvents.emit_signal(\"indicate\") - load_game() -" +[ext_resource path="res://scripts/character_base.gd" type="Script" id=29] [sub_resource type="SpriteFrames" id=2] animations = [ { @@ -161,7 +56,7 @@ animations = [ { [node name="characterBase" type="Node2D"] position = Vector2( -19, -92 ) -script = SubResource( 1 ) +script = ExtResource( 29 ) [node name="Click" type="AudioStreamPlayer" parent="."] stream = ExtResource( 24 ) @@ -179,6 +74,7 @@ __meta__ = { position = Vector2( -33.7592, 99.4079 ) scale = Vector2( 0.927713, 1 ) frames = SubResource( 2 ) +frame = 1 playing = true [node name="legs" type="Sprite" parent="body"] @@ -196,13 +92,13 @@ texture = ExtResource( 27 ) [node name="eyes" type="AnimatedSprite" parent="body/head"] position = Vector2( 17.6857, 4.22147 ) frames = SubResource( 3 ) -frame = 2 +frame = 1 playing = true [node name="mouth" type="AnimatedSprite" parent="body/head"] position = Vector2( 38.1195, 8.68453 ) frames = SubResource( 4 ) -frame = 5 +frame = 9 playing = true [node name="accessory" type="Sprite" parent="body"] diff --git a/scripts/autoload/character_base.gd b/scripts/autoload/character_base.gd deleted file mode 100644 index ea6e618..0000000 --- a/scripts/autoload/character_base.gd +++ /dev/null @@ -1,22 +0,0 @@ -# This project is licensed under the MPL license. -# See the LICENSE file in the project root for more information. -extends Node2D - -onready var character = preload("res://resources/character.tres") -onready var accessory = $Accessory -onready var underwear = $Undies -onready var bottom = $Bottom -onready var top = $Top - -func _process(delta): - if character.accessory != null: - accessory.texture = character.accessory - - if character.underwear != null: - underwear.texture = character.underwear - - if character.bottom != null: - bottom.texture = character.bottom - - if character.top != null: - top.texture = character.top diff --git a/scripts/character_base.gd b/scripts/character_base.gd new file mode 100644 index 0000000..3557c63 --- /dev/null +++ b/scripts/character_base.gd @@ -0,0 +1,103 @@ +# This project is licensed under the Artistic-2.0 license. +# See the LICENSE file in the project root for more information. +extends Node2D + +const _TDU_VERSION = "0.2" +const _SAVE_FILE = "user://character.tdu" + +onready var character = preload("res://resources/character.tres") +onready var blank_accessory = preload("res://sprites/clothes/blank_top.png") +onready var base_top = preload("res://sprites/character/character_base_top.svg") +onready var base_bottom = preload("res://sprites/character/character_base_legs.svg") + +onready var accessory = $body/accessory +#onready var underwear = $Undies +onready var bottom = $body/legs +onready var top = $body/top +onready var eyes = $body/head/eyes +onready var mouth = $body/head/mouth + +func _process(delta): + + if character.accessory != null: + accessory.texture = character.accessory + +# if character.underwear != null: +# underwear.texture = character.underwear + + if character.bottom != null: + bottom.texture = character.bottom + + if character.top != null: + top.texture = character.top + +func save_game(): + var data_file = { + "version": _TDU_VERSION, + "game_ver": GameData.version, + "accessory": "res://sprites/clothes/blank_top.png", + "top": "res://sprites/clothes/blank_top.png", + "bottom": "res://sprites/character/character_base_legs.svg", + } + + data_file["accessory"] = accessory.texture.resource_path + data_file["top"] = top.texture.resource_path + data_file["bottom"] = bottom.texture.resource_path + var file = File.new() + if file.open(_SAVE_FILE, File.WRITE) != 0: + print("Error opening file") + return + var json_file = to_json(data_file) + file.store_line(json_file) + print_debug(json_file) + file.close() + +func load_game(): + var file = File.new() + + if not file.file_exists(_SAVE_FILE): + print("File not found!") + return + + if file.open(_SAVE_FILE, File.READ) != 0: + print("Error opening file") + return + + var data = parse_json(file.get_line()) + + var top_texture = ImageTexture.new() + var accessory_texture = ImageTexture.new() + var bottom_texture = ImageTexture.new() + var top_image = Image.new() + var accessory_image = Image.new() + var bottom_image = Image.new() + + top_image.load(data["top"]) + top_texture.create_from_image(top_image) + top.texture = top_texture + + bottom_image.load(data["bottom"]) + top_texture.create_from_image(top_image) + bottom.texture = top_texture + + accessory_image.load(data["accessory"]) + accessory_texture.create_from_image(top_image) + accessory.texture = accessory_texture + + file.close() + +func _on_clearBtn_pressed(): + $Click.play() + character.accessory = blank_accessory + character.bottom = base_bottom + character.top = base_top + +func _on_SaveBtn_pressed(): + $Click.play() + GameEvents.emit_signal("indicate") + save_game() + +func _on_LoadBtn_pressed(): + $Click.play() + GameEvents.emit_signal("indicate") + load_game() From 9db6589717f2cc6a95078fac1753c98c93a841c1 Mon Sep 17 00:00:00 2001 From: Tony Bark <35226681+tonytins@users.noreply.github.com> Date: Mon, 31 May 2021 03:08:39 -0400 Subject: [PATCH 3/3] Disable import and export on the web - Removed Kenny Pixel as default font --- project.godot | 5 --- scenes/character_base.tscn | 79 +++++++++++++++++++++++++++++--------- scenes/game.tscn | 47 ++++++++++++----------- scripts/character_base.gd | 27 ++++++++----- scripts/game.gd | 2 +- scripts/ui.gd | 7 ++++ 6 files changed, 109 insertions(+), 58 deletions(-) diff --git a/project.godot b/project.godot index 33a84c4..c5ef88d 100644 --- a/project.godot +++ b/project.godot @@ -39,14 +39,9 @@ window/size/width=800 window/size/height=500 window/size/resizable=false window/energy_saving/keep_screen_on=false -mouse_cursor/custom_image="res://sprites/clothes/cursor.png" window/stretch/mode="2d" window/stretch/aspect="keep" -[gui] - -theme/custom_font="res://fonts/kenny_pixel_25.tres" - [importer_defaults] texture={ diff --git a/scenes/character_base.tscn b/scenes/character_base.tscn index 0d83121..bea928c 100644 --- a/scenes/character_base.tscn +++ b/scenes/character_base.tscn @@ -30,7 +30,7 @@ [ext_resource path="res://sprites/character/mouth/mouth11.png" type="Texture" id=28] [ext_resource path="res://scripts/character_base.gd" type="Script" id=29] -[sub_resource type="SpriteFrames" id=2] +[sub_resource type="SpriteFrames" id=1] animations = [ { "frames": [ ExtResource( 2 ), ExtResource( 3 ), ExtResource( 4 ) ], "loop": true, @@ -38,7 +38,7 @@ animations = [ { "speed": 2.0 } ] -[sub_resource type="SpriteFrames" id=3] +[sub_resource type="SpriteFrames" id=2] animations = [ { "frames": [ ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 11 ), ExtResource( 12 ) ], "loop": true, @@ -46,7 +46,7 @@ animations = [ { "speed": 2.0 } ] -[sub_resource type="SpriteFrames" id=4] +[sub_resource type="SpriteFrames" id=3] animations = [ { "frames": [ ExtResource( 13 ), ExtResource( 14 ), ExtResource( 15 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 18 ), ExtResource( 19 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 22 ), ExtResource( 28 ), ExtResource( 23 ) ], "loop": true, @@ -54,56 +54,97 @@ animations = [ { "speed": 2.0 } ] -[node name="characterBase" type="Node2D"] +[node name="CharacterBase" type="Node2D"] position = Vector2( -19, -92 ) script = ExtResource( 29 ) [node name="Click" type="AudioStreamPlayer" parent="."] stream = ExtResource( 24 ) -[node name="shadow" type="Sprite" parent="."] +[node name="Shadow" type="Sprite" parent="."] position = Vector2( 4.84271, 244.714 ) texture = ExtResource( 1 ) -[node name="body" type="Node2D" parent="."] +[node name="Body" type="Node2D" parent="."] __meta__ = { "_edit_lock_": true } -[node name="tail" type="AnimatedSprite" parent="body"] +[node name="Tail" type="AnimatedSprite" parent="Body"] position = Vector2( -33.7592, 99.4079 ) scale = Vector2( 0.927713, 1 ) -frames = SubResource( 2 ) -frame = 1 +frames = SubResource( 1 ) +frame = 2 playing = true -[node name="legs" type="Sprite" parent="body"] +[node name="Legs" type="Sprite" parent="Body"] position = Vector2( 1.47027, 191.868 ) texture = ExtResource( 5 ) -[node name="top" type="Sprite" parent="body"] +[node name="Top" type="Sprite" parent="Body"] position = Vector2( 7, 78 ) texture = ExtResource( 25 ) -[node name="head" type="Sprite" parent="body"] +[node name="Head" type="Sprite" parent="Body"] position = Vector2( 10.6805, -25.1047 ) texture = ExtResource( 27 ) -[node name="eyes" type="AnimatedSprite" parent="body/head"] +[node name="Eyes" type="AnimatedSprite" parent="Body/Head"] position = Vector2( 17.6857, 4.22147 ) -frames = SubResource( 3 ) -frame = 1 +frames = SubResource( 2 ) +frame = 2 playing = true -[node name="mouth" type="AnimatedSprite" parent="body/head"] +[node name="Mouth" type="AnimatedSprite" parent="Body/Head"] position = Vector2( 38.1195, 8.68453 ) -frames = SubResource( 4 ) -frame = 9 +frames = SubResource( 3 ) +frame = 10 playing = true -[node name="accessory" type="Sprite" parent="body"] +[node name="Accessory" type="Sprite" parent="Body"] position = Vector2( 9.54095, 73.0832 ) texture = ExtResource( 26 ) __meta__ = { "_edit_lock_": true } + +[node name="Controls" type="CanvasLayer" parent="."] + +[node name="Container" type="Control" parent="Controls"] +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = -19.0 +margin_top = -92.0 +margin_right = -19.0 +margin_bottom = -92.0 +__meta__ = { +"_edit_lock_": true, +"_edit_use_anchors_": true +} + +[node name="ExportWin" type="FileDialog" parent="Controls/Container"] +anchor_left = 0.215 +anchor_top = 0.21 +anchor_right = 0.785 +anchor_bottom = 0.79 +window_title = "Export" +access = 1 +current_dir = "user://Users/tonytins/Projects/tonysdressup" +current_path = "user://Users/tonytins/Projects/tonysdressup/" +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="ImportWin" type="FileDialog" parent="Controls/Container"] +anchor_left = 0.215 +anchor_top = 0.21 +anchor_right = 0.785 +anchor_bottom = 0.79 +window_title = "Open a File" +mode = 0 +access = 1 +current_dir = "user://Users/tonytins/Projects/tonysdressup" +current_path = "user://Users/tonytins/Projects/tonysdressup/" +__meta__ = { +"_edit_use_anchors_": true +} diff --git a/scenes/game.tscn b/scenes/game.tscn index 1bc2e2b..519fbe6 100644 --- a/scenes/game.tscn +++ b/scenes/game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=15 format=2] [ext_resource path="res://scenes/character_base.tscn" type="PackedScene" id=1] [ext_resource path="res://sprites/world/background.svg" type="Texture" id=2] @@ -9,6 +9,8 @@ [ext_resource path="res://sprites/symbols/file-upload.svg" type="Texture" id=7] [ext_resource path="res://scripts/ui.gd" type="Script" id=8] [ext_resource path="res://sprites/symbols/file-download.svg" type="Texture" id=9] +[ext_resource path="res://sprites/symbols/file-upload-disabled.svg" type="Texture" id=10] +[ext_resource path="res://sprites/symbols/file-download-disabled.svg" type="Texture" id=11] [ext_resource path="res://sprites/symbols/spinner.svg" type="Texture" id=12] [ext_resource path="res://scripts/spinner.gd" type="Script" id=13] [ext_resource path="res://scripts/game.gd" type="Script" id=14] @@ -35,7 +37,7 @@ position = Vector2( 35.118, -14.56 ) texture = ExtResource( 6 ) [node name="characterBase" parent="." instance=ExtResource( 1 )] -position = Vector2( 133.807, 230.615 ) +position = Vector2( 141.307, 225.012 ) [node name="Controls" type="CanvasLayer" parent="."] @@ -81,34 +83,33 @@ __meta__ = { } [node name="ButtonCtr" type="HBoxContainer" parent="Controls/Container/CenterBtns"] -margin_left = 179.0 -margin_top = 4.0 -margin_right = 330.0 -margin_bottom = 42.0 +margin_left = 197.0 +margin_top = 7.0 +margin_right = 312.0 +margin_bottom = 39.0 custom_constants/separation = 20 -[node name="ExportBtn" type="Button" parent="Controls/Container/CenterBtns/ButtonCtr"] -margin_right = 37.0 -margin_bottom = 38.0 +[node name="ExportBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"] +margin_right = 25.0 +margin_bottom = 32.0 hint_tooltip = "Export" -icon = ExtResource( 7 ) -flat = true +texture_normal = ExtResource( 7 ) +texture_disabled = ExtResource( 10 ) -[node name="ImportBtn" type="Button" parent="Controls/Container/CenterBtns/ButtonCtr"] -margin_left = 57.0 -margin_right = 94.0 -margin_bottom = 38.0 +[node name="ImportBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"] +margin_left = 45.0 +margin_right = 70.0 +margin_bottom = 32.0 hint_tooltip = "Import" -icon = ExtResource( 9 ) -flat = true +texture_normal = ExtResource( 9 ) +texture_disabled = ExtResource( 11 ) -[node name="ClearBtn" type="Button" parent="Controls/Container/CenterBtns/ButtonCtr"] -margin_left = 114.0 -margin_right = 151.0 -margin_bottom = 38.0 +[node name="ClearBtn" type="TextureButton" parent="Controls/Container/CenterBtns/ButtonCtr"] +margin_left = 90.0 +margin_right = 115.0 +margin_bottom = 32.0 hint_tooltip = "Clear" -icon = ExtResource( 3 ) -flat = true +texture_normal = ExtResource( 3 ) [node name="versionLbl" type="Label" parent="Controls/Container"] anchor_left = 0.88125 diff --git a/scripts/character_base.gd b/scripts/character_base.gd index 3557c63..83bc355 100644 --- a/scripts/character_base.gd +++ b/scripts/character_base.gd @@ -10,12 +10,16 @@ onready var blank_accessory = preload("res://sprites/clothes/blank_top.png") onready var base_top = preload("res://sprites/character/character_base_top.svg") onready var base_bottom = preload("res://sprites/character/character_base_legs.svg") -onready var accessory = $body/accessory +onready var export_win = $Controls/Container/ExportWin +onready var import_win = $Controls/Container/ImportWin +onready var unsupported_win = $Controls/Container/NotSupportedWin + +onready var accessory = $Body/Accessory #onready var underwear = $Undies -onready var bottom = $body/legs -onready var top = $body/top -onready var eyes = $body/head/eyes -onready var mouth = $body/head/mouth +onready var bottom = $Body/Legs +onready var top = $Body/Top +# onready var eyes = $Body/Head/Eyes +# onready var mouth = $Body/Head/Mouth func _process(delta): @@ -43,13 +47,16 @@ func save_game(): data_file["accessory"] = accessory.texture.resource_path data_file["top"] = top.texture.resource_path data_file["bottom"] = bottom.texture.resource_path + var file = File.new() if file.open(_SAVE_FILE, File.WRITE) != 0: print("Error opening file") return var json_file = to_json(data_file) + + GameEvents.emit_signal("indicate") + file.store_line(json_file) - print_debug(json_file) file.close() func load_game(): @@ -62,8 +69,8 @@ func load_game(): if file.open(_SAVE_FILE, File.READ) != 0: print("Error opening file") return - - var data = parse_json(file.get_line()) + + var data = parse_json(file.get_as_text()) var top_texture = ImageTexture.new() var accessory_texture = ImageTexture.new() @@ -72,6 +79,8 @@ func load_game(): var accessory_image = Image.new() var bottom_image = Image.new() + GameEvents.emit_signal("indicate") + top_image.load(data["top"]) top_texture.create_from_image(top_image) top.texture = top_texture @@ -94,10 +103,8 @@ func _on_clearBtn_pressed(): func _on_SaveBtn_pressed(): $Click.play() - GameEvents.emit_signal("indicate") save_game() func _on_LoadBtn_pressed(): $Click.play() - GameEvents.emit_signal("indicate") load_game() diff --git a/scripts/game.gd b/scripts/game.gd index 6aea0f7..5dbd88c 100644 --- a/scripts/game.gd +++ b/scripts/game.gd @@ -1,3 +1,3 @@ # This project is licensed under the Artistic-2.0 license. # See the LICENSE file in the project root for more information. -extends Node2D \ No newline at end of file +extends Node2D diff --git a/scripts/ui.gd b/scripts/ui.gd index d588ce2..9c6785a 100644 --- a/scripts/ui.gd +++ b/scripts/ui.gd @@ -9,7 +9,14 @@ onready var blank_accessory = preload("res://sprites/clothes/blank_top.png") onready var base_top = preload("res://sprites/character/character_base_top.svg") onready var base_bottom = preload("res://sprites/character/character_base_legs.svg") +onready var export_btn = $CenterBtns/ButtonCtr/ExportBtn +onready var import_btn = $CenterBtns/ButtonCtr/ImportBtn + func _ready(): var verLabel = $versionLbl verLabel.text = "v" + version GameData.version = version + + if OS.get_name() == "HTML5": + export_btn.disabled == true + import_btn.disabled == true