Skip to content

Commit

Permalink
Merge branch 'main' into update_ui_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiisu-Master authored Nov 30, 2023
2 parents 8714b40 + d591533 commit 7a344a8
Show file tree
Hide file tree
Showing 154 changed files with 5,167 additions and 2,426 deletions.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Bug report
about: Report a bug in GodSVG
title: Title
labels: bug
assignees: ''

---

Give a clear and concise description of what the bug is and what the expected behavior is. For non-trivial issues, provide reproduction steps and screenshots if relevant.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: Feature request
about: Suggest a new feature for GodSVG
title: Title
labels: proposal
assignees: ''

---

Describe the limitation you're facing and how the feature will help resolve it. If you can, give more detail about the implementation.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

# Imported translations (automatically generated from CSV files)
*.translation
export_presets.cfg
6 changes: 6 additions & 0 deletions AppInfo.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ const version := "1.0.dev"
const project_founders: Array[String] = ["MewPurPur"]
const project_managers: Array[String] = ["MewPurPur"]


# The developers who contributed significant patches to the MIT-licensed source code
# of GodSVG are listed here. What counts as "significant" is decided arbitrarily.
# The format is either "Real Name (GitHub username)" or "GitHub username".

const authors: Array[String] = [
"ajreckof",
"Kiisu-Master",
"MewPurPur",
"Serem Titus (SeremTitus)",
"Swarkin",
"thiagola92",
"Tom Blackwell (Volts-s)"
]
9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ Do understand that PRs with a large maintenance cost may be under high scrutiny
For scripts, only GDScript code is allowed. Follow the [GDScript style guide](https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html). Most of its rules are enforced here. Additionally:

- Static typing is predominantly used.
- Comments should be written like sentences with punctuation.
- Class names must use `class_name X extends Y` syntax.
- `@export` should only be used for nodes if the runtime structure is not known.
- Comments are usually written like sentences with punctuation.
- For empty lines in the middle of indented blocks, the scope's indentation is kept.
- Class names use `class_name X extends Y` syntax.
- `@export` for nodes is only used if the runtime structure is not known.

Pull requests may get production tweaks to fix their style before being merged.
Don't make pull requests for code style changes without discussing them first (unless it's for corrections to abide by the ones described here). Pull requests may also get production tweaks to fix their style before being merged.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# GodSVG

![image](https://github.com/MewPurPur/GodSVG/assets/85438892/2a8a674d-af79-4db8-a817-57342549e670)
![image](https://github.com/MewPurPur/GodSVG/assets/85438892/27720600-3e51-46c5-98e8-80f2469781a8)

**GodSVG is an application for creating optimized Scalable Vector Graphics (SVG) files.** It is mainly designed for programmers, allowing them to easily edit individual SVG elements and view the corresponding code in real-time.
GodSVG is inspired by the need for a SVG editor without abstractions that produces optimized SVG files.
GodSVG is inspired by the need for an SVG editor without abstractions that produces optimized SVG files.

## Features

- **Interactive SVG editing:** Modify individual elements of a SVG file using a user-friendly interface.
- **Interactive SVG editing:** Modify individual elements of an SVG file using a user-friendly interface.
- **Real-time code:** As you manipulate elements in the UI, code is instantly generated and can be edited.
- **Optimized SVG output:** Generate clean and efficient SVG files. _(Planned: Ways to minify the output)_
- **Accessible on mobile:** GodSVG aims to be usable on mobile devices.
Expand All @@ -28,23 +28,21 @@ GodSVG is inspired by the need for a SVG editor without abstractions that produc
| rect | Supported | |
| stop | Planned soon | |

Support for all other elements is currently not planned. GodSVG still aims to allow interfacing with other tags, but not natively.
Support for all other elements is currently not planned. GodSVG can still work with them, though it won't recognize them.

## Installation

Currently, there are no pre-built binaries available for GodSVG. However, you can still run it by following these steps:

1. Clone the repository: `git clone https://github.com/MewPurPur/GodSVG.git`
2. Open the project in Godot Engine. (4.2.dev5 minimum needed)
2. Open the project in Godot Engine. (4.2.beta6 minimum needed)
3. Build and run the project within the Godot Engine editor.

## Community and contributing

Contributions are very welcome! GodSVG is built in Godot. For code contributions, read the [Contributing Guidelines](CONTRIBUTING.md).
Contributions are very welcome! GodSVG is built in Godot. For code contributions, read the [Contributing Guidelines](CONTRIBUTING.md). Before starting work on features, first propose them by using the issue form and wait for approval.

To report bugs, use Github's issue form. Please first propose new features by using the issue form and wait for approval before starting to work on them.

For more casual discussion around the tool or contributing to it, find me on [GodSVG's Discord](https://discord.gg/K4ThGckGGw).
To report bugs or propose features, use Github's issue form. For more casual discussion around the tool or contributing to it, find me on [GodSVG's Discord](https://discord.gg/K4ThGckGGw).

## License

Expand All @@ -53,3 +51,5 @@ GodSVG is licensed under the MIT License:
- You are free to use GodSVG for any purpose. GodSVG's license terms and copyright do not apply to the content created with it.
- You can study how GodSVG works and change it.
- You may distribute modified versions of GodSVG. Derivative products may use a different license, but they must still document that they derive from the MIT-licensed GodSVG.

The above explanation reflects my understanding of my own license terms and does not constitute legal advice.
21 changes: 19 additions & 2 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,15 @@ config/tags=PackedStringArray("project")
run/main_scene="res://src/ui_parts/main_scene.tscn"
config/features=PackedStringArray("4.2", "Forward Plus")
run/low_processor_mode=true
boot_splash/bg_color=Color(0.1065, 0.1181, 0.15, 1)
boot_splash/image="res://visual/splash.png"
boot_splash/fullsize=false
config/icon="res://visual/icon.png"

[audio]

driver/driver="Dummy"

[autoload]

SVG="*res://src/SVG.gd"
Expand All @@ -28,8 +35,14 @@ Indications="*res://src/Indications.gd"
window/size/viewport_width=1024
window/size/viewport_height=640
window/size/mode=2
window/energy_saving/keep_screen_on=false
mouse_cursor/tooltip_position_offset=Vector2(0, 10)

[filesystem]

import/blender/enabled=false
import/fbx/enabled=false

[gui]

theme/custom="res://visual/main_theme.tres"
Expand Down Expand Up @@ -68,6 +81,11 @@ duplicate={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
]
}
select_all={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"command_or_control_autoremap":true,"alt_pressed":false,"shift_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
]
}
move_relative={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":77,"key_label":0,"unicode":109,"echo":false,"script":null)
Expand Down Expand Up @@ -165,7 +183,7 @@ shorthand_cubic_bezier_relative={
}
shorthand_cubic_bezier_absolute={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":67,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":83,"echo":false,"script":null)
]
}

Expand All @@ -177,4 +195,3 @@ locale/translations=PackedStringArray("res://translations/translation_sheet.bg.t

renderer/rendering_method="gl_compatibility"
environment/defaults/default_clear_color=Color(0.12, 0.132, 0.2, 1)
anti_aliasing/quality/screen_space_aa=1
44 changes: 31 additions & 13 deletions src/GlobalSettings.gd
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## This singleton handles save data and settings.
extends Node

const save_path = "user://save.tres"
var save_data := SaveData.new()
const save_path = "user://save.tres"

var _palettes := SavedColorPalettes.new()
const palettes_save_path = "user://palettes.tres"

const config_path = "user://config.tres"
var config := ConfigFile.new()
Expand All @@ -24,15 +27,6 @@ var language: StringName:
TranslationServer.set_locale(new_value)
save_setting("text", "language", language)

var save_window_mode := false:
set(new_value):
save_window_mode = new_value
save_setting("session", "save_window_mode", save_window_mode)

var save_svg := false:
set(new_value):
save_svg = new_value
save_setting("session", "save_svg", save_svg)
var invert_zoom := false:
set(new_value):
invert_zoom = new_value
Expand All @@ -42,23 +36,44 @@ func save_setting(section: String, setting: String, saved_value: Variant) -> voi
config.set_value(section, setting, saved_value)
config.save(config_path)

func modify_save_data(property: StringName, new_value: Variant) -> void:
save_data.set(property, new_value)
ResourceSaver.save(save_data, save_path)

func save_user_data() -> void:
ResourceSaver.save(save_data, save_path)
ResourceSaver.save(_palettes, palettes_save_path)

func load_user_data() -> void:
if FileAccess.file_exists(save_path):
save_data = ResourceLoader.load(save_path)

if FileAccess.file_exists(palettes_save_path):
_palettes = ResourceLoader.load(palettes_save_path)
else:
var default_palette_pure := ColorPalette.new("Pure", [
NamedColor.new("fff", "White"),
NamedColor.new("000", "Black"),
NamedColor.new("f00", "Red"),
NamedColor.new("0f0", "Green"),
NamedColor.new("00f", "Blue"),
NamedColor.new("ff0", "Yellow"),
NamedColor.new("f0f", "Magenta"),
NamedColor.new("0ff", "Cyan"),
])
get_palettes().append(default_palette_pure)
ResourceSaver.save(_palettes, palettes_save_path)

func _exit_tree() -> void:
save_data.window_mode = DisplayServer.window_get_mode()
save_data.svg = SVG.string
save_data.svg_text = SVG.text
save_user_data()

func _enter_tree() -> void:
load_settings()
load_user_data()
if save_window_mode:
DisplayServer.window_set_mode(save_data.window_mode)
DisplayServer.window_set_mode(save_data.window_mode)
get_window().wrap_controls = true # Prevents the main window from getting too small.


func load_settings() -> void:
Expand All @@ -75,3 +90,6 @@ func reset_settings() -> void:
for section in default_config.keys():
for setting in default_config[section].keys():
set(setting, default_config[section][setting])

func get_palettes() -> Array[ColorPalette]:
return _palettes.palettes
Loading

0 comments on commit 7a344a8

Please sign in to comment.