Ticket #1949: rejoined_message_wip_v1.patch

File rejoined_message_wip_v1.patch, 1.8 KB (added by elexis, 9 years ago)

This patch implements that a message is automatically sent as soon as the client finished the loading screen on rejoin. TODO: (1) change the "(player)s has joined the game" message (translation files) and (2) probably implement a custom network message command, if the regular chat function shouldn't be used.

  • binaries/data/mods/public/gui/gamesetup/gamesetup_mp.js

     
    111111                Engine.SwitchGuiPage("page_loading.xml", {
    112112                    "attribs": g_GameAttributes,
    113113                    "isNetworked" : true,
     114                    "isRejoining" : g_IsRejoining,
    114115                    "playerAssignments": g_PlayerAssignments
    115116                });
    116117                break;
  • binaries/data/mods/public/gui/loading/loading.js

     
    113113
    114114    // Restore default cursor.
    115115    Engine.SetCursor("arrow-default");
     116   
     117    if (g_Data.isNetworked && g_Data.isRejoining) {
     118        Engine.SendNetworkChat("/me rejoined the game");
     119    }
    116120}
  • source/ps/Game.cpp

     
    235235    if (CRenderer::IsInitialised())
    236236        Render();
    237237
     238    if (g_NetClient)
     239        g_NetClient->LoadFinished();
     240
    238241    // Call the reallyStartGame GUI function, but only if it exists
    239242    if (g_GUI && g_GUI->HasPages())
    240243    {
     
    243246            g_GUI->GetActiveGUI()->GetScriptInterface()->CallFunctionVoid(global, "reallyStartGame");
    244247    }
    245248
    246     if (g_NetClient)
    247         g_NetClient->LoadFinished();
    248 
    249249    debug_printf("GAME STARTED, ALL INIT COMPLETE\n");
    250250
    251251    // The call tree we've built for pregame probably isn't useful in-game.