diff --git a/NEWS.rst b/NEWS.rst index 63abddd4e..f5bad9fc7 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -97,6 +97,7 @@ Fixes - Prevented a crash resulting from a bad civilization option - `showmood`: Fixed name display on OS X/Linux +- `view-item-info`: Fixed density units Misc Improvements ----------------- diff --git a/library/Hooks-darwin.cpp b/library/Hooks-darwin.cpp index 3e020f9be..81ed828bc 100644 --- a/library/Hooks-darwin.cpp +++ b/library/Hooks-darwin.cpp @@ -47,6 +47,7 @@ typedef struct interpose_s #include "DFHack.h" #include "Core.h" #include "Hooks.h" +#include "SDL_events.h" #include /*static const interpose_t interposers[] __attribute__ ((section("__DATA, __interpose"))) = @@ -105,7 +106,8 @@ DFhackCExport int DFH_SDL_PollEvent(SDL::Event* event) pollevent_again: // if SDL returns 0 here, it means there are no more events. return 0 int orig_return = SDL_PollEvent(event); - if(!orig_return || !(SDL_GetAppState() & SDL_APPINPUTFOCUS)) + if(!orig_return || (!(SDL_GetAppState() & SDL_APPINPUTFOCUS) && + (event->type == SDL::ET_KEYDOWN || event->type == SDL::ET_KEYUP))) return 0; // otherwise we have an event to filter else if( event != 0 ) diff --git a/plugins/proto/RemoteFortressReader.proto b/plugins/proto/RemoteFortressReader.proto index 1eb2ad12e..b2aef8c58 100644 --- a/plugins/proto/RemoteFortressReader.proto +++ b/plugins/proto/RemoteFortressReader.proto @@ -284,6 +284,8 @@ message ViewInfo optional int32 cursor_pos_x = 6; optional int32 cursor_pos_y = 7; optional int32 cursor_pos_z = 8; + optional int32 follow_unit_id = 9 [default = -1]; + optional int32 follow_item_id = 10 [default = -1]; } message MapInfo diff --git a/plugins/remotefortressreader.cpp b/plugins/remotefortressreader.cpp index 9af3211fa..4c7862fe1 100644 --- a/plugins/remotefortressreader.cpp +++ b/plugins/remotefortressreader.cpp @@ -94,6 +94,7 @@ using namespace df::global; #else REQUIRE_GLOBAL(world); REQUIRE_GLOBAL(gps); +REQUIRE_GLOBAL(ui); #endif // Here go all the command declarations... @@ -1440,6 +1441,8 @@ static command_result GetViewInfo(color_ostream &stream, const EmptyMessage *in, out->set_cursor_pos_x(cx); out->set_cursor_pos_y(cy); out->set_cursor_pos_z(cz); + out->set_follow_unit_id(ui->follow_unit); + out->set_follow_item_id(ui->follow_item); return CR_OK; } diff --git a/scripts/modtools/extra-gamelog.lua b/scripts/modtools/extra-gamelog.lua index 47f39b574..0046ceb26 100644 --- a/scripts/modtools/extra-gamelog.lua +++ b/scripts/modtools/extra-gamelog.lua @@ -16,10 +16,10 @@ function log_on_load(op) -- Seasons fix for Soundsense local seasons = { [-1] = 'Nothing', -- worldgen - 'Spring', - 'Summer', - 'Autumn', - 'Winter'} + [0] = 'Spring', + [1] = 'Summer', + [2] = 'Autumn', + [3] = 'Winter'} msg(seasons[df.global.cur_season]..' has arrived on the calendar.') -- Weather fix for Soundsense diff --git a/scripts/view-item-info.lua b/scripts/view-item-info.lua index be8e14b9e..39614d3bf 100644 --- a/scripts/view-item-info.lua +++ b/scripts/view-item-info.lua @@ -92,7 +92,7 @@ function GetMatPropertiesStringList (item) if isInList(mat_properties_for, get_textid (item)) then append(list,"Material name: "..mat.state_name.Solid) append(list,"Material properties: ") - append(list,"Solid density: "..mat.solid_density..'g/cm^3',1) + append(list,"Solid density: "..mat.solid_density..'kg/m^3',1) local maxedge = mat.strength.max_edge append(list,"Maximum sharpness: "..maxedge.." ("..maxedge/standard.strength.max_edge*100 .."%)",1) if mat.molar_mass > 0 then