diff --git a/Nettool.vcxproj b/Nettool.vcxproj deleted file mode 100644 index 2b8780cd4..000000000 --- a/Nettool.vcxproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - {F6C54DC9-69F2-4897-87E9-2A4A9FB9F643} - Simutrans - - - - Application - v110 - Unicode - true - - - Application - v110 - Unicode - - - - - - - - - - - - - <_ProjectFileVersion>11.0.50727.1 - - - $(SolutionDir)$(Configuration)-nettool\ - $(Configuration)-nettool\ - - - $(SolutionDir)$(Configuration)\ - $(Configuration)\ - - - - Disabled - NOMINMAX;ZLIB_WINAPI;LITTLE_ENDIAN;DEBUG=3;NETTOOL;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebugDLL - Level3 - ProgramDatabase - 4200;4800;4311;4996;4396;%(DisableSpecificWarnings) - - - kernel32.lib;user32.lib;gdi32.lib;winmm.lib;Ws2_32.lib;advapi32.lib;wsock32.lib - true - false - - MachineX86 - - - - - NOMINMAX;ZLIB_WINAPI;LITTLE_ENDIAN;DEBUG=3;NETTOOL;%(PreprocessorDefinitions) - MultiThreadedDLL - Level3 - ProgramDatabase - 4200;4800;4311;4996;%(DisableSpecificWarnings) - - - kernel32.lib;user32.lib;gdi32.lib;winmm.lib;advapi32.lib;wsock32.lib - true - true - false - - MachineX86 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Nettool.vcxproj.filters b/Nettool.vcxproj.filters deleted file mode 100644 index acdde84dd..000000000 --- a/Nettool.vcxproj.filters +++ /dev/null @@ -1,117 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/script/api/changelog.h.gch b/script/api/changelog.h.gch new file mode 100644 index 000000000..b0968dfd9 Binary files /dev/null and b/script/api/changelog.h.gch differ diff --git a/simmenu.cc b/simmenu.cc index 7471f8983..044e553d7 100644 --- a/simmenu.cc +++ b/simmenu.cc @@ -119,6 +119,7 @@ tool_t *create_general_tool(int toolnr) case TOOL_ERROR_MESSAGE: tool = new tool_error_message_t(); break; case TOOL_CHANGE_WATER_HEIGHT: tool = new tool_change_water_height_t(); break; case TOOL_SET_CLIMATE: tool = new tool_set_climate_t(); break; + case TOOL_ROTATE_BUILDING: tool = new tool_rotate_building_t(); break; default: dbg->error("create_general_tool()","cannot satisfy request for general_tool[%i]!",toolnr); return NULL; } @@ -269,7 +270,7 @@ void general_tool_get_desc_builder(uint16 id, const char *param_str, const obj_d // The following 3's descriptions are registered by hausbauer_t. case TOOL_BUILD_DEPOT: case TOOL_BUILD_STATION: - case TOOL_HEADQUARTER: { + case TOOL_HEADQUARTER: { const building_desc_t* desc2 = hausbauer_t::get_desc(param_str); desc = desc2; tool = desc2->get_builder(); diff --git a/simmenu.h b/simmenu.h index 80698a77a..6b6be0cdd 100644 --- a/simmenu.h +++ b/simmenu.h @@ -72,6 +72,7 @@ enum { TOOL_ERROR_MESSAGE, TOOL_CHANGE_WATER_HEIGHT, TOOL_SET_CLIMATE, + TOOL_ROTATE_BUILDING, GENERAL_TOOL_COUNT, GENERAL_TOOL = 0x1000 }; diff --git a/simmenu.h.gch b/simmenu.h.gch new file mode 100644 index 000000000..6b995d4c5 Binary files /dev/null and b/simmenu.h.gch differ diff --git a/simtool.cc b/simtool.cc index 20ae588ba..64313ad30 100644 --- a/simtool.cc +++ b/simtool.cc @@ -4273,6 +4273,15 @@ DBG_MESSAGE("tool_station_aux()", "building %s on square %d,%d for waytype %x", layout |= 8-(neighbour_layout[senkrecht & next_own & ribi_t::southeast]&8); } } + // invert layout if shift pressed + if ( is_shift_pressed() ) { + layout ^= 8; + } + } + } + else { + if ( is_shift_pressed() ) { + layout ^= 8; } } // avoid orientation on 8 tiled buildings @@ -4611,6 +4620,116 @@ const char *tool_build_station_t::work( player_t *player, koord3d pos ) } +const char *tool_rotate_building_t::tool_rotate_platform(koord3d pos) +{ + grund_t *bd = welt->lookup(pos); + halthandle_t halt = bd->get_halt(); + + if( !bd || bd->get_weg_hang()!=slope_t::flat ) { + // only flat tiles, only one stop per map square + return "No suitable way on the ground!"; + } + + if( bd->ist_tunnel() && bd->ist_karten_boden() ) { + // do not build on tunnel entries + return "No suitable way on the ground!"; + } + + if( bd->get_depot() ) { + // not on depots + return NOTICE_UNSUITABLE_GROUND; + } + + if( bd->hat_weg(air_wt) && bd->get_weg(air_wt)->get_desc()->get_styp()!=type_flat ) { + return "Flugzeughalt muss auf\nRunway liegen!\n"; + } + + if( bd && !bd->get_halt().is_bound() ) { + // if there's no platform + return "No platform here!\n"; + } + + // rotate platforms + if( bd && bd->get_halt().is_bound() ) { + // check, if there is an oriented stop + gebaeude_t* gb = bd->find(); + const building_desc_t *desc = gb->get_tile()->get_desc(); + uint32 layout = gb->get_tile()->get_layout(); + uint32 all_layouts = desc->get_all_layouts(); + if( gb && all_layouts == 16 && bd->hat_wege() ) { + layout ^= 8; + hausbauer_t::build_station_extension_depot(halt->get_owner(), pos, layout, desc, &halt); + delete gb; +DBG_MESSAGE("tool_rotate_platform()", "rotated platform at (%d,%d)", pos.x, pos.y); + } + // rotate station buildings + else if( gb && all_layouts > 1 && !bd->hat_wege() ) { + koord dim = desc->get_size(); + if( dim.x == dim.y ) { + layout = (layout + 1) % all_layouts; + koord3d orgpos = gb->get_first_tile()->get_pos(); + hausbauer_t::remove(halt->get_owner(), gb); + hausbauer_t::build(halt->get_owner(), orgpos, layout, desc, &halt ); +DBG_MESSAGE("tool_rotate_platform()", "rotated station building at (%d,%d)", orgpos.x, orgpos.y); + } + } + } + + return NULL; +} + +const char *tool_rotate_building_t::tool_rotate_building(koord3d pos) +{ + const grund_t* gr = welt->lookup_kartenboden(pos.get_2d()); + gebaeude_t* gb = gr->find(); + koord3d orgpos = gb->get_first_tile()->get_pos(); + const building_desc_t* desc = gb->get_tile()->get_desc(); + uint32 layout = gb->get_tile()->get_layout(); + uint32 all_layouts = desc->get_all_layouts(); + player_t* owner = gb->get_owner(); + koord dim = desc->get_size(); + if ( all_layouts > 1 && dim.x == dim.y ) { + layout = (layout + 1) % all_layouts; + delete gb; + hausbauer_t::build(owner, orgpos, layout, desc); +DBG_MESSAGE("tool_rotate_building()", "rotate building at (%d,%d)", orgpos.x, orgpos.y); + } + return NULL; +} + +const char *tool_rotate_building_t::work( player_t *player, koord3d pos ) +{ + const grund_t *gr = welt->lookup(pos); + if(!gr) { + return ""; + } + + // Is there a station? + halthandle_t halt = gr->get_halt(); + if (halt.is_bound()) + { + // ownership allowed? + if( halt.is_bound() && !player_t::check_owner( player, halt->get_owner()) ) { + return "Das Feld gehoert\neinem anderen Spieler\n"; + } + + // check underground / above ground + if (const char* msg = check_pos(player, pos)) { + return msg; + } + + return tool_rotate_building_t::tool_rotate_platform(pos); + } + + const gebaeude_t* gb = gr->find(); + // Is there a building? + if (gb) { + return tool_rotate_building_t::tool_rotate_building(pos); + } + + return ""; +} + char const* tool_build_roadsign_t::get_tooltip(player_t const*) const { const roadsign_desc_t * desc = roadsign_t::find_desc(default_param); diff --git a/simtool.h b/simtool.h index cf43f3023..287639c1a 100644 --- a/simtool.h +++ b/simtool.h @@ -399,6 +399,18 @@ public: waytype_t get_waytype() const OVERRIDE; }; +class tool_rotate_building_t : public tool_t { +private: + const char *tool_rotate_platform(koord3d); + const char *tool_rotate_building(koord3d); + +public: + tool_rotate_building_t() : tool_t(TOOL_ROTATE_BUILDING | GENERAL_TOOL) {} + char const* get_tooltip(player_t const*) const OVERRIDE { return translator::translate("Rotate Building"); } + char const* work(player_t *, koord3d) OVERRIDE; + bool is_init_network_save() const OVERRIDE { return true; } +}; + // builds roadsigns and signals class tool_build_roadsign_t : public two_click_tool_t { private: diff --git a/simtool.h.gch b/simtool.h.gch new file mode 100644 index 000000000..32fc8c0c9 Binary files /dev/null and b/simtool.h.gch differ diff --git a/simutrans/history.txt b/simutrans/history.txt index b9ff83fbe..31d24da33 100644 --- a/simutrans/history.txt +++ b/simutrans/history.txt @@ -26,7 +26,6 @@ CHG: speed can be directly selected in goods dialogue FIX: consistent and wider climate borders, also other waterlevels than -2 when loading a relief map - Release of 120.2.2: (r8163 on 31-3-2017): ADD: Name filter in depot window FIX: Combo boxes now work much more reliable diff --git a/simutrans/music/43-Driving-on-the-midnight-highway.mid b/simutrans/music/43-Driving-on-the-midnight-highway.mid index e4b3f048c..e69de29bb 100644 Binary files a/simutrans/music/43-Driving-on-the-midnight-highway.mid and b/simutrans/music/43-Driving-on-the-midnight-highway.mid differ diff --git a/simutrans/music/44-Above-the-sky.mid b/simutrans/music/44-Above-the-sky.mid index 152a85e84..e69de29bb 100644 Binary files a/simutrans/music/44-Above-the-sky.mid and b/simutrans/music/44-Above-the-sky.mid differ diff --git a/simutrans/music/45-Misty-Forest.mid b/simutrans/music/45-Misty-Forest.mid index 3db804c97..e69de29bb 100644 Binary files a/simutrans/music/45-Misty-Forest.mid and b/simutrans/music/45-Misty-Forest.mid differ diff --git a/simutrans/music/46-House-in-the-station.mid b/simutrans/music/46-House-in-the-station.mid index b248e5399..e69de29bb 100644 Binary files a/simutrans/music/46-House-in-the-station.mid and b/simutrans/music/46-House-in-the-station.mid differ