From f9da21b61c3ae8046dd963203b257932989ccf6d Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Tue, 10 Aug 2021 19:40:59 +0200 Subject: [PATCH] Added console build tag (which doesn't hide the console window). --- .gitignore | 1 - README.md | 26 -------------------------- TODO.md | 2 +- cmd/tins2021/credits.go | 2 -- cmd/tins2021/tins2021.go | 3 --- cmd/tins2021/tins2021_console.go | 4 ++++ 6 files changed, 5 insertions(+), 33 deletions(-) create mode 100644 cmd/tins2021/tins2021_console.go diff --git a/.gitignore b/.gitignore index 4b59098..9f1521f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .vscode/launch.json scripts/build -cmd/tins2021/rice-box.go diff --git a/README.md b/README.md index 77c0158..34573f7 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,6 @@ * [go-colurful](###go-colurful) * [resize](###resize) * [testify](###testify) - * [go.rice](###rice) ## Introduction @@ -388,28 +387,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -### rice - -Copyright (c) 2013, Geert-Johan Riemer -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/TODO.md b/TODO.md index 40c5c84..7fc488b 100644 --- a/TODO.md +++ b/TODO.md @@ -2,7 +2,7 @@ - [ ] Add music & sounds. - [ ] Keep score/difficulty level (resume & restart). - [ ] Explain controls on info page. -- [ ] Fix usage of go/embed (and remove rice again). +- [X] Fix usage of go/embed (and remove rice again). - [X] Add monster animations (~~jumping on tile &~~ towards new tile). - [ ] Scale icons (heart & star on right side) when playing. - [ ] Change layout when playing in portrait mode. diff --git a/cmd/tins2021/credits.go b/cmd/tins2021/credits.go index 144a8e8..89ea381 100644 --- a/cmd/tins2021/credits.go +++ b/cmd/tins2021/credits.go @@ -58,8 +58,6 @@ func newCredits(app *appContext, ctx ui.Context) *credits { " - https://github.com/nfnt/resize", "", "testify: a testing library for Go", " - https://github.com/stretchr/testify", "", - "rice: a library for embedding files in Go", - " - https://github.com/GeertJohan/go.rice", "", "", "# THANKS", "", diff --git a/cmd/tins2021/tins2021.go b/cmd/tins2021/tins2021.go index 797d5e6..7ef22f8 100644 --- a/cmd/tins2021/tins2021.go +++ b/cmd/tins2021/tins2021.go @@ -13,9 +13,6 @@ import ( "opslag.de/schobers/zntg/ui" ) -// #cgo windows LDFLAGS: -Wl,-subsystem,windows -import "C" - //go:embed resources var resources embed.FS diff --git a/cmd/tins2021/tins2021_console.go b/cmd/tins2021/tins2021_console.go new file mode 100644 index 0000000..28610d7 --- /dev/null +++ b/cmd/tins2021/tins2021_console.go @@ -0,0 +1,4 @@ +package main + +// #cgo windows,!console LDFLAGS: -Wl,-subsystem,windows +import "C"