Skip to content

Commit

Permalink
feat: 1.4.8 - Keybind schemas, transparent mode, fixes (#93)
Browse files Browse the repository at this point in the history
## Added

- Experimental: improved TUI for pickClass(), pickName() using
s4c-gui
- Add GameOptions for runtime settings
  - Can be changed at any time from menu (open with m).
  - Experimental: add new binfile for storing the settings
- Add HLPD_Key, hlpd_default_keybinds as base to support
customizable keybinds
- For now, just a rigid set of 3 schemas is available (mutually
exclusive): ARROW_KEYS,VIM_KEYS, WASD_KEYS.
- Run with -j to use VIM_KEYS at start, -w to use WASD_KEYS at
start
- Add optional usage of terminal's default colors (to support
transparent background for the game).
  - Run with -b to use this option at start
- Needs support from your ncurses library for reset_color_pairs(),
which is an extension to ncurses.
- Builds missing this support are unable to use this option. If your
build is stuck with this option off, you may try to rebuild your ncurses
library from source.
- Collect BSP_Room tree for each bsp gen in gamestate_kls
  - Currently only used by dbg_BSP_Room() on the root
- Add WIP draw_BSP_Room()

## Changed
- Most curses menu wrap around
- When going up from first item or down from last, wrap to the other
side
- Experimental: Use int32_t for enum types in ser.h
- Renamed ctrl_c_handler() to hlpd_sigint_handler()

## Fixed
- Fix: proper check for ncurses version for log
- Fix: clear gamestate->current_room after finishing one
- Fix typo in header
- Fix: drop useless left/right pick for get_saveslot_index()
- Fix: move anvil__helapordo.h inclusion to game_utils.h
- Should make the starting info show anvil info instead of Built
without anvil incorrectly
- Fix: place player at home coords with -X after Boss kill

## Notes
- Bump sprites4curses to 0.4.5
- Dropped .md extension from LICENSE
- Adds s4c-gui at 0.0.7
  • Loading branch information
jgabaut authored May 17, 2024
1 parent 3a2e71e commit f9821ac
Show file tree
Hide file tree
Showing 31 changed files with 1,935 additions and 646 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ save-nc.bin
save-rl.bin

# ignore run bin

run-nc.bin
run-rl.bin

# ignore settings bin
settings-nc.bin
settings-rl.bin

# ignore hlpd-1 dir
hlpd-1
# ignore hlpd-2 dir
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "s4c-scripts"]
path = s4c-scripts
url = [email protected]:jgabaut/s4c-scripts.git
[submodule "s4c-gui"]
path = s4c-gui
url = [email protected]:jgabaut/s4c-gui.git
File renamed without changes.
16 changes: 12 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ else
helapordo_SOURCES =
endif

helapordo_SOURCES += src/core/game_core.c src/utils/game_utils.c src/utils/game_init.c src/utils/game_fight.c src/utils/game_debug.c src/core/equips.c src/ser/ser_core.c src/utils/saves.c src/utils/turn_op.c src/utils/rooms.c src/utils/artifacts.c src/utils/specials.c src/main.c src/core/sprites.c src/utils/floors.c koliseo/src/koliseo.c sprites4curses/s4c-animate/animate.c src/animations/mummy_shuffle.c src/animations/ghost_spell.c src/animations/boar_scream.c src/animations/troll_club.c src/animations/goblin_shoot.c src/animations/zombie_walk.c src/animations/imp_fireball.c src/animations/werewolf_transform.c src/animations/knight_tapis.c src/animations/mage_spark.c src/animations/archer_drop.c src/animations/assassin_poof.c src/animations/crawlingdude_crawl.c src/animations/srwarthog_square.c src/animations/headlessninja_throw.c src/animations/bluetroll_wonder.c src/animations/enter_door.c src/animations/alt_chest_opening.c src/core/game_lore.c src/core/game_lore_alt.c src/palette.c src/bsp/bsp.c
helapordo_SOURCES += src/core/game_core.c src/utils/game_utils.c src/utils/game_init.c src/utils/game_fight.c src/utils/game_debug.c src/core/equips.c src/ser/ser_core.c src/utils/saves.c src/utils/turn_op.c src/utils/rooms.c src/utils/artifacts.c src/utils/specials.c src/main.c src/core/sprites.c src/utils/floors.c koliseo/src/koliseo.c sprites4curses/s4c-animate/animate.c src/animations/mummy_shuffle.c src/animations/ghost_spell.c src/animations/boar_scream.c src/animations/troll_club.c src/animations/goblin_shoot.c src/animations/zombie_walk.c src/animations/imp_fireball.c src/animations/werewolf_transform.c src/animations/knight_tapis.c src/animations/mage_spark.c src/animations/archer_drop.c src/animations/assassin_poof.c src/animations/crawlingdude_crawl.c src/animations/srwarthog_square.c src/animations/headlessninja_throw.c src/animations/bluetroll_wonder.c src/animations/enter_door.c src/animations/alt_chest_opening.c src/core/game_lore.c src/core/game_lore_alt.c src/palette.c src/bsp/bsp.c s4c-gui/src/s4c_gui.c
if HL_RAYLIB_BUILD
AM_CFLAGS += -DHELAPORDO_RAYLIB_BUILD
helapordo_SOURCES += src/build-rl/helapordo_raylib.c src/build-rl/game_rl.c
helapordo_SOURCES += src/build-rl/helapordo_raylib.c src/build-rl/game_rl.c s4c-gui/src/s4c_gui.c
else
AM_CFLAGS += -DHELAPORDO_CURSES_BUILD
helapordo_SOURCES += src/build-nc/game_curses.c
Expand All @@ -75,7 +75,7 @@ helapordo_SOURCES += src/build-nc/helapordo.c
endif
endif

hlpd_save2l_SOURCES = src/core/game_core.c src/core/sprites.c src/utils/game_utils.c scripts/save2l/save2l.c src/ser/ser_core.c koliseo/src/koliseo.c
hlpd_save2l_SOURCES = src/core/game_core.c src/core/sprites.c src/utils/game_utils.c scripts/save2l/save2l.c src/ser/ser_core.c koliseo/src/koliseo.c s4c-gui/src/s4c_gui.c

if HL_RAYLIB_BUILD
hlpd_save2l_SOURCES += sprites4curses/s4c-animate/animate.c src/build-rl/game_rl.c
Expand All @@ -97,6 +97,12 @@ endif
$(CCOMP) -c ./sprites4curses/s4c-animate/animate.c $(AM_CFLAGS) -o ./sprites4curses/s4c-animate/animate.o
@echo -e "\033[1;33mDone.\e[0m"

./s4c-gui/src/s4c_gui.o:
@echo -e " \033[1;35mAM_CFLAGS\e[0m: [ \"\033[1;34m$(AM_CFLAGS)\e[0m\" ]"
@echo -en "\033[1;34m[Makefile]\e[0m Building [\033[1;35m./s4c-gui/src/s4c_gui.o\e[0m]: "
$(CCOMP) -c ./s4c-gui/src/s4c_gui.c $(AM_CFLAGS) -o ./s4c-gui/src/s4c_gui.o
@echo -e "\033[1;33mDone.\e[0m"

./koliseo/src/koliseo.o:
@echo -e " \033[1;35mAM_CFLAGS\e[0m: [ \"\033[1;34m$(AM_CFLAGS)\e[0m\" ]"
@echo -en "\033[1;34m[Makefile]\e[0m Building [\033[1;35m./koliseo/src/koliseo.o\e[0m] with curses: "
Expand Down Expand Up @@ -225,6 +231,7 @@ clean:
@echo -en "Cleaning build artifacts: "
-rm $(TARGET)
-rm sprites4curses/s4c-animate/*.o
-rm s4c-gui/src/*.o
-rm src/*.o
-rm src/build-*/*.o
-rm src/core/*.o
Expand All @@ -244,6 +251,7 @@ clean:
cleanob:
@echo -en "Cleaning object build artifacts: "
-rm sprites4curses/s4c-animate/*.o
-rm s4c-gui/src/*.o
-rm koliseo/src/*.o
-rm src/*.o
-rm src/build-*/*.o
Expand All @@ -255,7 +263,7 @@ cleanob:
@echo -e "\033[1;33mDone.\e[0m"

# Default target (builds everything)
all: ./src/palette.c ./koliseo/src/koliseo.o ./sprites4curses/s4c-animate/animate.o $(TARGET) ./hlpd-save2l
all: ./src/palette.c ./koliseo/src/koliseo.o ./sprites4curses/s4c-animate/animate.o ./s4c-gui/src/s4c_gui.o $(TARGET) ./hlpd-save2l

# Target to clean and rebuild
rebuild: clean all
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@

I try to upload precompiled binaries for the ncurses build:

- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.6/helapordo-nc-1.4.6-Linux-x86_64.zip)
- `x86_64-Linux` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.8/helapordo-nc-1.4.8-Linux-x86_64.zip)
- `aarch64-Linux` (from [Termux](https://f-droid.org/packages/com.termux/) on Android).
- `x86_64-w64-mingw32` (*JUST A DEMO.* Any help with debugging the full game is welcome.) : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.6/helapordo.exe-nc-1.4.6-w64-mingw32-x86_64.zip)
- `x86_64-w64-mingw32` (*JUST A DEMO.* Any help with debugging the full game is welcome.) : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.8/helapordo.exe-nc-1.4.8-w64-mingw32-x86_64.zip)

- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.5/helapordo-nc-1.4.5-darwin-arm64.zip) (Available = `1.4.5`. Latest = `1.4.6`)
- `darwin-arm64` : [download latest](https://github.com/jgabaut/helapordo/releases/download/1.4.7/helapordo-nc-1.4.7-darwin-arm64.zip) (Available = `1.4.7`. Latest = `1.4.8`)
- You should always check if the releases page has a newer build for you than the one linked here.

📦 v1.4.6 29/04/2024
📦 v1.4.8 17/05/2024
https://github.com/jgabaut/helapordo/releases

## Building <a name = "building"></a>
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Define the package name and version
AC_INIT([helapordo], [1.4.7], [[email protected]])
AC_INIT([helapordo], [1.4.8], [[email protected]])

# Verify automake version and enable foreign option
AM_INIT_AUTOMAKE([foreign -Wall])
Expand Down Expand Up @@ -187,7 +187,7 @@ AM_CONDITIONAL([USE_EMOJI_BUILD], [test "$enable_emoji" = "yes"])
# Set a default version number if not specified externally
AC_ARG_VAR([VERSION], [Version number])
if test -z "$VERSION"; then
VERSION="1.4.7"
VERSION="1.4.8"
fi

# Output variables to the config.h header
Expand Down
2 changes: 1 addition & 1 deletion docs/helapordo.doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = helapordo
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.4.7
PROJECT_NUMBER = 1.4.8

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
10 changes: 5 additions & 5 deletions kazoj/bone/const.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ void fail(char* msg, int ex, int val) {

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.4.7") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.8") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 31) ) {
fail("HLP_MAX_INDEX",31,HLP_MAX_INDEX);
if ( ! (HLP_MAX_INDEX == 33) ) {
fail("HLP_MAX_INDEX",33,HLP_MAX_INDEX);
}
if ( ! (MAX_SAVESLOTS == 3) ) {
fail("MAX_SAVESLOTS",3,MAX_SAVESLOTS);
}
if ( ! (FOETURNOP_MAX == 3) ) {
fail("FOETURNOP_MAX",3,FOETURNOP_MAX);
};
if ( ! (TURNOP_MAX == 16) ) {
fail("TURNOP_MAX",16,TURNOP_MAX);
if ( ! (TURNOP_MAX == 17) ) {
fail("TURNOP_MAX",17,TURNOP_MAX);
};
if ( ! (OP_RES_MAX == 10) ) {
fail("OP_RES_MAX",10,OP_RES_MAX);
Expand Down
10 changes: 5 additions & 5 deletions kazoj/bone/const_rl.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ void fail(char* msg, int ex, int val) {

int main(void) {
int check = -1;
if ( ! (( check = strcmp(VERSION, "1.4.7") ) == 0)) {
if ( ! (( check = strcmp(VERSION, "1.4.8") ) == 0)) {
fail("VERSION",0,check);
};
if ( ! (HLP_MAX_INDEX == 31) ) {
fail("HLP_MAX_INDEX",31,HLP_MAX_INDEX);
if ( ! (HLP_MAX_INDEX == 33) ) {
fail("HLP_MAX_INDEX",33,HLP_MAX_INDEX);
}
if ( ! (MAX_SAVESLOTS == 3) ) {
fail("MAX_SAVESLOTS",3,MAX_SAVESLOTS);
}
if ( ! (FOETURNOP_MAX == 3) ) {
fail("FOETURNOP_MAX",3,FOETURNOP_MAX);
};
if ( ! (TURNOP_MAX == 16) ) {
fail("TURNOP_MAX",16,TURNOP_MAX);
if ( ! (TURNOP_MAX == 17) ) {
fail("TURNOP_MAX",17,TURNOP_MAX);
};
if ( ! (OP_RES_MAX == 10) ) {
fail("OP_RES_MAX",10,OP_RES_MAX);
Expand Down
1 change: 1 addition & 0 deletions s4c-gui
Submodule s4c-gui added at 50da8f
2 changes: 1 addition & 1 deletion scripts/bootstrap_anvil.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-only
# Script to link binary for anvil
# Copyright (C) 2023 jgabaut
# Copyright (C) 2023-2024 jgabaut
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 4 additions & 0 deletions scripts/save2l/save2l.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "save2l.h"

#ifndef KOLISEO_HAS_REGION
Gamestate* G_GAMESTATE = NULL;
#endif
int G_PRELOAD_ANIMATIONS_ON = 0;
int G_DEBUG_ON = 0;
int G_LOG_ON = 0;
Expand All @@ -22,6 +25,7 @@ int64_t G_RNG_ADVANCEMENTS = 0;
Gamemode GAMEMODE = Rogue;
Koliseo* default_kls = NULL;
Koliseo* temporary_kls = NULL;
Koliseo* support_kls = NULL;

void saverdr_usage(const char* progname)
{
Expand Down
Loading

0 comments on commit f9821ac

Please sign in to comment.