Experience Index Returns (Open-source)

Discussion in 'MDL Projects and Applications' started by Muerto, Apr 7, 2016.

  1. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #561 Muerto, Feb 2, 2020
    Last edited: Jan 19, 2021
    (OP)
    Okay, Region.ini it is.
     
  2. ItielMaN

    ItielMaN MDL Senior Member

    Apr 30, 2011
    367
    59
    10
    Can you release a last beta with Edit Scores enabled? So we'd be able to QA it first.
     
  3. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #563 Muerto, Feb 3, 2020
    Last edited: Jan 19, 2021
    (OP)
    Yes, that module is currently being finished. I will let you know once more information is available.
     
  4. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #565 Muerto, Feb 3, 2020
    Last edited: Feb 3, 2020
    (OP)
    Thanks @CHEF-KOCH. For NVReform the settings and language strings have been merged into one .ini file so the profile resolver can be unified. Now I have English, Spanish and French all checked by native speakers. It's going well.

    The language file here is not a language file, it's a compatibility file to check strings per culture. The application is years old, arse-backwards and made in VB. Translation is not on the table unless my friend decides to change that.

    Working on this:

    Code:
      class Configuration
        {
            internal static readonly string IniFile = Path.Combine(Paths.GetLocalPath(), "NVReform.ini");
    
            internal static string ReadIniValue(string Section, string Key, string Default = "")
            {
                StringBuilder Builder = new StringBuilder(500);
                if (NativeMethods.GetPrivateProfileString(Section, Key, Default, Builder, Builder.Capacity, IniFile) == true)
                {
                    return Builder.ToString();
                }
                return Default;
            }
    
            internal void WriteIniValue(string Section, string Key, string Data)
            {
               NativeMethods.WritePrivateProfileString(Section, Key, Data, IniFile);      
            }
    
            internal void DeleteIniSection(string Section)
            {
                WriteIniValue(null, null, Section);
            }
    
            internal void DeleteIniKey(string Key, string Section)
            {
                WriteIniValue(Key, null, Section);
            }
    
            internal bool IniKeyExists(string Key, string Section)
            {
                return ReadIniValue(Key, Section).Length != 0;
            }
    // - - - - >
    
    And the language resolver inherits the config:

    Code:
      class Language : Configuration
        {
    
            #region Functions
            internal static bool SettingsFileExists()
            {
                if (File.Exists(IniFile))
                {
                    try
                    {
                        if (ReadIniValue("Identifier", "Key", "") == "NVReform")
                        {
                            return true;
                        }
                    } catch (IOException) {
                        return false;
                        throw;
                    }
                }
                return false;
            }
    // - - - - >
    
    Regards.
     
  5. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #566 Muerto, Feb 10, 2020
    Last edited: Jan 19, 2021
    (OP)
    This is still being worked on. I'm currently writing the language system for something else, first time for me so still exploring.
     
  6. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #567 Muerto, Feb 13, 2020
    Last edited: Jan 19, 2021
    (OP)
    I am working on UI aspects here. Some *framework* stuff needed work. The Checkbox has had it's size shrunk by a few pixels and RadioButton has received better rendering and QOL changes.

    Untitled.png

    New paint method example from GambolRadioButton, controls are now designed to handle disposing before objects are out of scope.
    Code:
            Protected Overrides Sub OnPaint(e As PaintEventArgs)
    
                Dim Diameter As Integer = ClientRectangle.Height - 1
                Dim OuterRectangle As New RectangleF(0, 0, Diameter, Diameter)
                Dim InnerRectangle As New RectangleF(1, 1, Diameter - 2, Diameter - 2)
    
                If e IsNot Nothing Then
    
                    Dim G As Graphics = e.Graphics
                    G.Clear(BackColor)
                    G.InterpolationMode = InterpolationMode.HighQualityBicubic
                    G.SmoothingMode = SmoothingMode.AntiAlias
                    G.CompositingQuality = CompositingQuality.HighQuality
    
                    Using SB As New SolidBrush(RadioBackColor)
                        G.FillEllipse(SB, InnerRectangle)
                    End Using
    
                    Using P As New Pen(InactiveBorderColor, 2.0F)
                        G.DrawEllipse(P, InnerRectangle)
                    End Using
    
                    OuterRectangle.Inflate(-1, -1)
    
                    If MouseHovered Then
                        Using P As New Pen(ActiveBorderColor, 2.0F)
                            G.DrawArc(P, OuterRectangle, 135, 180)
                            G.DrawArc(P, OuterRectangle, -45, 180)
                        End Using
    
                        InnerRectangle.Inflate(-1, -1)
    
                        Using SB As New SolidBrush(ActiveRadioBackColor)
                            G.FillEllipse(SB, InnerRectangle)
                        End Using
                    End If
    
                    If Checked Then
                        InnerRectangle = New RectangleF(1, 1, Diameter - 2, Diameter - 2)
                        InnerRectangle.Inflate(-5, -5)
                        Using SB As New SolidBrush(CheckedColor)
                            G.FillEllipse(SB, InnerRectangle)
                        End Using
                    End If
    
                    Dim TextArea As Rectangle = New Rectangle(Convert.ToInt32(OuterRectangle.Width + 5), 0, Convert.ToInt32(Width - OuterRectangle.Width - 6), Height - 1)
                    Dim BC As Color = CType(IIf(Enabled, ForeColor, Color.FromArgb(100, 100, 100)), Color)
    
                    Using SF As New StringFormat With {.LineAlignment = StringAlignment.Center}
                        Using SB As New SolidBrush(ForeColor)
                            G.DrawRectangle(Pens.Transparent, TextArea)
                            G.DrawString(Text, Font, SB, TextArea, SF)
                        End Using
                    End Using
    
                End If
    
            End Sub
    
    C# 1-1 translation by K4onashi, ready for porting to new software in development:
    Code:
          protected override void OnPaint(PaintEventArgs e)
            {
                int Diameter = ClientRectangle.Height - 1;
                RectangleF OuterRectangle = new RectangleF(0, 0, Diameter, Diameter);
                RectangleF InnerRectangle = new RectangleF(1, 1, Diameter - 2, Diameter - 2);
    
                if (e != null)
                {
                    Graphics g = e.Graphics;
                    g.Clear(BackColor);
                    g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                    g.SmoothingMode = SmoothingMode.AntiAlias;
                    g.CompositingQuality = CompositingQuality.HighQuality;
    
                    using (SolidBrush SB = new SolidBrush(RadioBackColor))
                    {
                        g.FillEllipse(SB, InnerRectangle);
                    }
    
                    using (Pen P = new Pen(InactiveBorderColor, 2.0f))
                    {
                        g.DrawEllipse(P, InnerRectangle);
                    }
    
                    OuterRectangle.Inflate(-1, -1);
    
                    if (MouseHovered)
                    {
                        using (Pen P = new Pen(ActiveBorderColor, 2.0f))
                        {
                            g.DrawArc(P, OuterRectangle, 135, 180);
                            g.DrawArc(P, OuterRectangle, -45, 180);
                        }
    
                        InnerRectangle.Inflate(-1, -1);
    
                        using (SolidBrush SB = new SolidBrush(ActiveRadioBackColor))
                        {
                            g.FillEllipse(SB, InnerRectangle);
                        }
                    }
    
                    if (Checked)
                    {
                        InnerRectangle = new RectangleF(1, 1, Diameter - 2, Diameter - 2);
                        InnerRectangle.Inflate(-5, -5); // Control size of check
                        using (SolidBrush SB = new SolidBrush(CheckedColor))
                        {
                            g.FillEllipse(SB, InnerRectangle);
                        }
                    }
    
                    Rectangle TextArea = new Rectangle(Convert.ToInt32(OuterRectangle.Width + 5), 0, Convert.ToInt32(Width - OuterRectangle.Width - 6), Height - 1);
                    Color BC = Enabled ? ForeColor : Color.FromArgb(100, 100, 100);
    
                    using (StringFormat SF = new StringFormat() { LineAlignment = StringAlignment.Center })
                    using (SolidBrush SB = new SolidBrush(BC))
                    {
                        g.DrawRectangle(Pens.Transparent, TextArea);
                        g.DrawString(Text, Font, SB, TextArea, SF);
                    }
    
                }
            }
    
    To-do: Add MeasureString and handle proper control resizing , then implementing animation into each control. Maybe in the future, translations will be on the table for this software.
     
  7. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #568 Muerto, Feb 20, 2020
    Last edited: Jan 19, 2021
    (OP)
    Controls have been finished. See image.

    Untitled.png

    Framework UI changes:
    - Code brought up to a better standard
    - Added intermediate check state graphics
    - Better rendering for RadioButton
    - Unified colors
    - Unified sizing
    - Improved designers
    - Many other enhancements and fixes

    GambolRadioButtonDesigner:
    Code:
    using System.Collections;
    using System.Collections.Generic;
    using System.Windows.Forms.Design;
    
    namespace NVReform.UI.Controls.Design
    {
        public class GambolRadioButtonDesigner : ControlDesigner
        {
            protected override void PreFilterProperties(IDictionary Properties)
            {
    
                List<string> PropList = new List<string>
                {
                    "Appearance",
                    "BackgroundImage",
                    "BackgroundImageLayout",
                    "CheckAlign",
                    "FlatAppearance",
                    "FlatStyle",
                    "Image",
                    "ImageAlign",
                    "ImageIndex",
                    "ImageKey",
                    "ImageList",
                    "RightToLeft",
                    "TextAlign",
                    "TextImageRelation",
                    "UseVisualStyleBackColor",
                    "Padding",
                    "AutoEllipsis"
                };
    
                if (Properties != null)
                {
                    foreach (string Item in PropList)
                    {
                        Properties.Remove(Item);
                    }
                }
    
                base.PreFilterProperties(Properties);
            }
        }
    }
    
    GambolRadioButton:
    Code:
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Drawing.Drawing2D;
    using System.Windows.Forms;
    
    // Internal
    using NVReform.UI.Controls.Design;
    
    namespace NVReform.UI.Controls
    {
        [DefaultProperty("Checked")]
        [Designer(typeof(GambolRadioButtonDesigner))]
        public class GambolRadioButton : RadioButton
        {
    
            #region Fields
            private bool MouseHovered = false;
            private bool MousePressed = false;
            #endregion
    
            #region Constructor
            public GambolRadioButton()
            {
                SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true);
    
                MouseEnter += new EventHandler(ProcessMouse);
                MouseLeave += new EventHandler(ProcessMouse);
                BackColor = Color.Transparent;
                ForeColor = Colors.EnabledText;
            }
            #endregion
    
            #region Properties
            private Color BorderInactive_ = Colors.BorderInactive;
            [Description("Check area border color")]
            [Category("Appearance (Gambol)")]
            public Color BorderColor
            {
                get
                {
                    return BorderInactive_;
                }
                set
                {
                    BorderInactive_ = value;
                    Invalidate();
                }
            }
    
            private Color BorderActive_ = Colors.BorderActive;
            [Description("Check area mouseover border color")]
            [Category("Appearance (Gambol)")]
            public Color BorderColorActive
            {
                get
                {
                    return BorderActive_;
                }
                set
                {
                    BorderActive_ = value;
                    Invalidate();
                }
            }
    
            private Color ClientInactive_ = Colors.ClientInactive;
            [Description("Check area backcolor")]
            [Category("Appearance (Gambol)")]
            public Color ClientColor
            {
                get
                {
                    return ClientInactive_;
                }
                set
                {
                    ClientInactive_ = value;
                    Invalidate();
                }
            }
    
            private Color ClientActive_ = Colors.ClientActive;
            [Description("Check area mouseover color")]
            [Category("Appearance (Gambol)")]
            public Color ClientColorActive
            {
                get
                {
                    return ClientActive_;
                }
                set
                {
                    ClientActive_ = value;
                    Invalidate();
                }
            }
    
            private Color Checked_ = Colors.Checked;
            [Description("Control checked color")]
            [Category("Appearance (Gambol)")]
            public Color CheckedColor
            {
                get
                {
                    return Checked_;
                }
                set
                {
                    Checked_ = value;
                    Invalidate();
                }
            }
            #endregion
    
            #region Paint Methods
            protected override void OnPaint(PaintEventArgs e)
            {
                OnPaintBackground(e);
                OnPaintForegound(e);
            }
            protected override void OnPaintBackground(PaintEventArgs e)
            {
                if (e != null)
                {
                    Graphics g = e.Graphics;
    
                    if (BackColor.A == 255)
                    {
                        g.Clear(BackColor);
                        return;
                    }
                    base.OnPaintBackground(e);
                }
            }
            protected virtual void OnPaintForegound(PaintEventArgs e)
            {
                int Diameter = ClientRectangle.Height - 1;
                RectangleF OuterRectangle = new RectangleF(0, 0, Diameter, Diameter);
                RectangleF InnerRectangle = new RectangleF(1, 1, Diameter - 2, Diameter - 2);
                Color SwitchBorder, SwitchBack;
    
                if (e != null)
                {
                    Graphics g = e.Graphics;
    
                    g.InterpolationMode = InterpolationMode.HighQualityBicubic;
                    g.SmoothingMode = SmoothingMode.AntiAlias;
                    g.CompositingQuality = CompositingQuality.HighQuality;
    
                    OuterRectangle.Inflate(-1, -1);
    
                    if (Enabled)
                    {
                        if (MouseHovered && MousePressed)
                        { SwitchBorder = Color.FromArgb(Colors.A, CheckedColor.R, CheckedColor.G, CheckedColor.B); }
                        else if (MouseHovered)
                        { SwitchBorder = BorderColorActive; }
                        else
                        { SwitchBorder = BorderColor; }
                    }
                    else { SwitchBorder = Colors.DisabledControl; }
    
                    using (Pen P = new Pen(SwitchBorder, width: 2))
                    {
                        g.DrawArc(P, OuterRectangle, 135, 180);
                        g.DrawArc(P, OuterRectangle, -45, 180);
                    }
    
                    InnerRectangle.Inflate(-1, -1);
    
                    if (MouseHovered)
                    { SwitchBack = ClientColorActive; }
                    else { SwitchBack = ClientColor; }
    
                    using (SolidBrush SB = new SolidBrush(SwitchBack))
                    {
                        g.FillEllipse(SB, InnerRectangle);
                    }
    
                    if (Checked)
                    {
                        InnerRectangle = new RectangleF(1, 1, Diameter - 2, Diameter - 2);
                        InnerRectangle.Inflate(-5, -5); // Control size of check
                        using (SolidBrush SB = new SolidBrush(CheckedColor))
                        {
                            g.FillEllipse(SB, InnerRectangle);
                        }
                    }
    
                    Rectangle TextArea = new Rectangle(Convert.ToInt32(OuterRectangle.Width + 5), 0, Convert.ToInt32(Width - OuterRectangle.Width - 6), Height);
                    Color BC = Enabled ? ForeColor : Colors.DisabledText;
    
                    using (StringFormat SF = new StringFormat() { LineAlignment = StringAlignment.Center })
                    using (SolidBrush SB = new SolidBrush(BC))
                    {
                        g.InterpolationMode = InterpolationMode.Default;
                        g.SmoothingMode = SmoothingMode.None;
                        g.CompositingQuality = CompositingQuality.Default;
                        g.DrawRectangle(Pens.Transparent, TextArea);
                        g.DrawString(Text, Font, SB, TextArea, SF);
                    }
                }
            }
            #endregion
    
            #region Overriden Methods
            protected override void OnCheckedChanged(EventArgs e)
            {
                base.OnCheckedChanged(e);
                Invalidate();
            }
            protected override void OnMouseLeave(EventArgs eventargs)
            {
                base.OnMouseLeave(eventargs);
                MouseHovered = false;
            }
            protected override void OnMouseEnter(EventArgs eventargs)
            {
                base.OnMouseEnter(eventargs);
                MouseHovered = true;
            }
            protected override void OnTextChanged(EventArgs e)
            {
                GetPreferredSizeN();
                Invalidate();
            }
            protected override void OnMouseDown(MouseEventArgs e)
            {
                if (e != null)
                {
                    if (e.Button == MouseButtons.Left)
                    {
                        MousePressed = true;
                        Invalidate();
                    }
                }
                base.OnMouseDown(e);
            }
            protected override void OnMouseUp(MouseEventArgs e)
            {
                MousePressed = false;
                Invalidate();
                base.OnMouseUp(e);
            }
            #endregion
    
            #region Custom Methods
            private void ProcessMouse(object sender, EventArgs e)
            {
                if (ClientRectangle.Contains(PointToClient(MousePosition)))
                    if (!MouseHovered) { MouseHovered = true; Invalidate(); }
                    else { MouseHovered = false; Invalidate(); }
            }
            private Size GetPreferredSizeN()
            {
                return GetPreferredSize(new Size(0, 0));
            }
            #endregion
    
        }
    }
    
     
  8. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #569 Muerto, May 28, 2020
    Last edited: May 31, 2020
    (OP)
    I am still working on this. Not too much left to go, but coming back the translation system has literally taken a s,hit for no reason; so I have to debug it.

    Once I find out that it's a missing semicolon after nine days of looking and we're chugging again, I'll release B3 for everyone.

    Peace.
     
  9. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #570 Muerto, May 29, 2020
    Last edited: May 31, 2020
    (OP)
    Language system is fixed. I won't say what was wrong to keep my dignity. B3 on the way, maybe today or tomorrow.
     
  10. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #571 Muerto, May 31, 2020
    Last edited: Jan 19, 2021
    (OP)
    Still working here. Windows 20H1 seems to break the updater due to the SSL/TLS of my site and it cannot fetch the versioning XML.

    Edit: Issue patched and resolved.
     
  11. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #572 Muerto, May 31, 2020
    Last edited: Mar 8, 2021
    (OP)
    BETA information removed so not to cause confusion.
     
  12. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #573 Muerto, Jun 4, 2020
    Last edited: Jun 4, 2020
    (OP)
    Notification badge scaling bug fixed. Just the score editor to finish and RC1 will follow.
     
  13. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    Hi everyone,

    I feel this is owed, I'll come right out and say it, I can't continue with this project anymore. There is not enough interest and I've better things to get on with, I also have no time for VB.NET as it holds me back. Thanks everyone for helping make the application what it is. This is also a goodbye from me for MDL, I wish you all the best.

    Keep an eye on Github, v2.1.0 isn't a never, it's a whenever.

    Mods could you lock this?
     
  14. Skunk1966

    Skunk1966 MDL Member

    Jul 15, 2011
    156
    145
    10
    IMO it's apitty these projects are abandoned because I found them very useful.
    We'll stay in touch mate!
     
  15. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    #576 Muerto, Jan 15, 2021
    Last edited: Jan 16, 2021
    (OP)
    Website and data back online, however propagation may still occur for the next 24 hours and you may encounter issues accessing resources. More information regarding 2.1.0 RC1 will follow in the coming weeks, however I have scrapped the score editor as it's a waste of time. Older versions of the application can now use the unbuilt updater to get to v2.0.2 again.

    My Github has been deleted, but source code will be up soon.

    There is a lot to complete, so bare with me.
     
  16. Muerto

    Muerto MDL Debugger

    Mar 7, 2012
    1,855
    2,103
    60
    Replacing font installer: Fonts will no longer have to be installed and will be loaded into memory.
     
  17. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,328
    7,044
    210
    "Days of the Dead" - nice new theme. :)