File tree Expand file tree Collapse file tree 3 files changed +40
-11
lines changed
Expand file tree Collapse file tree 3 files changed +40
-11
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ Release of 124.3.1 (r11671 on 5-Apr-2025):
2626 FIX: make sure, the pak path and working path are really different
2727 FIX: single way tile did not force bridge direction
2828 ADD: New simple tool 43 to highlught single ribi ways
29+ CHG: Pause tool unpauses server waiting for clients
2930
3031
3132Release of 124.3 (r11590 on 10-Jan-2025):
Original file line number Diff line number Diff line change 5454#include " ../gui/privatesign_info.h"
5555#include " ../gui/messagebox.h"
5656
57+ #include " ../network/network_socket_list.h"
58+
5759#include " ../obj/zeiger.h"
5860#include " ../obj/bruecke.h"
5961#include " ../obj/tunnel.h"
@@ -7217,6 +7219,38 @@ const char *tool_pipette_t::work(player_t *pl, koord3d pos)
72177219 return gr->obj_count ()>0 ? " Not allowed to copy object." : NULL ;
72187220}
72197221
7222+ // pause tool also to unpause server games
7223+ char const * tool_pause_t::get_tooltip (player_t const *) const
7224+ {
7225+ if (env_t ::networkmode) {
7226+ if (env_t ::server) {
7227+ return translator::translate (" Pause" );
7228+ }
7229+ return translator::translate (" deactivated in online mode" );
7230+ }
7231+ return translator::translate (" Pause" );
7232+
7233+ }
7234+
7235+ bool tool_pause_t::init (player_t *)
7236+ {
7237+ if (!env_t ::networkmode) {
7238+ welt->set_fast_forward (0 );
7239+ welt->set_pause (welt->is_paused () ^ 1 );
7240+ }
7241+ else {
7242+ env_t ::pause_server_no_clients = !env_t ::pause_server_no_clients;
7243+ if (socket_list_t::get_playing_clients () == 0 ) {
7244+ welt->set_pause (env_t ::pause_server_no_clients);
7245+ }
7246+ }
7247+ return false ;
7248+ }
7249+
7250+
7251+
7252+
7253+
72207254
72217255bool tool_show_trees_t::init ( player_t * )
72227256{
Original file line number Diff line number Diff line change @@ -737,17 +737,11 @@ class tool_error_message_t : public tool_t {
737737class tool_pause_t : public tool_t {
738738public:
739739 tool_pause_t () : tool_t (TOOL_PAUSE | SIMPLE_TOOL) {}
740- char const * get_tooltip (player_t const *) const OVERRIDE { return env_t ::networkmode ? translator::translate (" deactivated in online mode" ) : translator::translate (" Pause" ); }
741- image_id get_icon (player_t *) const OVERRIDE { return env_t ::networkmode ? IMG_EMPTY : icon; }
742- bool is_selected () const OVERRIDE { return welt->is_paused (); }
743- bool init ( player_t * ) OVERRIDE {
744- if ( !env_t ::networkmode ) {
745- welt->set_fast_forward (0 );
746- welt->set_pause ( welt->is_paused ()^1 );
747- }
748- return false ;
749- }
750- bool exit (player_t *s ) OVERRIDE { return init (s); }
740+ char const * get_tooltip (player_t const *) const OVERRIDE;
741+ image_id get_icon (player_t *) const OVERRIDE { return (env_t ::networkmode && !env_t ::server) ? IMG_EMPTY : icon; }
742+ bool is_selected () const { return env_t ::networkmode ? env_t ::pause_server_no_clients : welt->is_paused (); }
743+ bool init (player_t *) OVERRIDE;
744+ bool exit (player_t *s) OVERRIDE { return init (s); }
751745 bool is_init_keeps_game_state () const OVERRIDE { return !env_t ::networkmode; }
752746 bool is_work_keeps_game_state () const OVERRIDE { return !env_t ::networkmode; }
753747};
You can’t perform that action at this time.
0 commit comments