Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - V10

#1
Outdated / Re: [A11b] Pawn State Icons (v04c) 22.07.2015
September 06, 2015, 01:14:22 PM
Quote from: Florius on September 06, 2015, 07:07:20 AM
Quote from: V10 on September 06, 2015, 06:48:36 AM
There version compiled for v12, with sources.
http://v10.name/files/Pawn%20State%20Icons.rar

Where did you get that from?
LOL. I fixed it and compile.
#2
Outdated / Re: [A11b] Pawn State Icons (v04c) 22.07.2015
September 06, 2015, 06:48:36 AM
There version compiled for v12, with sources.
http://v10.name/files/Pawn%20State%20Icons.rar
#3
Help / Re: Hooking game\sound events
July 20, 2014, 10:23:42 AM
Quote from: mrofa on July 19, 2014, 04:32:04 PM
LetterStack is a hook for letter stuff
Nope.  :)
There no functions for give me callback on letter recieved by game.


public static LetterStack LetterStack
{
    get
    {
        return Map.letterStack;
    }
}



namespace Verse
{
    using System;
    using System.Collections.Generic;
    using System.Runtime.CompilerServices;
    using UnityEngine;
    using Verse.Sound;

    public class LetterStack : Saveable
    {
        [CompilerGenerated]
        private static Predicate<Letter> <>f__am$cache2;
        private float lastTopYInt;
        private List<Letter> letters = new List<Letter>();
        private const float LettersBottomY = 350f;
        public const float LetterSpacing = 12f;

        public void ExposeData()
        {
            Scribe_Collections.LookList<Letter>(ref this.letters, "letters", LookMode.Deep, null);
        }

        public void LettersOnGUI()
        {
            float topY = (Screen.height - 350f) - 30f;
            for (int i = this.letters.Count - 1; i >= 0; i--)
            {
                this.letters[i].DrawButtonAt(topY);
                topY -= 42f;
            }
            this.lastTopYInt = topY;
        }

        public void LettersUpdate()
        {
            if (<>f__am$cache2 == null)
            {
                <>f__am$cache2 = l => !l.Valid;
            }
            this.letters.RemoveAll(<>f__am$cache2);
        }

        public void ReceiveLetter(Letter let)
        {
            SoundDef.Named("LetterArrive").PlayOneShotOnCamera();
            this.letters.Add(let);
            let.arrivalTime = Time.time;
        }

        public void RemoveLetter(Letter let)
        {
            this.letters.Remove(let);
        }

        public float LastTopY
        {
            get
            {
                return this.lastTopYInt;
            }
        }
    }
}



#4
Help / Re: Hooking game\sound events
July 19, 2014, 04:25:36 PM
Quote from: mrofa on July 19, 2014, 02:01:56 PM
Sorry mate my english and codding sux and im completly have no idea what you want then :D
But you could try check out solarflare and raid incidents in ilspy
http://en.wikipedia.org/wiki/Hooking
#5
Help / Re: Hooking game\sound events
July 19, 2014, 04:10:57 AM
Quote from: mrofa on July 18, 2014, 05:39:32 PM
I did give you the hook
nope =)
You give code for call event, not hook.
#6
Help / Re: Hooking game\sound events
July 18, 2014, 12:11:27 PM
Something like this:
public void myDelegate(SoundDef soundDef)
{
// Here my code
}

SoundClass.HookEvent("LetterArrive", myDelegate);


If this game has beeen writen in c++, I can easily hook function SoundDef.PlayOneShot by ms detours, but in c# it very hard. Maybe game have internal functions for hooking events?
#7
Help / Re: Hooking game\sound events
July 18, 2014, 12:07:25 PM
Quote from: mrofa on July 18, 2014, 11:56:48 AM
I think that
private static readonly SoundDef HitGroundSound = SoundDef.Named("BulletImpactGround");
Boomerang.HitGroundSound.PlayOneShot(base.Position);

This code show how to initiate a sound event.
I need to hook event (LetterArrive) and do something if event has been started.
#8
Help / Hooking game\sound events
July 18, 2014, 11:50:33 AM
Hi all.
I good known C#.
I trying to create mod.
How I can hook game or sound events like LetterArrive?