Ejemplo n.º 1
0
    void AddMap()
    {
        if (LstMaps.CurrentSelection < 0)
        {
            return;
        }

        string mapluafile = MapLuaFiles[LstMaps.CurrentSelection];

        int[] modeIndices = LstModes.GetCheckedIndices();
        int[] eraIndices  = LstEras.GetCheckedIndices();

        for (int i = 0; i < modeIndices.Length; ++i)
        {
            SubIcon modeSub = ModeSubs[modeIndices[i]];

            for (int j = 0; j < eraIndices.Length; j++)
            {
                SubIcon eraSub = EraSubs[eraIndices[j]];

                string         mapName = ENV.GetLocalizedMapName(mapluafile);
                PhxListBoxItem item    = LstRotation.AddItem(mapName);
                item.SetIcon(modeSub.Icon);
                item.SetIcon2(eraSub.Icon);

                string mapScript = SWBFHelpers.Format(mapluafile, eraSub.Sub, modeSub.Sub);
                RotationLuaFiles.Add(mapScript);
            }
        }
    }
Ejemplo n.º 2
0
    public static string ScriptCB_usprintf([Unicode] object[] args)
    {
        Debug.Assert(args.Length > 1);

        // first argument is the localize path, the rest are format placements
        string localizePath = args[0] as string;

        object[] placements = new object[args.Length - 1];
        Array.Copy(args, 1, placements, 0, placements.Length);

        string localized = ENV.GetLocalized(localizePath);
        string res       = SWBFHelpers.Format(localized, placements);

        return(res);
    }