Apply my patch please?

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Apply my patch please?

Post by i30817 »

So i noticed you're working on exult again...

Can my patch for the alternate drag mod be applied?
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

If you aren't gonna to, is it possible to crosscompile exult on linux 64 bits to windows?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

It's possible to crosscompile. I don't know how but I'm sure someone made a tutorial.
As for your patch... I can't implement it since it likely needs some polish that I don't know how.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

Isn't marzo working again?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

He is but he is working on the real important issue of the disappearing objects.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

The polish... for IFDEF away for other platforms?

Or something else?
I don't code C++ (barely code even) so i don't know much, even about the preferred structure of your code. I just grabbed the SDL keyboard state like a barbarian and had my way with it.
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

Also, yeah the patch has some polish for the menu indexes...

It seemed there was some offset uglyness there at least.

gumps/GameplayOptions_gump.cc

I think (but don't quite remember) that it was that that the array that contained the positions
1) not all filled, ie, there was a gap with no position that was not used.
2) not actually in order, that is, the positions didn't descend the gump as the array index increased (or any order).
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

So i changed the rowy array:

-static const int rowy[] = { 4, 16, 124, 28, 40, 52, 64, 76, 88, 100, 112, 148, 136 };
+static const int rowy[] = { 4, 16, 28, 40, 52, 64, 76, 88, 100, 112, 124, 136, 148 };

and adjusted the subsequent uses of it.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

It's mostly the shuffling around of the settings you are doing. Also that gump is already full. adding another option makes it unreasonable big for the default resolution of 320x200.
I also don't like your middle mouse button idea. The world seems to have moved away from the middle button to thumb buttons, scroll wheel and so forth.
I'd rather like it that you'd need to hold down a modifier key (ctrl, shift, alt) to drag without confirmation.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

The "middle mouse button" is what is in the description on sourceforge because that was originally a RFE before i decided to take matters into my own hands. The file itself uses CTRL (left and right) to disable the auto merging of stacks.

The gump... i originally wanted to put it in "Gameplay Options" but as you said, it was too full in low res.

So i put it in "Misc Options". It seems to have space enough.

The settings saving was needed for it to be a option in the gump (and to persist). I'm not sure what you mean if not that.
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

So notice i'm not altering the original behavior unless the "Misc Options" option is set. If it is, the game automerges the stacks if you drop them on top of eachother (and if in the backpack i think). If you press CTRL while the option is on, you can split the stacks again.

This mostly works due to the original excellent code for the stacks merging that i didn't touch, just slightly reworked the initial condition.
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

The "If you press CTRL while the option is on, you can split the stacks again." should be
"If you press and hold CTRL while the option is on and you drop a stack, you can split the stacks again"
It's a modifier, not a toggle.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

hmm, did you alter the original patch and put it somewhere? because on first glance the original patch still messes with the paperdoll setting (only available on BG with SI installed)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

Ah that.

I did it because of the reordering i did above of the this array; it's still the same:

-static const int rowy[] = { 4, 16, 124, 28, 40, 52, 64, 76, 88, 100, 112, 148, 136 };
+static const int rowy[] = { 4, 16, 28, 40, 52, 64, 76, 88, 100, 112, 124, 136, 148 };

...
- if (sman->can_use_paperdolls() && (GAME_BG ||
- Game::get_game_type() == EXULT_DEVEL_GAME))
- buttons[id_paperdolls] = new GameplayEnabledToggle(this, colx[3], rowy[12], 59,
- paperdolls);
...
+
+ if (sman->can_use_paperdolls() && (GAME_BG ||
+ Game::get_game_type() == EXULT_DEVEL_GAME))
+ buttons[id_paperdolls] = new GameplayEnabledToggle(this, colx[3], rowy[11], 59,
+ paperdolls);

And moved that block to the end.
The unordered, non linearly accessed array was disturbing my OCD.
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

Ok, the 1000$ question. Do you want me to remake the patch without the gump array moving around?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

Finally took a look and it seems to work fine. At least the part when you set the misc option to split stacks via ctrl. I don't have a middle mouse button so I can't check this part. I'm a bit confused about the middle mouse button thing when it does what :)

I'm thinking whether your patch could be changed so the alternative drag mode is always available when using ctrl and the setting in the misc option reverses it so the alternate drag method is the default drag and with ctrl it splits.
So maybe word that option to "default to alternate drag'n'drop" (and further explanation in the docs), default being no.
Could you do that? I'll champion that then. I'd only need to test whether it has any effect on Exult Studio work.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

There is no middle mouse button part. I abandoned that part when i relized the middle mouse button was already in use by exult. (Besides, this is better).

I'll see if i can get up to speed with diff again to do the changes you want.
marzo
Site Admin
Posts: 1925
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by marzo »

@Dominus: in many mouses, you can 'click' the mouse wheel and it acts as the middle button. In some others (depends on OS and drivers), pressing left+right buttons together does the same.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

Thanks i3 and sorry for the misunderstandings ;)

@Marzo, I need to investigate this on OS X. Currently I'm using the Magic Trackpad which isn't ideal to begin with with Exult movements but a third click is out of question ;)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

Exult is building.
Should i attach the patch on sourceforge when it is finished or should i just give you a link to the diff?
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

"Default to alternate drag'n'drop:" didn't fit, so i changed to
"Alternate drag'n'drop:"

Ok?
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

Sounds good. You might have to give me the link as the patch tracker might not allow you to attach anything anymore.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

Here is a pastebin link with the reworked patch (you can download it in the link there)

http://pastebin.com/8Lm1P9iQ
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

This link is prob better since it has a better name when you download. Remove the .txt and patch

http://pastebin.com/Jhb3hL7U
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: Apply my patch please?

Post by Dominus »

Applied :)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
i30817
Posts: 38
Joined: Mon May 25, 2020 10:24 am

Re: Apply my patch please?

Post by i30817 »

:) :) :)
Locked