richardwilkes / gcs

GURPS Character Sheet
http://gurpscharactersheet.com
Mozilla Public License 2.0
216 stars 60 forks source link

Changing "Jump to Search" shortcut erases user settings #341

Closed Euthoniel closed 3 years ago

Euthoniel commented 3 years ago

If I change the "Jump to Search" shortcut from Ctrl+J to Ctrl+F, GCS erases all my custom settings such as font, user library location, and page reference. It also defaults the shortcut back to CTRL+J.

richardwilkes commented 3 years ago

I just tried it and didn't have anything abnormal occur. Is there anything in the GCS logs? If so, please post that information here (the FAQ has details on how to find the log file for your OS, if you don't know where that is). Also, state what OS you're using and what version of GCS.

Euthoniel commented 3 years ago

Windows 10, version 4.30. Log below. It says duplicate key, not sure if it matters, but I confirmed I don't have any GCS shortcuts set as Ctrl+F.

E | 2021.05.19 | 13:59:28.213 | java.io.IOException: duplicate key "" at com.trollworks.gcs@4.30.0/com.trollworks.gcs.utility.json.Json.nextMap(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.utility.json.Json.nextValue(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.utility.json.Json.nextMap(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.utility.json.Json.nextValue(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.utility.json.Json.parse(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.preferences.Preferences.(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.preferences.Preferences.getInstance(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.ui.Fonts.loadFromPreferences(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.ui.UIUtilities.initialize(Unknown Source) at com.trollworks.gcs@4.30.0/com.trollworks.gcs.GCS.main(Unknown Source)

richardwilkes commented 3 years ago

Hmmm... that's actually an error while trying to load your preferences. It appears there is bad data in them for some reason, and that is causing an exception to be thrown and default values to be used. Could you post your gcs preferences file here as well?

Euthoniel commented 3 years ago

{ "version": 2, "last_seen_gcs_version": "4.30", "libraries": { "richardwilkes/gcs_master_library": { "path": "C:\Users\Greg\GCS\Master Library", "last_seen": "0.0" }, "*/gcs_user_library": { "path": "C:\OneDrive\GCS Library" } }, "initial_points": 250, "tooltip_timeout": 60, "library_explorer": { "divider_position": 300, "open_row_keys": [

    ]
},
"user_description_display": "tooltip",
"modifiers_display": "inline",
"notes_display": "inline",
"initial_ui_scale": "actual_size",
"default_length_units": "ft_in",
"default_weight_units": "lb",
"recent_files": [

],
"last_dir": "C:\\Users\\Greg",
"pdf_refs": {

},
"key_bindings": {

},
"fonts": {
    "label.secondary": {
        "name": "Georgia Pro Light",
        "style": "plain",
        "size": 11
    },
    "field.secondary": {
        "name": "Georgia Pro",
        "style": "plain",
        "size": 16
    },
    "footer.primary": {
        "name": "Roboto",
        "style": "plain",
        "size": 6
    },
    "label.primary": {
        "name": "Georgia Pro",
        "style": "plain",
        "size": 12
    },
    "field.primary": {
        "name": "Georgia Pro Semibold",
        "style": "bold",
        "size": 16
    }
},
"window_positions": {
    "workspace": {
        "x": 20,
        "y": 20,
        "width": 1880,
        "height": 1160,
        "last_updated": 1621460438874
    },
    "preferences": {
        "x": 156,
        "y": 156,
        "width": 594,
        "height": 615,
        "last_updated": 1621460397446
    }
},
"attributes": [
    {
        "id": "st",
        "type": "integer",
        "name": "ST",
        "full_name": "Strength",
        "attribute_base": "10",
        "cost_per_point": 10,
        "cost_adj_percent_per_sm": 10
    },
    {
        "id": "dx",
        "type": "integer",
        "name": "DX",
        "full_name": "Dexterity",
        "attribute_base": "10",
        "cost_per_point": 10,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "iq",
        "type": "integer",
        "name": "IQ",
        "full_name": "Intelligence",
        "attribute_base": "10",
        "cost_per_point": 10,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "ht",
        "type": "integer",
        "name": "HT",
        "full_name": "Health",
        "attribute_base": "10",
        "cost_per_point": 10,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "will",
        "type": "integer",
        "name": "Will",
        "full_name": "",
        "attribute_base": "10",
        "cost_per_point": 10,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "fright_check",
        "type": "integer",
        "name": "Fright Check",
        "full_name": "",
        "attribute_base": "$will",
        "cost_per_point": 2,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "per",
        "type": "integer",
        "name": "Per",
        "full_name": "Perception",
        "attribute_base": "10",
        "cost_per_point": 10,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "vision",
        "type": "integer",
        "name": "Vision",
        "full_name": "",
        "attribute_base": "$per",
        "cost_per_point": 2,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "hearing",
        "type": "integer",
        "name": "Hearing",
        "full_name": "",
        "attribute_base": "$per",
        "cost_per_point": 2,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "taste_smell",
        "type": "integer",
        "name": "Taste & Smell",
        "full_name": "",
        "attribute_base": "$per",
        "cost_per_point": 2,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "touch",
        "type": "integer",
        "name": "Touch",
        "full_name": "",
        "attribute_base": "$per",
        "cost_per_point": 2,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "basic_speed",
        "type": "decimal",
        "name": "Basic Speed",
        "full_name": "",
        "attribute_base": "($dx+$ht)/4",
        "cost_per_point": 20,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "basic_move",
        "type": "integer",
        "name": "Basic Move",
        "full_name": "",
        "attribute_base": "floor($basic_speed)",
        "cost_per_point": 5,
        "cost_adj_percent_per_sm": 0
    },
    {
        "id": "fp",
        "type": "pool",
        "name": "FP",
        "full_name": "Fatigue Points",
        "attribute_base": "$ht",
        "cost_per_point": 3,
        "cost_adj_percent_per_sm": 0,
        "thresholds": [
            {
                "state": "Unconscious",
                "explanation": "",
                "multiplier": -1,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge",
                    "halve_st"
                ]
            },
            {
                "state": "Collapse",
                "explanation": "<html><body>\n<b>Roll vs. Will<\/b> to do anything besides talk or rest; failure causes unconsciousness<br>\nEach FP you lose below 0 also causes 1 HP of injury<br>\nMove, Dodge and ST are halved (B426)\n<\/body><\/html>",
                "multiplier": 0,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge",
                    "halve_st"
                ]
            },
            {
                "state": "Tired",
                "explanation": "Move, Dodge and ST are halved (B426)",
                "multiplier": 1,
                "divisor": 3,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge",
                    "halve_st"
                ]
            },
            {
                "state": "Tiring",
                "explanation": "",
                "multiplier": 1,
                "divisor": 1,
                "addition": -1,
                "ops": [

                ]
            },
            {
                "state": "Rested",
                "explanation": "",
                "multiplier": 1,
                "divisor": 1,
                "addition": 0,
                "ops": [

                ]
            }
        ]
    },
    {
        "id": "hp",
        "type": "pool",
        "name": "HP",
        "full_name": "Hit Points",
        "attribute_base": "$st",
        "cost_per_point": 2,
        "cost_adj_percent_per_sm": 10,
        "thresholds": [
            {
                "state": "Dead",
                "explanation": "",
                "multiplier": -5,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge"
                ]
            },
            {
                "state": "Dying #4",
                "explanation": "<html><body>\n<b>Roll vs. HT<\/b> to avoid death<br>\n<b>Roll vs. HT-4<\/b> every second to avoid falling unconscious<br>\nMove and Dodge are halved (B419)\n<\/body><\/html>",
                "multiplier": -4,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge"
                ]
            },
            {
                "state": "Dying #3",
                "explanation": "<html><body>\n<b>Roll vs. HT<\/b> to avoid death<br>\n<b>Roll vs. HT-3<\/b> every second to avoid falling unconscious<br>\nMove and Dodge are halved (B419)\n<\/body><\/html>",
                "multiplier": -3,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge"
                ]
            },
            {
                "state": "Dying #2",
                "explanation": "<html><body>\n<b>Roll vs. HT<\/b> to avoid death<br>\n<b>Roll vs. HT-2<\/b> every second to avoid falling unconscious<br>\nMove and Dodge are halved (B419)\n<\/body><\/html>",
                "multiplier": -2,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge"
                ]
            },
            {
                "state": "Dying #1",
                "explanation": "<html><body>\n<b>Roll vs. HT<\/b> to avoid death<br>\n<b>Roll vs. HT-1<\/b> every second to avoid falling unconscious<br>\nMove and Dodge are halved (B419)\n<\/body><\/html>",
                "multiplier": -1,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge"
                ]
            },
            {
                "state": "Collapse",
                "explanation": "<html><body>\n<b>Roll vs. HT<\/b> every second to avoid falling unconscious<br>\nMove and Dodge are halved (B419)\n<\/body><\/html>",
                "multiplier": 0,
                "divisor": 1,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge"
                ]
            },
            {
                "state": "Reeling",
                "explanation": "Move and Dodge are halved (B419)",
                "multiplier": 1,
                "divisor": 3,
                "addition": 0,
                "ops": [
                    "halve_move",
                    "halve_dodge"
                ]
            },
            {
                "state": "Wounded",
                "explanation": "",
                "multiplier": 1,
                "divisor": 1,
                "addition": -1,
                "ops": [

                ]
            },
            {
                "state": "Healthy",
                "explanation": "",
                "multiplier": 1,
                "divisor": 1,
                "addition": 0,
                "ops": [

                ]
            }
        ]
    }
],
"hit_locations": {
    "id": "humanoid",
    "name": "Humanoid",
    "roll": "3d",
    "locations": [
        {
            "id": "eye",
            "choice_name": "Eyes",
            "table_name": "Eyes",
            "slots": 0,
            "hit_penalty": -9,
            "dr_bonus": 0,
            "description": "An attack that misses by 1 hits the torso instead. Only impaling (imp), piercing (pi-, pi, pi+, pi++), and tight-beam burning (burn) attacks can target the eye – and only from the front or sides. Injury over HP÷10 blinds the eye. Otherwise, treat as skull, but without the extra DR!",
            "calc": {
                "roll_range": "-"
            }
        },
        {
            "id": "skull",
            "choice_name": "Skull",
            "table_name": "Skull",
            "slots": 2,
            "hit_penalty": -7,
            "dr_bonus": 2,
            "description": "An attack that misses by 1 hits the torso instead. Wounding modifier is x4. Knockdown rolls are at -10. Critical hits use the Critical Head Blow Table (B556). Exception: These special effects do not apply to toxic (tox) damage.",
            "calc": {
                "roll_range": "3-4"
            }
        },
        {
            "id": "face",
            "choice_name": "Face",
            "table_name": "Face",
            "slots": 1,
            "hit_penalty": -5,
            "dr_bonus": 0,
            "description": "An attack that misses by 1 hits the torso instead. Jaw, cheeks, nose, ears, etc. If the target has an open-faced helmet, ignore its DR. Knockdown rolls are at -5. Critical hits use the Critical Head Blow Table (B556). Corrosion (cor) damage gets a x1½ wounding modifier, and if it inflicts a major wound, it also blinds one eye (both eyes on damage over full HP). Random attacks from behind hit the skull instead.",
            "calc": {
                "roll_range": "5"
            }
        },
        {
            "id": "leg",
            "choice_name": "Leg",
            "table_name": "Right Leg",
            "slots": 2,
            "hit_penalty": -2,
            "dr_bonus": 0,
            "description": "Reduce the wounding multiplier of large piercing (pi+), huge piercing (pi++), and impaling (imp) damage to x1. Any major wound (loss of over ½ HP from one blow) cripples the limb. Damage beyond that threshold is lost.",
            "calc": {
                "roll_range": "6-7"
            }
        },
        {
            "id": "arm",
            "choice_name": "Arm",
            "table_name": "Right Arm",
            "slots": 1,
            "hit_penalty": -2,
            "dr_bonus": 0,
            "description": "Reduce the wounding multiplier of large piercing (pi+), huge piercing (pi++), and impaling (imp) damage to x1. Any major wound (loss of over ½ HP from one blow) cripples the limb. Damage beyond that threshold is lost. If holding a shield, double the penalty to hit: -4 for shield arm instead of -2.",
            "calc": {
                "roll_range": "8"
            }
        },
        {
            "id": "torso",
            "choice_name": "Torso",
            "table_name": "Torso",
            "slots": 2,
            "hit_penalty": 0,
            "dr_bonus": 0,
            "description": "",
            "calc": {
                "roll_range": "9-10"
            }
        },
        {
            "id": "groin",
            "choice_name": "Groin",
            "table_name": "Groin",
            "slots": 1,
            "hit_penalty": -3,
            "dr_bonus": 0,
            "description": "An attack that misses by 1 hits the torso instead. Human males and the males of similar species suffer double shock from crushing (cr) damage, and get -5 to knockdown rolls. Otherwise, treat as a torso hit.",
            "calc": {
                "roll_range": "11"
            }
        },
        {
            "id": "arm",
            "choice_name": "Arm",
            "table_name": "Left Arm",
            "slots": 1,
            "hit_penalty": -2,
            "dr_bonus": 0,
            "description": "Reduce the wounding multiplier of large piercing (pi+), huge piercing (pi++), and impaling (imp) damage to x1. Any major wound (loss of over ½ HP from one blow) cripples the limb. Damage beyond that threshold is lost. If holding a shield, double the penalty to hit: -4 for shield arm instead of -2.",
            "calc": {
                "roll_range": "12"
            }
        },
        {
            "id": "leg",
            "choice_name": "Leg",
            "table_name": "Left Leg",
            "slots": 2,
            "hit_penalty": -2,
            "dr_bonus": 0,
            "description": "Reduce the wounding multiplier of large piercing (pi+), huge piercing (pi++), and impaling (imp) damage to x1. Any major wound (loss of over ½ HP from one blow) cripples the limb. Damage beyond that threshold is lost.",
            "calc": {
                "roll_range": "13-14"
            }
        },
        {
            "id": "hand",
            "choice_name": "Hand",
            "table_name": "Hand",
            "slots": 1,
            "hit_penalty": -4,
            "dr_bonus": 0,
            "description": "If holding a shield, double the penalty to hit: -8 for shield hand instead of -4. Reduce the wounding multiplier of large piercing (pi+), huge piercing (pi++), and impaling (imp) damage to x1. Any major wound (loss of over ⅓ HP from one blow) cripples the extremity. Damage beyond that threshold is lost.",
            "calc": {
                "roll_range": "15"
            }
        },
        {
            "id": "foot",
            "choice_name": "Foot",
            "table_name": "Foot",
            "slots": 1,
            "hit_penalty": -4,
            "dr_bonus": 0,
            "description": "Reduce the wounding multiplier of large piercing (pi+), huge piercing (pi++), and impaling (imp) damage to x1. Any major wound (loss of over ⅓ HP from one blow) cripples the extremity. Damage beyond that threshold is lost.",
            "calc": {
                "roll_range": "16"
            }
        },
        {
            "id": "neck",
            "choice_name": "Neck",
            "table_name": "Neck",
            "slots": 2,
            "hit_penalty": -5,
            "dr_bonus": 0,
            "description": "An attack that misses by 1 hits the torso instead. Neck and throat. Increase the wounding multiplier of crushing (cr) and corrosion (cor) attacks to x1½, and that of cutting (cut) damage to x2. At the GM’s option, anyone killed by a cutting (cut) blow to the neck is decapitated!",
            "calc": {
                "roll_range": "17-18"
            }
        },
        {
            "id": "vitals",
            "choice_name": "Vitals",
            "table_name": "Vitals",
            "slots": 0,
            "hit_penalty": -3,
            "dr_bonus": 0,
            "description": "An attack that misses by 1 hits the torso instead. Heart, lungs, kidneys, etc. Increase the wounding modifier for an impaling (imp) or any piercing (pi-, pi, pi+, pi++) attack to x3. Increase the wounding modifier for a tight-beam burning (burn) attack to x2. Other attacks cannot target the vitals.",
            "calc": {
                "roll_range": "-"
            }
        }
    ]
},
"page": {
    "paper_size": "iso-a3",
    "top_margin": "0.25 in",
    "left_margin": "0.25 in",
    "bottom_margin": "0.25 in",
    "right_margin": "0.25 in",
    "orientation": "portrait"
},
"gurps_calculator_key": "",
"default_player_name": "Greg",
"default_tech_level": "8",
"default_portrait_path": "!\u0000",
"png_resolution": 300,
"include_unspent_points_in_total": true,
"use_multiplicative_modifiers": false,
"use_modifying_dice_plus_adds": false,
"use_know_your_own_strength": false,
"use_reduced_swing": false,
"use_thrust_equals_swing_minus_2": false,
"use_simple_metric_conversions": true,
"show_college_in_sheet_spells": false,
"show_difficulty": false,
"show_advantage_modifier_adj": false,
"show_equipment_modifier_adj": false,
"show_spell_adj": true,
"use_title_in_footer": false,
"auto_fill_profile": true,
"theme": {
    "current": "252,242,196",
    "on_current": "Black",
    "warn": "255,205,210",
    "on_warn": "Black",
    "page": "White",
    "on_page": "Black",
    "page_void": "Silver",
    "header": "43,43,43",
    "on_header": "White",
    "divider": "Silver",
    "editable_line": "Silver",
    "on_editable": "0,0,192",
    "banding": "232,255,232"
}

}

richardwilkes commented 3 years ago

So I don't see anything wrong in the preferences other than incorrect escaping in the paths for your libraries. Did you edit this by hand at all?

Euthoniel commented 3 years ago

Yeah, I hadn't put all my settings back in GCS yet from when it erased them, and when I went to copy it I realized I forgot to change my user library location, so stupidly tried to edit it in by hand. That was the only thing I switched, that portion is below unedited from GCS

I tried clearing the "Jump to Search" shortcut and it does the same thing, changes the settings back to default and sets the shortcut back to Ctrl+J.

Also, I can change the other shortcut keys just fine, it is only the "Jump to Search" that has issues. I kinda changed it on a whim and since it isn't reproducible, I'm fine just using Ctrl+J.

{
    "version": 2,
    "last_seen_gcs_version": "4.30",
    "libraries": {
        "richardwilkes/gcs_master_library": {
            "path": "C:\\Users\\Greg\\GCS\\Master Library",
            "last_seen": "0.0"
        },
        "*/gcs_user_library": {
            "path": "C:\\OneDrive\\GCS Library"
        }
    },
richardwilkes commented 3 years ago

OK, that part looks correct now.

I haven't tried to reproduce this on Windows yet -- will try to do that later today.

Euthoniel commented 3 years ago

Just for clarification for reproducing, it only switches back to default settings after I close and reopen GCS.

Euthoniel commented 3 years ago

After I change the jump to search shortcut to Ctrl+F, this what the key bindings section of the gcs preferences looks like before I reopen gcs. What is supposed to be in those empty quotes? Maybe if I put it in by hand it will work?

"key_bindings": {
    "": "ctrl pressed F"
},
richardwilkes commented 3 years ago

Ah... that helps. I see what the problem is now. Unfortunately, nothing you can do about it -- don't try to set that particular command's key binding. The results will be unpredictable until I make a new release to fix it.

In the meantime, I'd remove the line: "": "ctrl pressed F" from the file.