save_file = sys.argv[1] var_assignment = sys.argv[2]
def on_variable_select(self, event): selection = self.variable_listbox.curselection() if not selection: return var_name = self.variable_listbox.get(selection[0]) var_info = self.all_variables.get(var_name, {}) self.var_name_label.config(text=var_name) self.var_type_label.config(text=var_info.get('type', 'unknown')) # Display value in editable text box value = var_info.get('value', '') if isinstance(value, (dict, list)): value = json.dumps(value, indent=2) else: value = str(value) self.value_entry.delete(1.0, tk.END) self.value_entry.insert(1.0, value) renpy save editor
def filter_variables(self, *args): search_term = self.search_var.get().lower() self.variable_listbox.delete(0, tk.END) for var_name in sorted(self.all_variables.keys()): if search_term in var_name.lower() or not search_term: self.variable_listbox.insert(tk.END, var_name) save_file = sys
def extract_variables(self): """Extract game variables from save data""" self.all_variables = {} if isinstance(self.save_data, dict): # Common Ren'Py save structure if 'variables' in self.save_data: variables_dict = self.save_data['variables'] else: variables_dict = self.save_data # Filter and categorize variables for key, value in variables_dict.items(): # Skip internal Ren'Py variables if key.startswith(('_', 'renpy', 'config')): continue var_type = type(value).__name__ self.all_variables[key] = 'value': value, 'type': var_type '') if isinstance(value
print(f"✓ Updated variable = new_value") if == " main ": if len(sys.argv) != 4: print("Usage: python quick_edit.py savefile variable value") sys.exit(1)
# Parse value try: if var_value.isdigit(): var_value = int(var_value) elif var_value.lower() in ('true', 'false'): var_value = var_value.lower() == 'true' except: pass
var_name, var_value = var_assignment.split('=', 1)