Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > IL-2 Sturmovik: Cliffs of Dover > FMB, Mission & Campaign builder Discussions

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 01-07-2012, 10:19 PM
podvoxx podvoxx is offline
Approved Member
 
Join Date: Feb 2010
Posts: 190
Default

My version of the localized messages.
No work on dedi
Code:
using System;
using System.Collections;
using maddox.game;
using maddox.game.world;
using maddox.GP;
using System.Collections.Generic;
using System.IO;

public class Mission : AMission
{
    //=========================LOCALIZATION=============================
    string[] languageArray = { "en", "ru", "de", "fr", "es", "cs", "it", "pl" };
	
    //******************Localize Message Method*******************
    private string getLocalizedMessage(string textTranslate)
    {
        
        string[] localizeArray;
        string langIndex = GamePlay.gpPlayer().LanguageName();  
        switch (textTranslate)
        {
            case "Welcome to our server.":
                {
                    localizeArray = new string[]
                    {
                        "Welcome to our server.EN",
                        "Добро пожаловать на наш сервер.RU",
                        "Welcome to our server.DE",
                        "Welcome to our server.FR",
                        "Welcome to our server.ES",
                        "Welcome to our server.CS",
                        "Welcome to our server.IT",
                        "Welcome to our server.PL"
                    };
                    return localizeArray.GetValue(Array.IndexOf(languageArray, langIndex)).ToString();
                } break;            
        }
        return textTranslate;
    }
    //======================================================================

    //******************Send Chat Message Method*******************
    private void sendChatMessageTo(int army, string msg, object[] parms)
    {
        List<Player> Players = new List<Player>();
        //Singleplayer or Dedi Server
        if (GamePlay.gpPlayer() != null)
        {
            if (GamePlay.gpPlayer().Army() == army || army == -1)
                Players.Add(GamePlay.gpPlayer());
        } // Multiplayer
        if (GamePlay.gpRemotePlayers() != null || GamePlay.gpRemotePlayers().Length > 0)
        {
            foreach (Player p in GamePlay.gpRemotePlayers())
            {
                if (p.Army() == army || army == -1)
                    Players.Add(p);
            }
        }
        if (Players != null && Players.Count > 0)
            GamePlay.gpLogServer(Players.ToArray(), msg, parms);
    }
	
	public override void OnBattleStarted()
    {
        base.OnBattleStarted();
        MissionNumberListener = -1;
		
	sendChatMessageTo(-1, getLocalizedMessage("Welcome to our server."), new object[] { });
    }
}

Last edited by podvoxx; 01-11-2012 at 06:57 AM.
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:56 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.