News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

.

Started by RESTRICTED ACCOUNT, May 04, 2024, 09:50:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

How do personal messages work? The best thing would be to display a list of available companies to choose who to send the message to.
Screenshot_2024-05-22-09-59-32-149_com.simutrans.jpg

RESTRICTED ACCOUNT

#36
 :)

Yona-TYT

It would be great if the coordinates could be chosen on the map with a special tool, and that the text also appeared on the map as a text label 🏷�, however restrictions would have to be added such as a limited number of labels displayed simultaneously, which would disappear after a while, and that they can be removed by the player who placed them.

Andarix

r11230

resize window on company_chat

Screenshot 2024-05-22 215637.png

prissi

The crash should be fixed. The sticky bottom to show the last message still needs work.

RESTRICTED ACCOUNT

#40
 ???

Andarix

Quote from: prissi on May 23, 2024, 02:15:46 PMThe crash should be fixed. The sticky bottom to show the last message still needs work.

crash is fixed r11232

other problem

The text 'company name' and 'direct chat to:' shows public_chat.
Switches from the respective chat to the public_chat. Then the texts will be displayed there.

prissi

@Andarix:
Sorry, did not understand your problem => please

@Ranran:
Arrows and copying works left and right for me.
And sorry, I am not sure what you mean. The last time I used ingame messages was in 2017 ... So I am not sure what you want to change.

Andarix

Quote from: prissi on May 24, 2024, 01:03:21 PM@Andarix:
Sorry, did not understand your problem => please
...

Screenshot 2024-05-24 150829.png

RESTRICTED ACCOUNT

#44
 :P

Andarix

standard r11237 Linux/mac not compile

Quote...
2024-05-26T06:30:19.9279277Z In file included from /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc:17:
2024-05-26T06:30:19.9282799Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/../network/network_cmd_ingame.h: In constructor 'nwc_chat_t::nwc_chat_t(const char*, sint8, sint8, const char*, const char*, koord)':
2024-05-26T06:30:19.9286417Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/../network/network_cmd_ingame.h:96:14: warning: 'nwc_chat_t::destination' will be initialized after [-Wreorder]
2024-05-26T06:30:19.9289144Z    96 |  plainstring destination;        // Client to send message to (NULL for all)
2024-05-26T06:30:19.9290179Z      |              ^~~~~~~~~~~
2024-05-26T06:30:19.9292208Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/../network/network_cmd_ingame.h:94:8: warning:  'koord nwc_chat_t::pos' [-Wreorder]
2024-05-26T06:30:19.9294054Z    94 |  koord pos;
2024-05-26T06:30:19.9294579Z      |        ^~~
2024-05-26T06:30:19.9295710Z In file included from /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc:17:
2024-05-26T06:30:19.9298207Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/../network/network_cmd_ingame.h:83:2: warning:  when initialized here [-Wreorder]
2024-05-26T06:30:19.9300996Z    83 |  nwc_chat_t (const char* msg = NULL, sint8 pn = -1, sint8 ch= -1, const char* cn = NULL, const char* dn = NULL, koord pos_=koord::invalid)
2024-05-26T06:30:19.9302390Z      |  ^~~~~~~~~~
2024-05-26T06:30:19.9439921Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc: In constructor 'gui_chat_balloon_t::gui_chat_balloon_t(const chat_message_t::chat_node*, scr_coord_val)':
2024-05-26T06:30:19.9443595Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc:172:36: error: invalid conversion from 'sint64*' {aka 'long long int*'} to 'const time_t*' {aka 'const long int*'} [-fpermissive]
2024-05-26T06:30:19.9445865Z  172 |    struct tm* tm_event = localtime(&msg_time);
2024-05-26T06:30:19.9446785Z      |                                    ^~~~~~~~~
2024-05-26T06:30:19.9447589Z      |                                    |
2024-05-26T06:30:19.9448353Z      |                                    sint64* {aka long long int*}
2024-05-26T06:30:19.9449642Z In file included from /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc:6:
2024-05-26T06:30:19.9451450Z /usr/include/time.h:123:44: note:  initializing argument 1 of 'tm* localtime(const time_t*)'
2024-05-26T06:30:19.9452802Z  123 | extern struct tm *localtime (const time_t *__timer) __THROW;
2024-05-26T06:30:19.9453818Z      |                              ~~~~~~~~~~~~~~^~~~~~~
2024-05-26T06:30:19.9561669Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc: In member function 'void chat_frame_t::fill_list()':
2024-05-26T06:30:19.9564973Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc:479:47: warning: comparison of integer expressions of different signedness: 'int' and 'uint32' {aka 'unsigned int'} [-Wsign-compare]
2024-05-26T06:30:19.9567641Z  479 |  if (cb_direct_chat_targets.count_elements() != chat_history.get_count()) {
2024-05-26T06:30:19.9568726Z      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
2024-05-26T06:30:19.9590577Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc: In member function 'virtual bool chat_frame_t::action_triggered(gui_action_creator_t*, value_t)':
2024-05-26T06:30:19.9593648Z /home/runner/work/simutrans/simutrans/src/simutrans/gui/chat_frame.cc:496:73: warning: unused parameter 'v' [-Wunused-parameter]
2024-05-26T06:30:19.9595602Z  496 | bool chat_frame_t::action_triggered(gui_action_creator_t* comp, value_t v)
2024-05-26T06:30:19.9596822Z      |                                                                ~~~~~~~~^
2024-05-26T06:30:20.0439445Z make[2]: *** [CMakeFiles/simutrans.dir/build.make:1728: CMakeFiles/simutrans.dir/src/simutrans/gui/chat_frame.cc.o] Error 1
2024-05-26T06:30:20.0441035Z make[2]: *** Waiting for unfinished jobs....
2024-05-26T06:30:20.5123682Z make[1]: *** [CMakeFiles/Makefile2:118: CMakeFiles/simutrans.dir/all] Error 2
2024-05-26T06:30:20.5124811Z make: *** [Makefile:136: all] Error 2
2024-05-26T06:30:20.5144962Z ##[error]Process completed with exit code 2.

Quote...
2024-05-26T06:30:02.3325239Z ===> HOSTCXX src/simutrans/gui/chat_frame.cc
2024-05-26T06:30:03.0030059Z In file included from src/simutrans/gui/chat_frame.cc:17:
2024-05-26T06:30:03.0032632Z src/simutrans/gui/../network/network_cmd_ingame.h:84:94: warning: field 'destination' will be initialized after field 'pos' [-Wreorder-ctor]
2024-05-26T06:30:03.0035112Z         : network_command_t(NWC_CHAT), message(msg), player_nr(pn), channel_nr(ch), clientname(cn), destination(dn), pos(pos_) {}
2024-05-26T06:30:03.0042494Z                                                                                     ~~~~~~~~~~~~~~  ^~~~~~~~~~~~~~~  ~~~~~~~~~
2024-05-26T06:30:03.0043890Z                                                                                     pos(pos_)       clientname(cn)   destination(dn)
2024-05-26T06:30:03.0046156Z src/simutrans/gui/chat_frame.cc:69:7: warning: 'action_triggered' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2024-05-26T06:30:03.0047996Z         bool action_triggered(gui_action_creator_t* comp, value_t) {
2024-05-26T06:30:03.0048812Z              ^
2024-05-26T06:30:03.0050009Z src/simutrans/gui/components/action_listener.h:29:15: note: overridden virtual function is here
2024-05-26T06:30:03.0051472Z         virtual bool action_triggered(gui_action_creator_t *comp, value_t extra) = 0;
2024-05-26T06:30:03.0052406Z                      ^
2024-05-26T06:30:03.0054195Z src/simutrans/gui/chat_frame.cc:214:14: warning: 'get_text' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2024-05-26T06:30:03.0055874Z         char const* get_text() const { return ""; }
2024-05-26T06:30:03.0056615Z                     ^
2024-05-26T06:30:03.0057804Z src/simutrans/gui/components/gui_scrolled_list.h:59:23: note: overridden virtual function is here
2024-05-26T06:30:03.0059156Z                 virtual char const* get_text() const = 0;
2024-05-26T06:30:03.0059962Z                                     ^
2024-05-26T06:30:03.0062033Z src/simutrans/gui/chat_frame.cc:278:7: warning: 'infowin_event' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
2024-05-26T06:30:03.0063772Z         bool infowin_event(const event_t* ev)
2024-05-26T06:30:03.0064550Z              ^
2024-05-26T06:30:03.0065708Z src/simutrans/gui/components/gui_component.h:180:15: note: overridden virtual function is here
2024-05-26T06:30:03.0067057Z         virtual bool infowin_event(const event_t *) {
2024-05-26T06:30:03.0067843Z                      ^
2024-05-26T06:30:03.0069202Z src/simutrans/gui/chat_frame.cc:172:26: error: no matching function for call to 'localtime'
2024-05-26T06:30:03.0074187Z                         struct tm* tm_event = localtime(&msg_time);
2024-05-26T06:30:03.0075102Z                                               ^~~~~~~~~
2024-05-26T06:30:03.0077487Z /usr/include/time.h:136:19: note: candidate function not viable: no known conversion from 'sint64 *' (aka 'long long *') to 'const time_t *' (aka 'const long *') for 1st argument
2024-05-26T06:30:03.0079468Z extern struct tm *localtime (const time_t *__timer) __THROW;
2024-05-26T06:30:03.0080320Z                   ^
2024-05-26T06:30:03.0082167Z src/simutrans/gui/chat_frame.cc:479:47: warning: comparison of integers of different signs: 'int' and 'uint32' (aka 'unsigned int') [-Wsign-compare]
2024-05-26T06:30:03.0084123Z                 if (cb_direct_chat_targets.count_elements() != chat_history.get_count()) {
2024-05-26T06:30:03.0085266Z                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~
2024-05-26T06:30:03.0087205Z src/simutrans/gui/chat_frame.cc:496:73: warning: unused parameter 'v' [-Wunused-parameter]
2024-05-26T06:30:03.0106939Z bool chat_frame_t::action_triggered(gui_action_creator_t* comp, value_t v)
2024-05-26T06:30:03.0108014Z                                                                         ^
2024-05-26T06:30:03.0109034Z 6 warnings and 1 error generated.
2024-05-26T06:30:03.0109968Z make: *** [common.mk:51: build/default/src/simutrans/gui/chat_frame.o] Error 1
2024-05-26T06:30:03.0111057Z make: *** Waiting for unfinished jobs....
2024-05-26T06:30:03.6091206Z ##[error]Process completed with exit code 2.

windows compile

RESTRICTED ACCOUNT

#46
 :-[

prissi

Thank you, the localtime is fixed.

First, I did not get crashes with your file. But when testing I noted that the colors of the chat ballon in the MinGW compiled version were weaker than in the MSVC version which points to an int size issue since when both compiler as 32 bit the sizes where similar ...

r11328 did not crash for me when testing, running the server in the MSVC debugger and the clients as MSVC builds.

At which point does it crash for you?

RESTRICTED ACCOUNT

#48
 :-*

prissi

Not sure why? set_size(get_min_size()) should set exactly the needed size. This looks like one routine has a pixel more taking into account. Investigating.

Andarix

Since chat is now a separate window, what about the chat setting in the message options?

FLN

To all involved, but especially @Ranran, thank you for the really nice chat window =))
I like it very much.
I too do enjoy, that the cursor now stays in the input box after sending/posting a message. That's really comfortable. I love it  ^-^
Thanks you all again for making it work  :thumbsup:

Yona-TYT

I would like to make chat message notifications clickable so that they open the chat window: https://forum.simutrans.com/index.php/topic,23155.0.html


prissi

I was told that changing to private chat and back, one cannot public chat anymore. Investigating.

FLN

Quote from: prissi on July 30, 2024, 06:15:31 AMI was told that changing to private chat and back, one cannot public chat anymore. Investigating.
I can confirm that.
See bug report.

FLN

I'd like to add following suggestions to the dear chat-window-team =)

I'm not sure whether here is the appropriated thread to place this. So if not, please point me to the right thread.

  • Messages from the private chat will show up in the public chat.
    When one of the private chat's parties leaves the game or get's disconnected, while the other person was typing a new message, their input will be prompted in the public chat.
    Nothing that worries me too much, but it seams to bother others.
    Could this be prevented?
  • When getting unwillingly disconnected, all private chat's histories gets lost.
    Would it be possible to have persisting private chats, like in the public chat?

    I understand that there is some difficulty in this, as individual players are not uniquely identified (i think) in an multiplayer game, and whilst not having registered and unique user profiles, this can be somewhat of an delicate thing. Certainly in respect of the privacy of any privat conversation.

    But I wondered nonetheless if it would be possible to make this happen?
    E.g. by simultaneously saving a copy of the private chat's histories on the individual systems of the involved clients, for instance.
    Thus, corresponding parties chats could be re-matched, when they reencounter on a server game.
    (I know this is really hypothetic and I certainly don't know the possibility's and limitations of the 'chat window'.  :))

Thank you for your insights =)

Yona-TYT

I was looking at the code and the logic that decides if a message is public, private or company is not working well, in my tests there was no difference between a private and a public message when the message is sent in "ticker::add_chat_msg".

https://github.com/simutrans/simutrans/blob/629ff76f71d2d59f7d3e84485194d4f5e2bce826/src/simutrans/simmesg.cc#L401

if (player != world()->get_active_player()) {
// so it is not a message sent from us
bool show_message = channel == -1; // message for all?
show_message |= channel == world()->get_active_player_nr(); // company message for us?
show_message |= recipient && strcmp(recipient, env_t::nickname.c_str()) == 0; // private chat for us?
if(show_message) {
buf.printf("%s: %s", sender_.c_str(), text);
ticker::add_msg(buf, koord3d::invalid, PLAYER_FLAG|sender_nr);
env_t::chat_unread_public++;
sound_play(sound_desc_t::message_sound, 255, TOOL_SOUND);
}
}

FLN

#57
Andarix discovered, that, when before switching back to public chat, it helps to set the privat chat selector on 'show all'.
(this is also commented in  the corresponding bug report)

prissi

Indeed, that was a variable which should be only set for the private chat. Fixed in r11371

Yona-TYT

QuoteDouble-clicking on any bubble will copy it?s contained text to your clipboard, accompanied by a notification 'copied'. This is especially helpful when exchanging article URLs from the forum for instance.

This is not working as expected, currently the double click event only works on the text and not on the bubble. If the text is very short then it is very difficult to copy it, especially on android.

prissi

As I found the copying popup rather annoying, and checking for hinting the bubble was more code, I left it like that. Is really someone using this?

Yona-TYT

Quote from: prissi on September 01, 2024, 12:01:37 AMAs I found the copying popup rather annoying, and checking for hinting the bubble was more code, I left it like that. Is really someone using this?
Gosh, I didn't think it was that tedious. :o