From 53b0de7079dae6c250287d3a1c98752fbf7a27f4 Mon Sep 17 00:00:00 2001 From: Tom Hicks Date: Sat, 11 Mar 2023 09:29:22 -0800 Subject: [PATCH] Extracts colors to separate files. --- dos/sbf/colors.bi | 21 +++++++++++++++++++++ dos/sbf/colors.bm | 9 +++++++++ dos/sbf/sbf.bas | 37 +++++-------------------------------- 3 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 dos/sbf/colors.bi create mode 100644 dos/sbf/colors.bm diff --git a/dos/sbf/colors.bi b/dos/sbf/colors.bi new file mode 100644 index 0000000..14cbd87 --- /dev/null +++ b/dos/sbf/colors.bi @@ -0,0 +1,21 @@ +Const COLOR_DARK_BLACK = 0 +Const COLOR_DARK_BLUE = 1 +Const COLOR_DARK_GREEN = 2 +Const COLOR_DARK_CYAN = 3 +Const COLOR_DARK_RED = 4 +Const COLOR_DARK_MAGENTA = 5 +Const COLOR_DARK_ORANGE = 6 +Const COLOR_DARK_YELLOW = 6 +Const COLOR_DARK_WHITE = 7 +Const COLOR_BRIGHT_BLACK = 8 +Const COLOR_BRIGHT_BLUE = 9 +Const COLOR_BRIGHT_GREEN = 10 +Const COLOR_BRIGHT_CYAN = 11 +Const COLOR_BRIGHT_RED = 12 +Const COLOR_BRIGHT_MAGENTA = 13 +Const COLOR_BRIGHT_ORANGE = 14 +Const COLOR_BRIGHT_YELLOW = 14 +Const COLOR_BRIGHT_WHITE = 15 + +Dim Shared ScreenColor As Integer +ScreenColor = COLOR_DARK_WHITE diff --git a/dos/sbf/colors.bm b/dos/sbf/colors.bm new file mode 100644 index 0000000..7a77cae --- /dev/null +++ b/dos/sbf/colors.bm @@ -0,0 +1,9 @@ +Sub SetColor (c As Integer) + ScreenColor = c + Color c +End Sub + +Function GetColor () + GetColor = ScreenColor +End Function + diff --git a/dos/sbf/sbf.bas b/dos/sbf/sbf.bas index 95044ce..38bc237 100644 --- a/dos/sbf/sbf.bas +++ b/dos/sbf/sbf.bas @@ -33,6 +33,8 @@ Const CLAN_VENTRUE = 18 Const CLANS_COUNT = 18 Dim Shared Clans(1 To CLANS_COUNT) As String +'$include: 'colors.bi' + Const ARCHETYPE_ARCHITECT = 1 Const ARCHETYPE_AUTOCRAT = 2 Const ARCHETYPE_BARBARIAN = 3 @@ -194,25 +196,6 @@ Const GENDER_NON_BINARY = 5 Const GENDERS_COUNT = 5 Dim Shared Genders(1 To GENDERS_COUNT) As String -Const COLOR_DARK_BLACK = 0 -Const COLOR_DARK_BLUE = 1 -Const COLOR_DARK_GREEN = 2 -Const COLOR_DARK_CYAN = 3 -Const COLOR_DARK_RED = 4 -Const COLOR_DARK_MAGENTA = 5 -Const COLOR_DARK_ORANGE = 6 -Const COLOR_DARK_YELLOW = 6 -Const COLOR_DARK_WHITE = 7 -Const COLOR_BRIGHT_BLACK = 8 -Const COLOR_BRIGHT_BLUE = 9 -Const COLOR_BRIGHT_GREEN = 10 -Const COLOR_BRIGHT_CYAN = 11 -Const COLOR_BRIGHT_RED = 12 -Const COLOR_BRIGHT_MAGENTA = 13 -Const COLOR_BRIGHT_ORANGE = 14 -Const COLOR_BRIGHT_YELLOW = 14 -Const COLOR_BRIGHT_WHITE = 15 - Const DERANGEMENTS_COUNT = 10 Const DERANGEMENT_ID_AMNESIA = 1 Const DERANGEMENT_ID_DELUSIONS_OF_GRANDEUR = 2 @@ -251,9 +234,6 @@ Const DERANGEMENT_DESCRIPTION_PARANOIA = "You are convinced that you are being h Const DERANGEMENT_DESCRIPTION_PERFECTION = "All your energy is directed toward preventing anything from going wong. When it does you must make a self-control roll or frenzy." Const DERANGEMENT_DESCRIPTION_REGRESSION = "You become childlike retreating to an earlier time when less was expected of you Willpower is regained inthe way a Child's is." -Dim Shared ScreenColor As Integer -ScreenColor = COLOR_DARK_WHITE - Type CharacterType name As String player As String @@ -1522,15 +1502,6 @@ Sub CGGetDerangement (ch As CharacterType) End If End Sub -Sub SetColor (c As Integer) - ScreenColor = c - Color c -End Sub - -Function GetColor () - GetColor = ScreenColor -End Function - Sub CGSpendFreebiePoints (ch As CharacterType) End Sub @@ -1913,7 +1884,7 @@ Sub FillAttributesInGroup (group As Integer, attributes() As String) Case ATTRIBUTE_GROUP_MENTAL For i = 1 To count attributes(i) = MentalAttributes(i) - Next f + Next End Select End Sub @@ -2206,6 +2177,8 @@ Sub MakeWrapLines (lines() As String, text As String, maxWidth As Integer, maxLi Wend End Sub +'$include: 'colors.bm' + Sub Test 'End End Sub