Feature AddCustomDeedsPanel refactoring

fredg1

Member
A well-needed cleanup. Makes AddCustomDeedsPanel way less nightmare-ish.


My goal is to add a Custom deed maker for Combo boxes, which would require the addition of a scrollbar/resizing to the panel, but for now, I'm doing things step-by-step: this patch doesn't change how the panel works in any way, at top level (besides some tooltip texts). It's only a refactoring.

Tested.
(attached file obsolete)
 

Attachments

  • AddCustomDeed.patch
    89 KB · Views: 1
Last edited:

fredg1

Member
Update: new patch (still taking the base as reference, so the previous patch can be seen as obsolete)

Compared to the previous one, this patch adds some self-cleaning (since making the previous one, I learned that there was a way to refer to this as the class(es) the class you're in is nested into).
It also introduces the first user-noticeable changes: update and bugfixes for the Text deed builder:
- sets the auto-enabling/disabling of the add text button to the AWT thread. Not doing so was causing mafia to completely crash if you had put a long string in the 'add text' field.
- puts the textArea in a GenericScrollPane. The textArea would otherwise resize to fit what was inside of it, and since the deed panel would not resize as well, it would cause most of the text to overflow into nothingness. Did I mention that the area would bring the undo and clear buttons down with it as well?

As usual (and as expected from something that's supposed to be (at least partially) a bugfix), it's tested.


My next move will be to make a ComboBox deed builder, which may or may not have me enlarge the deed panel. Just sayin'.
 

Attachments

  • AddCustomDeedv2.patch
    89.9 KB · Views: 1

fredg1

Member
New patch! This time, I made a builder for the only type of Daily Deed that didn't have one yet: the "Combo" deeds.

Tested and ready to go (though reviews/feedback can't hurt).

p.s. I'm maybe going a bit overboard with "this.", but at this point, it's mostly for consistency.
 

Attachments

  • ComboDeedBuilder.patch
    33 KB · Views: 6

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I'll try to take a look at this soon fred. It's hard to test because I don't use this feature much
 
Top