Thread Rating:
  • 4 Vote(s) - 3.75 Average
  • 1
  • 2
  • 3
  • 4
  • 5
VDC v1.5
#31
Quote:The program currently only decrypts files via the import. Else it works entirely in unencrypted .txt format. What you did was save unencrypted text into a .dat file and then tried to decrypt that unencrytped file (you can do the same with a normal data changer: rename any .txt file to .dat and open that with it).

So I can use txt files instead of *.dat? Or files don't have to be decrypted after importing?

Quote:In turn every updated line has two undo steps, which is rather awkward. If anyone can find out how to modify the undo stack of the fast text box or replace a line in one step that'd help.


I will think about it.
You have infinite undo moves? Maybe it would be easier to just assign menu tool strip for undo to run double time the undo function?
like:
Code:
If (focus_set_to viewer mode_
{
undo()
undo()
}
Else{
undo()
}
This wouldn't be clean way for doing this but it might help temporary. Like I said, will think about it.
Reply
Thanks given by: YinYin
#32

Never mind what I said about any time soon on v1.2. Full .dat support is here. Be sure to test it backwards and upside down and keep making backups before you save over your .dat files.
(04-02-2015, 04:19 PM)YinYin Wrote:  v1.3
Full .dat support! Including a crude settings dialogue allowing you to change the font and the 123 characters preceding your saved .dat files. Also custom notifications in case your bitmaps don't show up in the frame viewer and triple undo/redo to skip the line delete/insert steps.
Also if you aren't working in a folder structure containing an lf2.exe consider creating an empty file named lf2.exe to mark your root folder.
Reply
Thanks given by: Deep
#33
@YinYin: You could try to implement the following in order to not rely on lf2.exe being called lf2.exe (or that it even exists):
    C++-Code:
string Directory = GetFileDirectory();
 
bool DirectoryFound = false;
while(UpOneDirectory(Directory) && !DirectoryFound){
    bool FoundAllFiles = true;
    for(int i = 0;i<BitmapFilenames.size();++i){
        if(!FileExists(Directory+BitmapFilenames[i])){
            FoundAllFiles = false;
            break;
        }
    }
}
 
if(!DirectoryFound) return;//could not find directory
 
//load files
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Reply
Thanks given by: YinYin
#34
(04-15-2015, 12:49 PM)Someone else Wrote:  @YinYin: You could try to implement the following in order to not rely on lf2.exe being called lf2.exe (or that it even exists):
I'd very much like it to be that way, but my implementation is awfully slow whenever the folder structure is a bit deeper or the directory could not be found:
    CSHARP-Code:
private void open(string args)
        {        
            //
            //opening stuff and bmp_begin parsing
            //
 
            lf2root = Path.GetDirectoryName(args) + "\\";
            bool DirectoryFound = false;
            do
            {
                DirectoryFound = true;
                for (int i = 0; i < global.objectfile.bmp_begin.bmps.Count; i++)
                {
                    if (!File.Exists(lf2root + global.objectfile.bmp_begin.bmps[i].path))
                    {
                        DirectoryFound = false;
                        break;
                    }
                }
            } while (!DirectoryFound && UpOneDirectory(ref lf2root));
            if (!DirectoryFound) lf2root = "\\\\"; //indication of unfound root directory from previous implementation
 
            /*/get lf2.exe path - previous implementation
            lf2root = Path.GetDirectoryName(args) + "\\lf2.exe";
            while (!File.Exists(lf2root) && lf2root.Length > 10)
                lf2root = lf2root.Substring(0,
                    lf2root.Length
                    - new DirectoryInfo(Path.GetDirectoryName(lf2root)).Name.Length
                    - Path.GetFileName(lf2root).Length - 2) + "\\lf2.exe";
            lf2root = Path.GetDirectoryName(lf2root) + "\\";*/
        }
 
        private bool UpOneDirectory(ref string lf2root)
        {
            if (lf2root.Length > 4)
            {
                lf2root = lf2root.Substring(0, lf2root.Length - new DirectoryInfo(Path.GetDirectoryName(lf2root + "\\")).Name.Length);
                return true;
            }
            return false;
        }
With the lf2.exe marker it's all snappy and fast, with a quick note on what to do in case no marker was found.
Reply
Thanks given by:
#35
(04-15-2015, 02:45 PM)YinYin Wrote:  With the lf2.exe marker it's all snappy and fast, with a quick note on what to do in case no marker was found.
I tried this code out:
    CSHARP-Code:
using System.IO;
using System.Diagnostics;
using System.Collections.Generic;
 
namespace StupidLanguage
{
    class Bmp
    {
        public Bmp(string path_) {
            path = path_;
        }
 
        public string path;
    }
 
    class BmpBegin
    {
        public BmpBegin() {
            bmps.Add(new Bmp("sprite\\sys\\knight_0.bmp"));
            bmps.Add(new Bmp("sprite\\sys\\knight_1.bmp"));
            bmps.Add(new Bmp("sprite\\sys\\knight_2.bmp"));
            bmps.Add(new Bmp("sprite\\sys\\knight_0b.bmp"));
            bmps.Add(new Bmp("sprite\\sys\\knight_1b.bmp"));
            bmps.Add(new Bmp("sprite\\sys\\knight_2b.bmp"));
        }
 
        public List<Bmp> bmps = new List<Bmp>();
    }
 
    class ObjectFile
    {
        public BmpBegin bmp_begin = new BmpBegin();
    }
 
    class Global
    {
        public ObjectFile objectfile = new ObjectFile();
    }
 
    class Program
    {
        static Global global = new Global();
 
        static void Main(string[] args)
        {
            Stopwatch Countdown = Stopwatch.StartNew();
            string a = open("D:\\LF2\\LF2_v2.0a\\data\\knight.dat");
            Countdown.Stop();
            System.Console.WriteLine(Countdown.Elapsed);
            System.Console.WriteLine(a);
        }
 
        private static string open(string args)
        {
            string lf2root = Path.GetDirectoryName(args) + "\\";
            bool DirectoryFound = false;
            do
            {
                DirectoryFound = true;
                for (int i = 0; i < global.objectfile.bmp_begin.bmps.Count; i++)
                {
                    if (!File.Exists(lf2root + global.objectfile.bmp_begin.bmps[i].path))
                    {
                        DirectoryFound = false;
                        break;
                    }
                }
            } while (!DirectoryFound && UpOneDirectory(ref lf2root));
            if (!DirectoryFound) lf2root = "\\\\"; //indication of unfound root directory from previous implementation
 
            /*/get lf2.exe path - previous implementation
            lf2root = Path.GetDirectoryName(args) + "\\lf2.exe";
            while (!File.Exists(lf2root) && lf2root.Length > 10)
                lf2root = lf2root.Substring(0,
                    lf2root.Length
                    - new DirectoryInfo(Path.GetDirectoryName(lf2root)).Name.Length
                    - Path.GetFileName(lf2root).Length - 2) + "\\lf2.exe";
            lf2root = Path.GetDirectoryName(lf2root) + "\\";*/
 
            return lf2root;
        }
 
        private static bool UpOneDirectory(ref string lf2root)
        {
            if (lf2root.Length > 4)
            {
                lf2root = lf2root.Substring(0, lf2root.Length - new DirectoryInfo(Path.GetDirectoryName(lf2root + "\\")).Name.Length);
                return true;
            }
            return false;
        }
    }
}

It runs in 0.0004920 seconds on my PC. How long does it take on yours?
Age ratings for movies and games (and similar) have never been a good idea.
One can learn a lot from reinventing wheels.
An unsound argument is not the same as an invalid one.
volatile in C++ does not mean thread-safe.
Do not make APIs unnecessarily asynchronous.
Make C++ operator > again
Trump is an idiot.
Reply
Thanks given by: YinYin , MH-LABEEB
#36
(04-15-2015, 03:42 PM)Someone else Wrote:  It runs in 0.0004920 seconds on my PC. How long does it take on yours?

~0.0006 seconds
~0.001 if I ramp up to 7 folders deep instead of 3.

Guess I gotta look for my culprit elsewhere.
Reply
Thanks given by: Som1Lse
#37
Update
(04-02-2015, 04:19 PM)YinYin Wrote:  v1.4
A smaller update. Mostly allowing you to still edit frame data visually even if there is no picture found. Also working without an lf2.exe to locate bitmaps. And auto indenting and formatting has been improved to better work with single line tags and you can also turn it off in the settings.
Reply
Thanks given by: Kim_Bo
#38
I easly approve this.
This is great tool.
I am still missing 'go to frame x' option, sometimes helpful.
Reply
Thanks given by: Deep
#39
(05-20-2015, 05:56 PM)Gad Wrote:  I easly approve this.
This is great tool.
I am still missing 'go to frame x' option, sometimes helpful.

You can do Ctrl+F -> type in "> x"
[Image: signature.png]
A-Engine: A new beat em up game engine inspired by LF2. Coming soon

A-Engine Dev Blog - Update #8: Timeout

Reply
Thanks given by: AmadisLFE , Som1Lse
#40
I know, i am doing that. Still it could use that funcion.
Reply
Thanks given by:




Users browsing this thread: 6 Guest(s)