Exemplo n.º 1
0
        private GameObject TalkVolumeCreator(TalkVolume tv)
        {
            if (!modTextures.ContainsKey("talkVol"))
            {
                Logger.LogError("Missing Talk Volume Texture!");
                return(null);
            }

            var collider = tv.gameObject.GetComponent <Collider>();

            if (collider is SphereCollider)
            {
                var talkSphere = collider as SphereCollider;
                var go         = GameObject.CreatePrimitive(PrimitiveType.Sphere);
                go.transform.position   = tv.transform.position;
                go.transform.localScale = talkSphere.bounds.size;
                var renderer = go.GetComponent <Renderer>();
                var shader   = Shader.Find("psx/trasparent/vertexlit");
                if (renderer && shader)
                {
                    for (int i = 0; i < renderer.materials.Length; ++i)
                    {
                        var matl = renderer.materials[i];
                        matl.shader = shader;
                        matl.SetTexture("_MainTex", modTextures["talkVol"]);
                        renderer.materials[i] = matl;
                    }
                }
                return(go);
            }
            return(null);
        }
Exemplo n.º 2
0
 /// <summary>
 ///   Set the last player chat(text) volume before it gets sent to other players.
 ///   - nTalkVolume: The new volume of the chat text to be sent onto other players.
 ///   TALKVOLUME_TALK
 ///   TALKVOLUME_WHISPER
 ///   TALKVOLUME_SHOUT
 ///   TALKVOLUME_SILENT_SHOUT (used for DM chat channel)
 ///   TALKVOLUME_PARTY
 ///   TALKVOLUME_TELL (sends the chat message privately back to the original speaker)
 ///   Note: The new chat message gets sent after the OnPlayerChat script exits.
 /// </summary>
 public static void SetPCChatVolume(TalkVolume nTalkVolume = TalkVolume.Talk)
 {
     Internal.NativeFunctions.StackPushInteger((int)nTalkVolume);
     Internal.NativeFunctions.CallBuiltIn(842);
 }
Exemplo n.º 3
0
 /// <summary>
 ///   Causes the object to instantly speak a translated string.
 ///   (not an action, not blocked when uncommandable)
 ///   - nStrRef: Reference of the string in the talk table
 ///   - nTalkVolume: TALKVOLUME_*
 /// </summary>
 public static void SpeakStringByStrRef(int nStrRef, TalkVolume nTalkVolume = TalkVolume.Talk)
 {
     Internal.NativeFunctions.StackPushInteger((int)nTalkVolume);
     Internal.NativeFunctions.StackPushInteger(nStrRef);
     Internal.NativeFunctions.CallBuiltIn(691);
 }
Exemplo n.º 4
0
 public void ModifyVolume(TalkVolume newVolume)
 {
     ModifiedVolume = (int)newVolume;
     NWScript.SetPCChatVolume(newVolume);
 }