Skip to content

Commit

Permalink
Added custom NumericUpDown for Flash settings and fixed bug in which …
Browse files Browse the repository at this point in the history
…I forgot to change the original name
  • Loading branch information
CatmanFan committed Feb 16, 2025
1 parent 8ba136c commit 485f936
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 11 deletions.
8 changes: 4 additions & 4 deletions FriishProduce/SettingsForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion FriishProduce/Subforms/ContentOptions/Options_Flash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected override void ClearOptions()
{ "content_domain", null },
{ "background_color", "0 0 0 0" },
{ "anti_aliasing", Program.Config.flash.anti_aliasing },
{ "ortho_rect", Program.Config.flash.zoom },
{ "zoom", Program.Config.flash.zoom },
};
}

Expand Down Expand Up @@ -203,6 +203,11 @@ private void valueChanged(object sender, EventArgs e)
background_color_img.BackColor = BGColor.Color = Color.Black;
}
}

else if (sender == zoom_h || sender == zoom_v)
{
(sender as NumericUpDownEx).Prefix = (sender as NumericUpDownEx).Value > 0 ? "+" : null;
}
}

private void changeBackgroundColor(object sender, EventArgs e)
Expand Down
48 changes: 47 additions & 1 deletion FriishProduce/_classes/Program/CustomGraphics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public PlaceholderTextBox() : base()

[Localizable(true)]
[DefaultValue("")]
[Description("")]
[Description("Placeholder text to display if there is no value.")]
public virtual string PlaceholderText
{
get
Expand Down Expand Up @@ -105,4 +105,50 @@ protected override void OnPaint(PaintEventArgs e)
base.OnPaint(e); // Paint text
}
}

class NumericUpDownEx : NumericUpDown
{
public NumericUpDownEx() : base()
{

}

private string prefix = string.Empty;
private string suffix = string.Empty;

[Localizable(true)]
[DefaultValue("")]
[Description("The string to be displayed before the value.")]
public virtual string Prefix
{
get => prefix;
set
{
prefix = value;
UpdateEditText();
}
}


[Localizable(true)]
[DefaultValue("")]
[Description("The string to be displayed after the value.")]
public string Suffix
{
get => suffix;
set
{
suffix = value;
UpdateEditText();
}
}

protected override void UpdateEditText()
{
base.UpdateEditText();

ChangingText = true;
Text = prefix + Text + suffix;
}
}
}
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ Please check the **[wiki](https://catmanfan.github.io/FriishProduce/)** for a tu

## To-Do
- [ ] Tidyup Flash content options interface
- [ ] Design Japanese-only icons for FC, SFC, PCE and PCECD
* Design Japanese-only icons
- [ ] Famicom
- [ ] PCE
- [ ] PCE CD
- [ ] Complete implementation of themes functionality

### Potential
Expand Down

0 comments on commit 485f936

Please sign in to comment.