Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ namespace {
return;
}

if (line.find("[CLOSEONESC") != string::npos) {
string result = parseStrFromLine("CLOSEONESC", line);
ssConfig.closeOnEsc = (result == "YES");
}

if (line.find("[WIDTH") != string::npos) {
int width = parseIntFromLine("WIDTH", line);
ssState.ScreenW = width;
Expand Down Expand Up @@ -168,6 +173,18 @@ namespace {
string result = parseStrFromLine("SHOW_CREATURE_NAMES", line);
ssConfig.show_creature_names = (result == "YES");
}
if (line.find("[SHOW_CREATURE_MOODS") != string::npos) {
string result = parseStrFromLine("SHOW_CREATURE_MOODS", line);
ssConfig.show_creature_moods = (result == "YES");
}
if (line.find("[SHOW_CREATURE_JOBS") != string::npos) {
string result = parseStrFromLine("SHOW_CREATURE_JOBS", line);
ssConfig.show_creature_jobs = (result == "YES");
}
if (line.find("[SHOW_CREATURE_PROFESSIONS") != string::npos) {
int value = parseIntFromLine("SHOW_CREATURE_PROFESSIONS", line);
ssConfig.show_creature_professions = value;
}
if (line.find("[NAMES_USE_NICKNAME") != string::npos) {
string result = parseStrFromLine("NAMES_USE_NICKNAME", line);
ssConfig.names_use_nick = (result == "YES");
Expand Down
6 changes: 5 additions & 1 deletion GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,11 @@ void paintboard()
ssTimers.frame_total = (donetime - ssTimers.prev_frame_time)*0.1 + ssTimers.frame_total*0.9;
ssTimers.prev_frame_time = donetime;

if (ssConfig.show_announcements) {
al_hold_bitmap_drawing(true);
draw_announcements(font, ssState.ScreenW, ssState.ScreenH - 20, ALLEGRO_ALIGN_RIGHT, df::global::world->status.announcements);
al_hold_bitmap_drawing(false);
}
if(ssConfig.show_keybinds){
std::string *keyname, *actionname;
keyname = actionname = NULL;
Expand All @@ -900,7 +905,6 @@ void paintboard()

drawDebugCursor(segment);

draw_announcements(font, ssState.ScreenW, ssState.ScreenH - 20, ALLEGRO_ALIGN_RIGHT, df::global::world->status.announcements);
drawAdvmodeMenuTalk(font, 5, ssState.ScreenH - 5);

if(ssConfig.debug_mode) {
Expand Down
3 changes: 3 additions & 0 deletions Keybinds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ action_name_mapper actionnamemap[] = {
{"TOGGLE_STOCKS", action_togglestockpiles},
{"TOGGLE_ZONES", action_togglezones},
{"TOGGLE_OCCLUSION", action_toggleocclusion},
{"TOGGLE_FOG",action_togglefog},
{"TOGGLE_CREATURE_MOODS", action_togglecreaturemood},
{"TOGGLE_CREATURE_PROFS", action_togglecreatureprof},
{"TOGGLE_CREATURE_JOBS", action_togglecreaturejob},
Expand All @@ -198,6 +199,8 @@ action_name_mapper actionnamemap[] = {
{"TOGGLE_SHOW_HIDDEN_TILES", action_toggleshowhidden},
{"TOGGLE_OSD", action_toggleosd},
{"TOGGLE_KEYBINDS", action_togglekeybinds},
{"TOGGLE_ANNOUNCEMENTS", action_toggleannouncements},
{"TOGGLE_DEBUG", action_toggledebug},
{"INCR_ZOOM", action_incrzoom},
{"DECR_ZOOM", action_decrzoom},
{"SCREENSHOT", action_screenshot},
Expand Down
14 changes: 14 additions & 0 deletions UserInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ void action_toggleocclusion(uint32_t keymod)
timeToReloadSegment = true;
}

void action_togglefog(uint32_t keymod)
{
ssConfig.fogenable = !ssConfig.fogenable;
}

void action_togglecreaturemood(uint32_t keymod)
{
ssConfig.show_creature_moods = !ssConfig.show_creature_moods;
Expand Down Expand Up @@ -382,6 +387,15 @@ void action_togglekeybinds(uint32_t keymod){
ssConfig.show_keybinds = !ssConfig.show_keybinds;
}

void action_toggleannouncements(uint32_t keymod) {
ssConfig.show_announcements = !ssConfig.show_announcements;
}

void action_toggledebug(uint32_t keymod)
{
ssConfig.debug_mode = !ssConfig.debug_mode;
}

void action_incrzoom(uint32_t keymod)
{
ssConfig.zoom++;
Expand Down
3 changes: 3 additions & 0 deletions UserInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ void action_toggledesignations(uint32_t keymod);
void action_togglestockpiles(uint32_t keymod);
void action_togglezones(uint32_t keymod);
void action_toggleocclusion(uint32_t keymod);
void action_togglefog(uint32_t keymod);
void action_togglecreaturemood(uint32_t keymod);
void action_togglecreatureprof(uint32_t keymod);
void action_togglecreaturejob(uint32_t keymod);
Expand All @@ -24,7 +25,9 @@ void action_toggleshadehidden(uint32_t keymod);
void action_toggleshowhidden(uint32_t keymod);
void action_togglecreaturenames(uint32_t keymod);
void action_toggleosd(uint32_t keymod);
void action_toggledebug(uint32_t keymod);
void action_togglekeybinds(uint32_t keymod);
void action_toggleannouncements(uint32_t keymod);
void action_incrzoom(uint32_t keymod);
void action_decrzoom(uint32_t keymod);
void action_screenshot(uint32_t keymod);
Expand Down
2 changes: 2 additions & 0 deletions commonTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ struct GameConfiguration {
bool show_stockpiles;
bool show_designations;
bool show_osd;
bool show_announcements;
bool show_keybinds;
bool closeOnEsc;
bool single_layer_view;
bool shade_hidden_tiles;
bool show_hidden_tiles;
Expand Down
10 changes: 8 additions & 2 deletions configs/init.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ Please note, these keywords are case sensitive for now.

--Interface--

Sets whether hitting Esc will close the window, in addition to being able
to use the close window button. (YES or NO)
[CLOSEONESC:YES]

Sets the width and height of the application in pixels.
[WIDTH:800]
[HEIGHT:600]
Expand Down Expand Up @@ -92,8 +96,10 @@ Sets Stonesense in debug mode. Adds additional information to displays.
Sets the debug cursor to follow the cursor from DF when it is there.
[FOLLOW_DF_CURSOR:YES]

Shows creatures names floating above their sprites. (Toggle with 'n')
[SHOW_CREATURE_NAMES:YES]
Shows creatures info floating above their sprites.
[SHOW_CREATURE_NAMES:NO]
[SHOW_CREATURE_MOODS:NO]
[SHOW_CREATURE_JOBS:NO]

Options to control how names are displayed (if SHOW_CREATURE_NAMES is set)
[NAMES_USE_NICKNAME:YES]
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Template for new versions:
# Future

## New Features
- `stonesense`: added config for closeOnEsc to disable closing stonesense with the escape key
- `stonesense`: added configs to show creature moods and jobs by default
- `stonesense`: added config to show announcements, on by default, toggle with ``a`` (default keybinding) while stonsense window is active
- `stonesense`: ``~`` is now the key to toggle debug mode while stonesense window is active and ``;`` is the default key for toggling fog

## Fixes

Expand Down
2 changes: 2 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,8 @@ static void * stonesense_thread(ALLEGRO_THREAD * main_thread, void * parms)
color_ostream_proxy out(Core::getInstance().getConsole());
out.print("Stonesense launched\n");

ssConfig.closeOnEsc = true;
ssConfig.show_announcements = true;
ssConfig.debug_mode = false;
ssConfig.hide_outer_tiles = false;
ssConfig.shade_hidden_tiles = true;
Expand Down
Loading