Esempio n. 1
0
 private static void Postfix(NetworkMessage msg)
 {
     if (!NetworkMatch.InLobby())
     {
         int           connectionId = msg.conn.connectionId;
         StringMessage levelNameMsg = new StringMessage(MPJoinInProgress.NetworkMatchLevelName());
         NetworkServer.SendToClient(connectionId, CustomMsgType.SceneLoad, levelNameMsg);
         StringMessage sceneNameMsg = new StringMessage(GameplayManager.m_level_info.SceneName);
         NetworkServer.SendToClient(connectionId, CustomMsgType.SceneLoaded, sceneNameMsg);
         Debug.Log("JIP: sending scene load " + levelNameMsg.value);
         Debug.Log("JIP: sending scene loaded " + sceneNameMsg.value);
     }
 }
Esempio n. 2
0
            static bool Prefix(UIElement __instance, Vector2 pos, int idx, bool mod1, Player player)
            {
                float num      = 535f;
                float middle_h = 55f;
                Color col_ub   = UIManager.m_col_ub0;

                col_ub.a = __instance.m_alpha;
                UIManager.DrawFrameEmptyCenter(pos, 17f, 17f, num, middle_h, col_ub, 7);
                bool flag     = (!mod1) ? (Player.Mp_modifier2 == idx) : (Player.Mp_modifier1 == idx);
                int  modIndex = idx + ((!mod1) ? 4 : 0);
                bool enabled  = NetworkMatch.InLobby() ? !((MPModPrivateData.ModifierFilterMask & 1 << modIndex) == 1 << modIndex) : false;

                __instance.SelectAndDrawCheckboxItem(Player.GetMpModifierName(idx, mod1), pos - Vector2.up * 10f, idx + ((!mod1) ? 4 : 0), flag, enabled, 1f, Player.GetMpModifierIcon(idx, mod1));
                pos.x -= num * 0.5f + 10f;
                pos.y += 30f;
                __instance.DrawStringSmall(Player.GetMpModifierDesc(idx, mod1), pos, 0.4f, StringOffset.LEFT, (!flag) ? UIManager.m_col_ub1 : UIManager.m_col_ui1, 1f, num - 40f);

                return(false);
            }
Esempio n. 3
0
 public static bool MaybeInLobby()
 {
     return(MPJoinInProgress.NetworkMatchEnabled || NetworkMatch.InLobby());
 }