Fragjacker / DoW-Mod-Manager

The original repository for the DoW Mod Manager application, which was made for the Dawn of War:tm: series.
MIT License
32 stars 7 forks source link

New 1.6.0 release - reporting for duty! #7

Closed IgorTheLight closed 4 years ago

IgorTheLight commented 4 years ago
Fragjacker commented 4 years ago

Oh this is nice! A merge request going down already 😀 . I also like those refactorings since nice readable code is always appreciated.

I will test this ASAP!

Fragjacker commented 4 years ago

One thing I noticed is that when you launch the app from the wrong place you get 3 error windows. I think it would be better to have one error window that shows you all the issues that appeared when attempting to start the app.

IgorTheLight commented 4 years ago

Thanks - I'll fix that very soon!

On Sat, May 30, 2020 at 7:26 PM Dennis S. notifications@github.com wrote:

One thing I noticed is that when you launch the app from the wrong place you get 3 error windows. I think it would be better to have one error window that shows you all the issues that appeared when attempting to start the app.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-636353723, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3ZIDUXBGNCYVO4SL6TRUEXSJANCNFSM4NOLJIJQ .

IgorTheLight commented 4 years ago

I see the typo. Thanks!

On Sat, May 30, 2020 at 7:43 PM Dennis S. notifications@github.com wrote:

@Fragjacker requested changes on this pull request.

Alright it looks pretty good so far. Spotted only a typo in the new starting option: [image: image] https://user-images.githubusercontent.com/19975052/83333981-ca8f9d80-a2a3-11ea-9a47-51e65bbbe77e.png I would change this line to Set to highest thread priority and CPU affinity

Other then that it looks pretty solid!

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#pullrequestreview-421426787, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F32XNTC7L6OUUOVAVI3RUEZSJANCNFSM4NOLJIJQ .

IgorTheLight commented 4 years ago

I found the reason for that - that happens because I don't use Form_Load() event anymore. I do so because Form constructor is easier to debug. But now what happens is that all initialization methods are called - even if first one tries to close the Application. I probably could do something about that but I suggest to leave it as is for 1.6.0 In 1.6.1 I will make "user experience" more smooth :-)

On Sat, May 30, 2020 at 10:22 PM Igor Sandu igorthelight@gmail.com wrote:

Thanks - I'll fix that very soon!

On Sat, May 30, 2020 at 7:26 PM Dennis S. notifications@github.com wrote:

One thing I noticed is that when you launch the app from the wrong place you get 3 error windows. I think it would be better to have one error window that shows you all the issues that appeared when attempting to start the app.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-636353723, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3ZIDUXBGNCYVO4SL6TRUEXSJANCNFSM4NOLJIJQ .

IgorTheLight commented 4 years ago

I fixed the problem!

On Sat, May 30, 2020 at 10:55 PM Igor Sandu igorthelight@gmail.com wrote:

I found the reason for that - that happens because I don't use Form_Load() event anymore. I do so because Form constructor is easier to debug. But now what happens is that all initialization methods are called - even if first one tries to close the Application. I probably could do something about that but I suggest to leave it as is for 1.6.0 In 1.6.1 I will make "user experience" more smooth :-)

On Sat, May 30, 2020 at 10:22 PM Igor Sandu igorthelight@gmail.com wrote:

Thanks - I'll fix that very soon!

On Sat, May 30, 2020 at 7:26 PM Dennis S. notifications@github.com wrote:

One thing I noticed is that when you launch the app from the wrong place you get 3 error windows. I think it would be better to have one error window that shows you all the issues that appeared when attempting to start the app.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-636353723, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3ZIDUXBGNCYVO4SL6TRUEXSJANCNFSM4NOLJIJQ .

IgorTheLight commented 4 years ago

Nice! :-)

On Sun, May 31, 2020 at 1:42 PM Dennis S. notifications@github.com wrote:

@Fragjacker approved this pull request.

Alright all looks well now and approve-able for merging!

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#pullrequestreview-421482014, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3Y3TH53AXEUMBH7B73RUIYBVANCNFSM4NOLJIJQ .

IgorTheLight commented 4 years ago

I have a small request for you - make a new application screenshot for 1.6.0 My plans for 1.7.0:

On Sun, May 31, 2020 at 4:34 PM Igor Sandu igorthelight@gmail.com wrote:

Nice! :-)

On Sun, May 31, 2020 at 1:42 PM Dennis S. notifications@github.com wrote:

@Fragjacker approved this pull request.

Alright all looks well now and approve-able for merging!

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#pullrequestreview-421482014, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3Y3TH53AXEUMBH7B73RUIYBVANCNFSM4NOLJIJQ .

Fragjacker commented 4 years ago

Uh that sounds cool, I always wanted to implement this! In fact there is still an unused coloration code that painted text orange in case it was marked as outdated so an user could easily see what needs to be updated. So how do you want to tackle the issues? As that is what has really hold me back to pursue this more. Stuff like:

I'd be really intrigued if you have found solutions for these problems.

IgorTheLight commented 4 years ago

Well... I know that this addition will be hard. I will try to find some "hacky" way to handle this. At worst scenario I will just open the Download page on ModDb. I know, that is very cheap. But that will be the first step. So my plan is:

On Mon, Jun 1, 2020 at 4:44 PM Dennis S. notifications@github.com wrote:

Uh that sounds cool, I always wanted to implement this! In fact there is still an unused coloration code that painted text orange in case it was marked as outdated so an user could easily see what needs to be updated. So how do you want to tackle the issues? As that is what has really hold me back to pursue this more. Stuff like:

  • Mods aren't hosted uniformly on a single page.
  • Pages like Moddb don't allow for direct FTP protocol downloads and Mediafire even does captchas
  • Version numbers in .module files may not be correct.
  • How will you know what is outdated and what not?
  • Where and how will you download the mods from?

I'd be really intrigued if you have found solutions for these problems.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-636869080, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3ZEELERZTXCAGCCS5DRUOWEBANCNFSM4NOLJIJQ .

IgorTheLight commented 4 years ago

I see that you are developing 1.6.1 - that's a great news! I will check it out when you will create a release tag. Also - you didn't added the way for 'non-programmers' to get 1.6.0 :-) About my progress:

On Mon, Jun 1, 2020 at 8:14 PM Igor Sandu igorthelight@gmail.com wrote:

Well... I know that this addition will be hard. I will try to find some "hacky" way to handle this. At worst scenario I will just open the Download page on ModDb. I know, that is very cheap. But that will be the first step. So my plan is:

  • Step 1 - just select the popular mod and ModDownloader will open the Download page on ModDb. Still better than search for yourself :-)
  • Step 2 - select the popular mod and ModDownloader will download the mod in some folder. Probably "Downloaded mods". User will have to unzip and place it himself.
  • Step 3 - same as previous but mod will be unzipped and copied to the right place. If mod is an executable - it will be launched. Of course the second step will be the hardest.

On Mon, Jun 1, 2020 at 4:44 PM Dennis S. notifications@github.com wrote:

Uh that sounds cool, I always wanted to implement this! In fact there is still an unused coloration code that painted text orange in case it was marked as outdated so an user could easily see what needs to be updated. So how do you want to tackle the issues? As that is what has really hold me back to pursue this more. Stuff like:

  • Mods aren't hosted uniformly on a single page.
  • Pages like Moddb don't allow for direct FTP protocol downloads and Mediafire even does captchas
  • Version numbers in .module files may not be correct.
  • How will you know what is outdated and what not?
  • Where and how will you download the mods from?

I'd be really intrigued if you have found solutions for these problems.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-636869080, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3ZEELERZTXCAGCCS5DRUOWEBANCNFSM4NOLJIJQ .

Fragjacker commented 4 years ago

Yes, I forgot to make a release for 1.6.0 my bad, however the release for 1.6.1 should be up now 😀 .

As you can see, I very like the idea of "From simple solutions that just work to more advanced".

I see you're a man of coding culture as well. Also I am completely fine with even the simplest Mod downloading feature because I always wanted to have this functionality in my tool anyways. In fact the initial design was exactly what you have proposed here, to aid the user in finding the right mods they need, quickly and easy and update them if necessary.

IgorTheLight commented 4 years ago

Oh nice! I wanted to make dropDown in ModMerger to not accept user input but didn't make that change - I was too distracted by all improvements to Mod Manager. I hope you are still recognizing your code after all my "improvements"? :-) Also - I found a small bug: look inside "DoW Mod Manager.ini" after you exit DoW Mod Manager. See? That happens because you added a few spaces in those lines: private void ModManagerForm_Closing(object sender, EventArgs e) { string str = $@"{CHOICE_INDEX}={settings[CHOICE_INDEX]} {DEV}={settings[DEV]} {NO_MOVIES}={settings[NO_MOVIES]} {FORCE_HIGH_POLY}={settings[FORCE_HIGH_POLY]} {OPTIMIZATIONS}={settings[OPTIMIZATIONS]}"; File.WriteAllText(CONFIG_FILE_NAME, str); } All those spaces are counted as inputs. That's because it's a combination of Interpolated string ($) and a Verbatim string (@) - https://stackoverflow.com/questions/33236592/multiline-c-sharp-interpolated-string-literal/33236672 the easiest fix would be: private void ModManagerForm_Closing(object sender, EventArgs e) { string str = $"{CHOICE_INDEX}={settings[CHOICE_INDEX]}\n" + $"{DEV}={settings[DEV]}\n" + $"{NO_MOVIES}={settings[NO_MOVIES]}\n" + $"{FORCE_HIGH_POLY}={settings[FORCE_HIGH_POLY]}\n" + $"{OPTIMIZATIONS}={settings[OPTIMIZATIONS]}"; File.WriteAllText(CONFIG_FILE_NAME, str); } Now you could indent it as much as you want to :-) I like your changes in ModMerger! Also I have to be careful not to desync too much from your version or we wouldn't be able to merge them.

On Tue, Jun 2, 2020 at 5:23 PM Dennis S. notifications@github.com wrote:

Yes, I forgot to make a release for 1.6.0 my bad, however the release for 1.6.1 should be up now 😀 .

As you can see, I very like the idea of "From simple solutions that just work to more advanced".

I see you're a man of coding culture as well. Also I am completely fine with even the simplest Mod downloading feature because I always wanted to have this functionality in my tool anyways. In fact the initial design was exactly what you have proposed here, to aid the user in finding the right mods they need, quickly and easy and update them if necessary.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-637575898, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F33OFBUSXDU4XQWZ4ITRUUDNVANCNFSM4NOLJIJQ .

Fragjacker commented 4 years ago

I have looked a bit deeper into that INI thing and was mildly shocked, that there is no native support for INI files in C#. I have found this article, which uses an existing Windows API for creating INI files:

https://www.codeproject.com/Articles/6034/INI-Class-for-NET

However overall it look like it is intended to use XML over INI files as that has native support in dotNET. For now however I will implemented your suggested fix above as a temporary fix. 😬

IgorTheLight commented 4 years ago

Thanks for the article! There is no INI support because Microsoft don't want you to store any settings in the same directory as your executable. The reason for that is if you would store it in XML file in AppData\Local that would ensure that every user will get it's own setting file. It's a smart move... but I still like INI files :-) It's just SO much simpler this way! For user AND for programmer! Something tells me that you want to implement "a proper" INI support :-) It's not a bad idea but to be honest it works already (even if you indent it in some weird way or try to mess with it). But I'm not against it. About my progress... well I added a LOT of links manually (to download mods) but those links turned to be temporary. So they all expired. Thanks, ModDB! :-) So I'm working on a new (less lazy) solution. And I have a small refactoring for your ModMerger! It's a little bit faster AND cleaner! Your old code are commented. private void GetLoadableMods() { loadedModBox.Items.Clear();

        int modCount = modManager.AllValidModules.Count;
        string[] modsList = new string[modCount];

        for (int i = 0; i < modCount; i++)
        {
            modsList[i] = modManager.AllValidModules[i];
        }

        //int counter = 0;
        //foreach (string listBoxItem in modManager.AllValidModules)
        //{
        //    modsList[counter] = listBoxItem.ToString();
        //    counter++;
        //}

        loadedModBox.Items.AddRange(modsList);
    }

On Wed, Jun 3, 2020 at 2:30 PM Dennis S. notifications@github.com wrote:

I have looked a bit deeper into that INI thing and was mildly shocked, that there is no native support for INI files in C#. I have found this article, which uses an existing Windows API for creating INI files:

https://www.codeproject.com/Articles/6034/INI-Class-for-NET

However overall it look like it is intended to use XML over INI files as that has native support in dotNET. For now however I will implemented your suggested fix above as a temporary fix. 😬

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-638136741, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F33FUKFH63JJJATJMQ3RUYX3NANCNFSM4NOLJIJQ .

Fragjacker commented 4 years ago

Something tells me that you want to implement "a proper" INI support :-) It's not a bad idea but to be honest it works already (even if you indent it in some weird way or try to mess with it).

It's so far a mere Idea, since the way it works currently is kind of hacky and if we had the opportunity to use a proper system API, might as well use it. For now however I gonna keep it the way it is now, since I have other things to do 😛 .

About my progress... well I added a LOT of links manually (to download mods) but those links turned to be temporary. So they all expired. Thanks, ModDB! :-) So I'm working on a new (less lazy) solution.

Yes that is a real issue I have been running into as well. Back in the day I made an installer that was able to fetch data via the FTP protocol. It kinda worked nicely back in the day with Filefront since their links never expired and you could call it via FTW protocol so this was nice. Unfortunately Filefront shut down and moddb or mediafire don't support automated downloading 😢 .

So my idea would be to use some kind of definition file in XML format or whatever. This file contains the necessary information for the mod URL and version. At the start of the app you parse this file once. We could put this file here on the repo which would allow our app to fetch this data from this repo, to stay updated.

And I have a small refactoring for your ModMerger! It's a little bit faster AND cleaner! Your old code are commented.

Ah guess the foreach loop had a lot of overhead iterating over all the items 😛. Will you put this into a merge request?

IgorTheLight commented 4 years ago

I took a little break from DoW Mod Manager but I will continue it tomorrow. And of course my small refactoring is already in the 1.7.X branch :-) I will test a little bit of a different link (maybe it's not temporary but I doubt it to be honest). After that I will probably try to do as you suggested - will create some kind of file to store working links (when I could generate or find them). My next idea is to implement Game Settings Manager - basically a GUI to change Local.ini file :-)

On Wed, Jun 3, 2020 at 6:50 PM Dennis S. notifications@github.com wrote:

Something tells me that you want to implement "a proper" INI support :-) It's not a bad idea but to be honest it works already (even if you indent it in some weird way or try to mess with it).

It's so far a mere Idea, since the way it works currently is kind of hacky and if we had the opportunity to use a proper system API, might as well use it. For now however I gonna keep it the way it is now, since I have other things to do 😛 .

About my progress... well I added a LOT of links manually (to download mods) but those links turned to be temporary. So they all expired. Thanks, ModDB! :-) So I'm working on a new (less lazy) solution.

Yes that is a real issue I have been running into as well. Back in the day I made an installer that was able to fetch data via the FTP protocol. It kinda worked nicely back in the day with Filefront since their links never expired and you could call it via FTW protocol so this was nice. Unfortunately Filefront shut down and moddb or mediafire don't support automated downloading 😢 .

So my idea would be to use some kind of definition file in XML format or whatever. This file contains the necessary information for the mod URL and version. At the start of the app you parse this file once. We could put this file here on the repo which would allow our app to fetch this data from this repo, to stay updated.

And I have a small refactoring for your ModMerger! It's a little bit faster AND cleaner! Your old code are commented.

Ah guess the foreach loop had a lot of overhead iterating over all the items 😛. Will you put this into a merge request?

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-638285418, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F3423R2IEYZDFFEFEUTRUZWMRANCNFSM4NOLJIJQ .

Fragjacker commented 4 years ago

I took a little break from DoW Mod Manager but I will continue it tomorrow. And of course my small refactoring is already in the 1.7.X branch :-) I will test a little bit of a different link (maybe it's not temporary but I doubt it to be honest).

That's always a good idea to do 😁 .

After that I will probably try to do as you suggested - will create some kind of file to store working links (when I could generate or find them).

That is probably the only way so far, considering there's no central mod hub, that has them all. So making the app also be able to pull the latest changes from the Git repo to auto update itself would therefor really be nice.

My next idea is to implement Game Settings Manager - basically a GUI to change Local.ini file :-)

This is also a nice idea to have indeed!

Fragjacker commented 4 years ago

For the self auto updater using Github I found this useful article here: https://www.codeproject.com/Articles/5165015/AutoUpdate-A-GitHub-Enabled-autoupdater

IgorTheLight commented 4 years ago

Thanks for the article! But I have good news for you - my lazy way of downloading mods is actually working! The downside is that user would see the advertisement. But ModDB needs some money to run it so it's not THAT bad. It's on 1.7.X branch. I would release it very soon. 1.8.X (Settings Manager) is in progress.

On Sun, Jun 7, 2020 at 4:05 PM Dennis S. notifications@github.com wrote:

For the self auto updater using Github I found this useful article here: https://www.codeproject.com/Articles/5165015/AutoUpdate-A-GitHub-Enabled-autoupdater

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/Fragjacker/DoW-Mod-Manager/pull/7#issuecomment-640215895, or unsubscribe https://github.com/notifications/unsubscribe-auth/APM5F32VQMDIGPPKOHDDIDTRVOGAZANCNFSM4NOLJIJQ .