diff --git a/TODO.md b/TODO.md index 957e5d4..da8b365 100644 --- a/TODO.md +++ b/TODO.md @@ -2,13 +2,9 @@ ## Under development -- Porting for Microsoft Windows and Apple macOS +- Port for Microsoft Windows +- Port for Apple macOS ## Ideas -- empty - -## Done - -- Randomize PC's moves with same score -- Fix missing icon in about dialog (the window icon is platform dependent) +- Migrate to Gtk4 (and maybe Libadwaita) diff --git a/colors/default b/colors/default index 783624f..f987ba2 100644 --- a/colors/default +++ b/colors/default @@ -5,7 +5,3 @@ bg=#83582d fg=#ffffff light=#cc9c59 dark=#6e4b1b - -focus-border=#fff -hover-border=#787878 -possible-move-border=#adaf7c diff --git a/doc/italian-draughts.5.scd b/doc/italian-draughts.5.scd index dd2c9ef..09dfc98 100644 --- a/doc/italian-draughts.5.scd +++ b/doc/italian-draughts.5.scd @@ -8,25 +8,41 @@ italian-draughts reads the application data from the following path: - /usr/share/italian-draughts/ -## IMAGES +# THEMES -In the images subdirectory this program reads the following images: +For each resource type this program first reads from the 'default' file +located inside the directory of the resource type. -- pcDame.png: PC dame/king -- pcPawn.png: PC pawn/man -- plDame.png: Player dame/king -- plPawn.png: Player pawn/man +Then, if the user specified a theme, from the file whose name corresponds +to the theme name. New values can be added or overwrite the default ones. -Note: all images must be the same size +Every line of a resource file must be a = pair without whitespaces. +Empty lines or those starting with *#* are ignored. -## THEMES +## colors -In the themes subdirectory this program first reads from the 'default' file -and then, if the user specified a theme, from the file whose name corresponds -to the theme name. New values can be added or overwrite the default ones. +Used colors are: -Every line of a resource file must be a = pair without whitespaces. -Empty lines or those starting with # are ignored. +- border: Chessboard border +- bg: Backgroud +- fg: Foregroud (text color) +- light: Light grid cels +- dark: Dark grid cels + +## images + +Images are considered a resource type but every theme is a directory instead of a regular file. +So for each theme directory there must be an index where every line is the image key +that is a image filename without extension. +Every image file is called _key.png_ and there must be the following image keys +at least in the default theme: + +- pcDame: PC dame/king +- pcPawn: PC pawn/man +- plDame: Player dame/king +- plPawn: Player pawn/man + +Note: all images must be the same size # SEE ALSO *italian-draughts*(1) diff --git a/src/README.md b/src/README.md index e0725df..857f77a 100644 --- a/src/README.md +++ b/src/README.md @@ -6,7 +6,7 @@ for creating this program. The structure is described below. Note: - X : Y means X is subclass of Y -- X::Y means Y, that is declares inside X +- X::Y means Y, that is declared inside X ## Frame : wxFrame @@ -18,14 +18,15 @@ A 8x8 grid panel that represents a chessboard. ## MatchManager -This class handle 1 or more matches using a specific ChessboardGrid +This class handle matches interacting with a ChessboardGrid ## GameUtils This class provides a static method to find all possible moves from a specific -pieces' disposition. +pieces' disposition and a static method to calculate the best move the PC +can make (Minimax algorithm) -### gameUtils::AlgorithmThread : wxThread +### GameUtils::AlgorithmThread : wxThread This class provides a simple way to calculate the best move for PC using a separate thread that calls the 'calculateBestMove' static method of GameAlgorithm @@ -38,11 +39,6 @@ It represents a move that can be done by the player or PC. A class that represents a square in the chessboard. -## GameAlgorithm - -This class allows the computer to play against a player providing a static method -to calculate the best move for PC. - ## Resources A class the provides the ability to fetch colors from a particular theme. diff --git a/src/Resources/README.md b/src/Resources/README.md index 4a2c995..bf37604 100644 --- a/src/Resources/README.md +++ b/src/Resources/README.md @@ -18,13 +18,20 @@ Please refer to [wxWidgets wiki](https://docs.wxwidgets.org/3.2.1/overview_i18n. This program can be started with a specific theme, or it will use the default one. -Assuming the chosen theme is **theme** this program reads from the following path -in a simple format as described below. If the file does not exist, it is unreadable or -colors are not available, they fall back to the default ones. +Assuming the chosen theme is **theme**, for each resource type this program reads from +the following path in a simple format as described below. -- /etc/italian-draughts/themes/**theme** +For each entry if the file does not exist, it is unreadable or the entry is not available, +it fall back to the default one. + +- /etc/italian-draughts/**resource_type**/**theme** ### File format Each line can start with a "#" to indicate a comment or be a key=value pair divided by a "=" without whitespaces of any type. + +### Resource types + +- colors: UI colors +- images: Bitmaps in PNG format (keys does not include extension)