Code Monkey home page Code Monkey logo

bbdinstaller's Introduction

BandagedBD Installer

This is the source for the Windows installer of BandagedBD, a mod for Discord. I decided to put this in a separate repo mainly because it didn't feel quite right to have it in with the actual application itself as the application is JavaScript injection onto an Electron.js platform, and this is an actual executable that only sets ups files for it.

Preview

ScreenShot

System Structure

The system starts through the FormMain object which then adds the necessary control to the form. The controls to be added implement the interface IPanel and are represented in the accomanying enumeration PanelTypes. These two in tandem determine how the navigation through the installer occurs.

PanelTypes

An enumeration representing all the available panels to have in the installer.

IPanel

The interface IPanel requires the following functions:

  1. void OnShow - Called when the control is added to the form
  2. void SetWindow(FormMain) - Called when the main form prepares the panels, allows panels to keep a reference to the window/form

The interface also requires the following gettable properties:

  1. string Title - The title of the panel to be shown in the form
  2. UserControl Control - Returns an implied cast of self (useful for passing to other function in the main form)
  3. PanelTypes PreviousPanel - Representation of the panel to go to when going "back"
  4. PanelTypes NextPanel - Representation of the panel to go to when going "forward"

FormMain

Creates and keeps a reference to all the IPanels and even handles the navigation through the application. Also holds the enumeration of PanelTypes. Includes a function to return a reference to a specific panel so panels may reference each other (mainly used for panels to refer to the configuration panel).

Discord

An enumeration representing the 3 release channels of Discord: Stable, Canary and PTB.

Utilities

Utilities contains several functions used multple times throughout the application including things like killing and launching processes as well as searching for and resolving paths. Contains the Discord enumeration.

Custom Components

The installer makes use of a few custom components either for modularity as in the DiscordLocator control or for the custom "flat" design as in WinForms not all controls have a decent flat style.

DiscordLocator

This is a custom group of controls consisting of: 3 checkboxes that represent location enable, 3 textboxes showing the currently entered/found path, and 3 buttons that allow the user to browse for the path.

Button

This is a simple wrap around the normal Button object to add some helpful functions.

FlatCheckBox

The native checkbox leaves a lot to be desired in terms of extensibility and customization. To create custom styling this component paints it's own checkbox using the current graphics and imposing the string "โœ”" overtop.

FlatProgressBar

Similar to the checkbox the native progressbar has little to no customization options. This paints a flat checkbox using the an offscreen image as adapted from this StackOverflow answer.

bbdinstaller's People

Contributors

callumcarmicheal avatar rauenzi avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.