this repo has no description

Compare changes

Choose any two refs to compare.

+2 -3
.gitignore
··· 1 1 .idea 2 2 bin 3 3 obj 4 - export_presets.cfg 5 - *.pck 6 - *.DotSettings.user 4 + *.DotSettings.user 5 + manifestation
+16 -1
Atproto/AtProtoSaveFactory.cs
··· 13 13 .Named("AtProtoSave") 14 14 .Patching("res://Scenes/Singletons/UserSave/usersave.gdc") 15 15 .AddRule(new TransformationRuleBuilder() 16 + .Named("ready_slot_condition") 17 + .Matching(TransformationPatternFactory.CreateGdSnippetPattern("_load_save(last_loaded_slot)", 2)) 18 + .Do(Operation.ReplaceAll) 19 + .With(""" 20 + var Atproto = $"/root/Atproto" 21 + if last_loaded_slot != Atproto.ATPROTO_SLOT or Atproto.config.Autoload: 22 + _load_save(last_loaded_slot) 23 + else: 24 + last_loaded_slot = -1 25 + """, 2) 26 + ) 27 + .AddRule(new TransformationRuleBuilder() 16 28 .Named("save_file") 17 29 .Matching(TransformationPatternFactory.CreateGdSnippetPattern( 18 30 "\"locked_refs\": PlayerData.locked_refs, \n\t}\n", 2)) 19 31 .Do(Operation.Append) 20 - .With("var atproto = $\"/root/Atproto\"\nif atproto.AtProtoClient.connected() && atproto.save_loaded != null:\n\tatproto.AtProtoClient.save_file()\n", 1)).Build(); 32 + .With("var atproto = $\"/root/Atproto\"\nif atproto.can_save_to_atproto():\n\tatproto.AtProtoClient.save_file()\n", 1) 33 + ) 34 + 35 + .Build(); 21 36 } 22 37 }
+1 -5
Atproto/Atproto.csproj
··· 4 4 <ImplicitUsings>enable</ImplicitUsings> 5 5 <Nullable>enable</Nullable> 6 6 <AssemblySearchPaths>$(AssemblySearchPaths);$(GDWeavePath)/core</AssemblySearchPaths> 7 - <Version>1.0.1.0</Version> 7 + <Version>1.0.2.0</Version> 8 8 <RootNamespace>Atproto</RootNamespace> 9 9 </PropertyGroup> 10 10 11 11 <ItemGroup> 12 12 <Reference Include="GDWeave" Private="false"/> 13 13 <Reference Include="Serilog" Private="false"/> 14 - </ItemGroup> 15 - 16 - <ItemGroup> 17 - <None Include="manifest.json" CopyToOutputDirectory="PreserveNewest"/> 18 14 </ItemGroup> 19 15 20 16 <Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(GDWeavePath)' != ''">
-14
Atproto/manifest.json
··· 1 - { 2 - "Id": "Atproto", 3 - "AssemblyPath": "Atproto.dll", 4 - "Metadata": { 5 - "Name": "Atproto Webfishing", 6 - "Author": "Estym", 7 - "Version": "1.0.1", 8 - "Description": "A mod that sends data to your AtProto PDS." 9 - }, 10 - "PackPath": "atproto.pck", 11 - "Dependencies": [ 12 - "TackleBox" 13 - ] 14 - }
+7 -1
README.md
··· 1 1 # AtProto Webfishing 2 2 3 3 A Webfishing mod that send data to your PDS 4 - [Download Link](https://fb.dreamteam.boo/api/public/dl/oMcpvwyP/Webfishing-Atproto.zip) 4 + 5 + [ThunderStore Link](https://thunderstore.io/c/webfishing/p/EstymMods/Webfishing_Atproto/) 5 6 6 7 # Features 7 8 - Remote save files ··· 17 18 After it's done, you can select a save file or create one, then load it ! 18 19 19 20 When a file is loaded, the savedata will be synchronized to your PDS each time the game saves. 21 + 22 + ## How to send your save online 23 + 24 + To send your save on your PDS, simply create a new save and click on "Duplicate Save", it will create a new save on the PDS with the local data you have. 25 + 20 26 21 27 ## Credits 22 28
-1
gdscript/.import/.gdignore
··· 1 -
-264
gdscript/mods/Atproto/assets/at_proto.tres
··· 1 - [gd_resource type="Theme" load_steps=28 format=2] 2 - 3 - [ext_resource path="res://Assets/Textures/UI/scrollbar.png" type="Texture" id=1] 4 - [ext_resource path="res://Assets/Themes/main_font.tres" type="DynamicFont" id=2] 5 - 6 - [sub_resource type="StyleBoxFlat" id=1] 7 - content_margin_left = 12.0 8 - content_margin_right = 12.0 9 - bg_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 10 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 11 - corner_radius_top_left = 12 12 - corner_radius_top_right = 12 13 - corner_radius_bottom_right = 12 14 - corner_radius_bottom_left = 12 15 - corner_detail = 5 16 - 17 - [sub_resource type="StyleBoxEmpty" id=34] 18 - 19 - [sub_resource type="StyleBoxFlat" id=30] 20 - content_margin_left = 12.0 21 - content_margin_right = 12.0 22 - bg_color = Color( 0.611765, 0.568627, 0.290196, 1 ) 23 - border_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 24 - corner_radius_top_left = 12 25 - corner_radius_top_right = 12 26 - corner_radius_bottom_right = 12 27 - corner_radius_bottom_left = 12 28 - corner_detail = 5 29 - expand_margin_left = 1.0 30 - expand_margin_right = 1.0 31 - expand_margin_top = 1.0 32 - expand_margin_bottom = 1.0 33 - 34 - [sub_resource type="StyleBoxFlat" id=31] 35 - content_margin_left = 12.0 36 - content_margin_right = 12.0 37 - bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 38 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 39 - corner_radius_top_left = 12 40 - corner_radius_top_right = 12 41 - corner_radius_bottom_right = 12 42 - corner_radius_bottom_left = 12 43 - 44 - [sub_resource type="StyleBoxFlat" id=32] 45 - content_margin_left = 12.0 46 - content_margin_right = 12.0 47 - bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 48 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 49 - corner_radius_top_left = 12 50 - corner_radius_top_right = 12 51 - corner_radius_bottom_right = 12 52 - corner_radius_bottom_left = 12 53 - corner_detail = 5 54 - 55 - [sub_resource type="StyleBoxFlat" id=18] 56 - bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 57 - border_width_left = 6 58 - border_color = Color( 1, 1, 1, 0 ) 59 - corner_radius_top_left = 4 60 - corner_radius_top_right = 4 61 - corner_radius_bottom_right = 4 62 - corner_radius_bottom_left = 4 63 - 64 - [sub_resource type="StyleBoxFlat" id=15] 65 - bg_color = Color( 0.611765, 0.568627, 0.290196, 1 ) 66 - border_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 67 - corner_radius_top_left = 12 68 - corner_radius_top_right = 12 69 - corner_radius_bottom_right = 12 70 - corner_radius_bottom_left = 12 71 - corner_detail = 5 72 - 73 - [sub_resource type="StyleBoxFlat" id=21] 74 - bg_color = Color( 0.0627451, 0.109804, 0.192157, 1 ) 75 - draw_center = false 76 - border_width_left = 16 77 - border_color = Color( 1, 1, 1, 0 ) 78 - corner_radius_top_left = 4 79 - corner_radius_top_right = 4 80 - corner_radius_bottom_right = 4 81 - corner_radius_bottom_left = 4 82 - 83 - [sub_resource type="StyleBoxEmpty" id=20] 84 - 85 - [sub_resource type="StyleBoxFlat" id=35] 86 - 87 - [sub_resource type="StyleBoxFlat" id=36] 88 - 89 - [sub_resource type="StyleBoxFlat" id=37] 90 - bg_color = Color( 0.0627451, 0.109804, 0.192157, 1 ) 91 - corner_radius_top_left = 8 92 - corner_radius_top_right = 8 93 - corner_radius_bottom_right = 8 94 - corner_radius_bottom_left = 8 95 - expand_margin_top = 3.0 96 - expand_margin_bottom = 3.0 97 - 98 - [sub_resource type="StyleBoxFlat" id=33] 99 - content_margin_left = 12.0 100 - content_margin_right = 12.0 101 - bg_color = Color( 0.572549, 0.45098, 0.290196, 1 ) 102 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 103 - corner_radius_top_left = 12 104 - corner_radius_top_right = 12 105 - corner_radius_bottom_right = 12 106 - corner_radius_bottom_left = 12 107 - 108 - [sub_resource type="StyleBoxFlat" id=9] 109 - bg_color = Color( 1, 0.933333, 0.835294, 1 ) 110 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 111 - corner_radius_top_left = 32 112 - corner_radius_top_right = 32 113 - corner_radius_bottom_right = 32 114 - corner_radius_bottom_left = 32 115 - 116 - [sub_resource type="ImageTexture" id=24] 117 - 118 - [sub_resource type="StyleBoxFlat" id=25] 119 - content_margin_left = 4.0 120 - content_margin_right = 4.0 121 - bg_color = Color( 0.611765, 0.568627, 0.290196, 1 ) 122 - corner_radius_top_left = 8 123 - corner_radius_top_right = 8 124 - corner_radius_bottom_right = 8 125 - corner_radius_bottom_left = 8 126 - expand_margin_left = 2.0 127 - expand_margin_right = 2.0 128 - expand_margin_top = 2.0 129 - 130 - [sub_resource type="StyleBoxEmpty" id=26] 131 - 132 - [sub_resource type="StyleBoxEmpty" id=27] 133 - 134 - [sub_resource type="StyleBoxFlat" id=28] 135 - content_margin_left = 8.0 136 - content_margin_right = 8.0 137 - bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 138 - corner_radius_bottom_right = 12 139 - corner_radius_bottom_left = 12 140 - expand_margin_top = 10.0 141 - expand_margin_bottom = 8.0 142 - 143 - [sub_resource type="StyleBoxEmpty" id=29] 144 - 145 - [sub_resource type="StyleBoxFlat" id=4] 146 - bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 147 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 148 - corner_radius_top_left = 12 149 - corner_radius_top_right = 12 150 - corner_radius_bottom_right = 12 151 - corner_radius_bottom_left = 12 152 - expand_margin_left = 2.0 153 - expand_margin_right = 2.0 154 - 155 - [sub_resource type="StyleBoxFlat" id=8] 156 - bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 157 - border_width_left = 2 158 - border_width_top = 2 159 - border_width_right = 2 160 - border_width_bottom = 2 161 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 162 - corner_radius_top_left = 6 163 - corner_radius_top_right = 6 164 - corner_radius_bottom_right = 6 165 - corner_radius_bottom_left = 6 166 - corner_detail = 5 167 - anti_aliasing = false 168 - 169 - [sub_resource type="StyleBoxFlat" id=6] 170 - bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 171 - border_width_left = 2 172 - border_width_top = 2 173 - border_width_right = 2 174 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 175 - corner_radius_top_left = 6 176 - corner_radius_top_right = 6 177 - corner_detail = 5 178 - anti_aliasing = false 179 - 180 - [sub_resource type="StyleBoxFlat" id=7] 181 - bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 182 - border_width_left = 2 183 - border_width_top = 2 184 - border_width_right = 2 185 - border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 186 - corner_radius_top_left = 6 187 - corner_radius_top_right = 6 188 - corner_detail = 5 189 - expand_margin_bottom = 2.0 190 - anti_aliasing = false 191 - 192 - [sub_resource type="StyleBoxEmpty" id=23] 193 - 194 - [resource] 195 - default_font = ExtResource( 2 ) 196 - Button/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 197 - Button/colors/font_color_disabled = Color( 0.835294, 0.666667, 0.45098, 1 ) 198 - Button/colors/font_color_focus = Color( 1, 0.933333, 0.835294, 1 ) 199 - Button/colors/font_color_hover = Color( 1, 0.933333, 0.835294, 1 ) 200 - Button/colors/font_color_pressed = Color( 0.835294, 0.666667, 0.45098, 1 ) 201 - Button/styles/disabled = SubResource( 1 ) 202 - Button/styles/focus = SubResource( 34 ) 203 - Button/styles/hover = SubResource( 30 ) 204 - Button/styles/normal = SubResource( 31 ) 205 - Button/styles/pressed = SubResource( 32 ) 206 - HScrollBar/styles/grabber = SubResource( 18 ) 207 - HScrollBar/styles/grabber_highlight = SubResource( 15 ) 208 - HScrollBar/styles/grabber_pressed = SubResource( 15 ) 209 - HScrollBar/styles/scroll = SubResource( 21 ) 210 - HScrollBar/styles/scroll_focus = SubResource( 20 ) 211 - HSlider/icons/grabber = ExtResource( 1 ) 212 - HSlider/icons/grabber_disabled = ExtResource( 1 ) 213 - HSlider/icons/grabber_highlight = ExtResource( 1 ) 214 - HSlider/styles/grabber_area = SubResource( 35 ) 215 - HSlider/styles/grabber_area_highlight = SubResource( 36 ) 216 - HSlider/styles/slider = SubResource( 37 ) 217 - Label/colors/font_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 218 - LineEdit/colors/cursor_color = Color( 1, 0.933333, 0.835294, 1 ) 219 - LineEdit/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 220 - LineEdit/colors/font_color_selected = Color( 1, 0.933333, 0.835294, 1 ) 221 - LineEdit/colors/font_color_uneditable = Color( 0.835294, 0.666667, 0.45098, 1 ) 222 - LineEdit/styles/focus = SubResource( 33 ) 223 - LineEdit/styles/normal = SubResource( 33 ) 224 - LineEdit/styles/read_only = SubResource( 33 ) 225 - Panel/styles/panel = SubResource( 9 ) 226 - PopupMenu/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 227 - PopupMenu/colors/font_color_hover = Color( 1, 0.933333, 0.835294, 1 ) 228 - PopupMenu/icons/checked = SubResource( 24 ) 229 - PopupMenu/icons/radio_checked = SubResource( 24 ) 230 - PopupMenu/icons/radio_unchecked = SubResource( 24 ) 231 - PopupMenu/icons/submenu = SubResource( 24 ) 232 - PopupMenu/icons/unchecked = SubResource( 24 ) 233 - PopupMenu/styles/hover = SubResource( 25 ) 234 - PopupMenu/styles/labeled_separator_left = SubResource( 26 ) 235 - PopupMenu/styles/labeled_separator_right = SubResource( 27 ) 236 - PopupMenu/styles/panel = SubResource( 28 ) 237 - PopupMenu/styles/panel_disabled = SubResource( 28 ) 238 - PopupMenu/styles/separator = SubResource( 29 ) 239 - ProgressBar/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 240 - ProgressBar/styles/bg = SubResource( 1 ) 241 - ProgressBar/styles/fg = SubResource( 4 ) 242 - RichTextLabel/colors/default_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 243 - TabContainer/colors/font_color_bg = Color( 0.415686, 0.266667, 0.12549, 1 ) 244 - TabContainer/colors/font_color_disabled = Color( 0.611765, 0.0784314, 0.0784314, 1 ) 245 - TabContainer/colors/font_color_fg = Color( 1, 0.933333, 0.835294, 1 ) 246 - TabContainer/styles/panel = SubResource( 8 ) 247 - TabContainer/styles/tab_bg = SubResource( 6 ) 248 - TabContainer/styles/tab_disabled = SubResource( 1 ) 249 - TabContainer/styles/tab_fg = SubResource( 7 ) 250 - Tabs/colors/font_color_bg = Color( 0.835294, 0.666667, 0.45098, 1 ) 251 - Tabs/colors/font_color_fg = Color( 0.835294, 0.666667, 0.45098, 1 ) 252 - TextEdit/colors/caret_color = Color( 1, 0.933333, 0.835294, 1 ) 253 - TextEdit/colors/font_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 254 - TextEdit/colors/font_color_readonly = Color( 0.415686, 0.266667, 0.12549, 1 ) 255 - TextEdit/colors/selection_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 256 - TextEdit/styles/completion = SubResource( 23 ) 257 - TextEdit/styles/focus = SubResource( 23 ) 258 - TextEdit/styles/normal = SubResource( 23 ) 259 - TextEdit/styles/read_only = SubResource( 23 ) 260 - VScrollBar/styles/grabber = SubResource( 18 ) 261 - VScrollBar/styles/grabber_highlight = SubResource( 15 ) 262 - VScrollBar/styles/grabber_pressed = SubResource( 15 ) 263 - VScrollBar/styles/scroll = SubResource( 21 ) 264 - VScrollBar/styles/scroll_focus = SubResource( 20 )
-421
gdscript/mods/Atproto/atproto_client.gd
··· 1 - extends Node 2 - 3 - # Signals 4 - signal connection(suceeded) 5 - 6 - # AtProto 7 - var did 8 - var pds 9 - var accessJwt 10 - var refreshJwt 11 - var Atproto 12 - 13 - # HTTP 14 - var requester: HTTPRequest 15 - 16 - func _enter_tree(): 17 - self.requester = HTTPRequest.new() 18 - Atproto = self.get_parent() 19 - self.add_child(self.requester, true) 20 - 21 - func connected() -> bool: 22 - return accessJwt != null 23 - 24 - func is_token_expired() -> bool: 25 - var json = Marshalls.base64_to_utf8(self.accessJwt.split(".")[1]) 26 - var data = parse_json(json) 27 - var expires = data.exp 28 - var unix = floor(Time.get_unix_time_from_system()) 29 - return expires < unix 30 - 31 - func get_header(): 32 - return [ 33 - "Authorization: Bearer " + self.accessJwt, 34 - "Content-Type: application/json" 35 - ] 36 - 37 - func create_record(record, callback : FuncRef = null): 38 - 39 - if is_token_expired(): 40 - refresh_token("create_record", [record]) 41 - return 42 - 43 - var payload = { 44 - repo = did, 45 - collection = record.at_type, 46 - record = record 47 - } 48 - 49 - var json_payload = JSON.print(payload) 50 - json_payload = json_payload.replace("at_type", "$type") 51 - 52 - var req = self.requester 53 - req.request(pds + "/xrpc/com.atproto.repo.createRecord", get_header(), true, HTTPClient.METHOD_POST, json_payload) 54 - req.connect("request_completed", self, "_create_record_handler", [callback]) 55 - 56 - func _create_record_handler(_result, code, _headers, body: PoolByteArray, callback: FuncRef): 57 - var req = self.requester 58 - req.disconnect("request_completed", self, "_create_record_handler") 59 - if callback == null: 60 - return 61 - 62 - var res = parse_json(body.get_string_from_utf8()) 63 - callback.call_func(res) 64 - 65 - func list_records(callback: FuncRef, collection: String, limit: int = 50, cursor = ""): 66 - var req = self.requester 67 - var query_string = "repo=" + did.http_escape() 68 - query_string += "&collection=" + collection.http_escape() 69 - query_string += "&limit=" + str(limit).http_escape() 70 - query_string += "&cursor=" + str(limit).http_escape() 71 - req.request(pds + "/xrpc/com.atproto.repo.listRecords?" + query_string, get_header(), true, HTTPClient.METHOD_GET) 72 - req.connect("request_completed", self, "_list_record_handler", [callback]) 73 - 74 - 75 - func _list_record_handler(_result, code, _headers, body: PoolByteArray, callback: FuncRef): 76 - var req = self.requester 77 - req.disconnect("request_completed", self, "_list_record_handler") 78 - var res = parse_json(body.get_string_from_utf8()) 79 - callback.call_func(res.records) 80 - 81 - func get_record(callback: FuncRef, did: String, collection: String, rkey: String): 82 - var req = self.requester 83 - var query_string = "repo=" + did.http_escape() 84 - query_string += "&collection=" + collection.http_escape() 85 - query_string += "&rkey=" + rkey.http_escape() 86 - req.request(pds + "/xrpc/com.atproto.repo.getRecord?" + query_string, get_header(), true, HTTPClient.METHOD_GET) 87 - req.connect("request_completed", self, "_get_record_handle", [callback]) 88 - 89 - func _get_record_handle(_result, code, _headers, body: PoolByteArray, callback: FuncRef): 90 - var req = self.requester 91 - req.disconnect("request_completed", self, "_get_record_handle") 92 - var res = parse_json(body.get_string_from_utf8()) 93 - callback.call_func(res) 94 - 95 - func put_record(uri, record): 96 - if is_token_expired(): 97 - refresh_token("put_record", [uri, record]) 98 - return 99 - 100 - var splitted_uri = uri.split("/") 101 - 102 - 103 - var payload = { 104 - repo = splitted_uri[2], 105 - collection = splitted_uri[3], 106 - rkey = splitted_uri[4], 107 - record = record 108 - } 109 - 110 - var json_payload = JSON.print(payload) 111 - json_payload = json_payload.replace("at_type", "$type") 112 - 113 - var req = self.requester 114 - req.request(pds + "/xrpc/com.atproto.repo.putRecord", get_header(), true, HTTPClient.METHOD_POST, json_payload) 115 - 116 - ################ 117 - # LOGIN # 118 - ################ 119 - 120 - func login(handle, password): 121 - var req = self.requester 122 - 123 - req.connect("request_completed", self, "after_handle_resolver", [password]) 124 - req.request("https://bsky.social/xrpc/com.atproto.identity.resolveHandle?handle=" + handle) 125 - 126 - 127 - func after_handle_resolver(_result, code, _headers, body: PoolByteArray, password): 128 - var req = self.requester 129 - req.disconnect("request_completed", self, "after_handle_resolver") 130 - 131 - if code != 200: 132 - emit_signal("connection", false) 133 - return 134 - 135 - var res = parse_json(body.get_string_from_utf8()) 136 - self.did = res.did 137 - 138 - req.connect("request_completed", self, "after_get_pds", [password]) 139 - req.request("https://plc.directory/" + self.did) 140 - 141 - 142 - func after_get_pds(_result, code, _headers, body: PoolByteArray, password): 143 - var req = self.requester 144 - req.disconnect("request_completed", self, "after_get_pds") 145 - 146 - if code != 200: 147 - emit_signal("connection", false) 148 - return 149 - 150 - var res = parse_json(body.get_string_from_utf8()) 151 - for x in res.service: 152 - if x.id == "#atproto_pds": 153 - self.pds = x.serviceEndpoint 154 - 155 - var payload = { 156 - identifier = self.did, 157 - password = password 158 - } 159 - 160 - req.connect("request_completed", self, "after_create_session") 161 - req.request(pds + "/xrpc/com.atproto.server.createSession", ["Content-Type: application/json"], true, HTTPClient.METHOD_POST, JSON.print(payload)) 162 - 163 - func after_create_session(_result, code, _headers, body: PoolByteArray): 164 - var req = self.requester 165 - req.disconnect("request_completed", self, "after_create_session") 166 - 167 - if code != 200: 168 - emit_signal("connection", false) 169 - return 170 - 171 - var res = parse_json(body.get_string_from_utf8()) 172 - self.accessJwt = res.accessJwt 173 - self.refreshJwt = res.refreshJwt 174 - emit_signal("connection", true) 175 - 176 - ####################### 177 - # REFRESH TOKEN # 178 - ####################### 179 - func refresh_token(method = "", payload = []): 180 - var req = self.requester 181 - 182 - var headers = [ 183 - "Authorization: Bearer " + self.refreshJwt, 184 - "Content-Type: application/json" 185 - ] 186 - req.connect("request_completed", self, "after_refresh_token", [method, payload]) 187 - req.request(pds + "/xrpc/com.atproto.server.refreshSession", headers, true, HTTPClient.METHOD_POST) 188 - 189 - func after_refresh_token(_result, _response_code, _headers, body: PoolByteArray, method, payload): 190 - var req = self.requester 191 - req.disconnect("request_completed", self, "after_refresh_token") 192 - 193 - var res = parse_json(body.get_string_from_utf8()) 194 - self.accessJwt = res.accessJwt 195 - self.refreshJwt = res.refreshJwt 196 - 197 - if method != "": 198 - self.callv(method, payload) 199 - 200 - 201 - ###################### 202 - # Method Calls # 203 - ###################### 204 - 205 - func catch_fish(fish, size, quality): 206 - var fish_data = Globals.item_data[fish]["file"] 207 - var record = { 208 - at_type = "dev.regnault.webfishing.fish", 209 - id = fish, 210 - name = fish_data.item_name, 211 - size = str(size), 212 - quality = quality 213 - } 214 - create_record(record) 215 - 216 - 217 - # SAVES 218 - 219 - func create_save_file(uri: String, filename: String, callback: FuncRef = null): 220 - var record = { 221 - at_type = "dev.regnault.webfishing.savefile", 222 - uri = uri, 223 - name = filename, 224 - } 225 - create_record(record, callback) 226 - pass 227 - 228 - func get_saves(callback: FuncRef): 229 - list_records(callback, "dev.regnault.webfishing.savefile") 230 - 231 - func save_file(callback: FuncRef = null): 232 - if !connected(): return 233 - var save_data = { 234 - "inventory": PlayerData.inventory, 235 - "hotbar": PlayerData.hotbar, 236 - "cosmetics_unlocked": PlayerData.cosmetics_unlocked, 237 - "cosmetics_equipped": PlayerData.cosmetics_equipped, 238 - "new_cosmetics": [], 239 - "version": Globals.GAME_VERSION, 240 - "muted_players": PlayerData.players_muted, 241 - "hidden_players": PlayerData.players_hidden, 242 - "recorded_time": PlayerData.last_recorded_time, 243 - "money": PlayerData.money, 244 - "bait_inv": PlayerData.bait_inv, 245 - "bait_selected": PlayerData.bait_selected, 246 - "bait_unlocked": PlayerData.bait_unlocked, 247 - "shop": PlayerData.current_shop, 248 - "journal": PlayerData.journal_logs, 249 - "quests": PlayerData.current_quests, 250 - "completed_quests": PlayerData.completed_quests, 251 - "level": PlayerData.badge_level, 252 - "xp": PlayerData.badge_xp, 253 - "max_bait": PlayerData.max_bait, 254 - "lure_unlocked": PlayerData.lure_unlocked, 255 - "lure_selected": PlayerData.lure_selected, 256 - "saved_aqua_fish": PlayerData.saved_aqua_fish, 257 - "inbound_mail": PlayerData.inbound_mail, 258 - "rod_power": PlayerData.rod_power_level, 259 - "rod_speed": PlayerData.rod_speed_level, 260 - "rod_chance": PlayerData.rod_chance_level, 261 - "rod_luck": PlayerData.rod_luck_level, 262 - "saved_tags": PlayerData.saved_tags, 263 - "loan_level": PlayerData.loan_level, 264 - "loan_left": PlayerData.loan_left, 265 - "buddy_level": PlayerData.buddy_level, 266 - "buddy_speed": PlayerData.buddy_speed, 267 - "guitar_shapes": PlayerData.guitar_shapes, 268 - "fish_caught": PlayerData.fish_caught, 269 - "cash_total": PlayerData.cash_total, 270 - "voice_pitch": PlayerData.voice_pitch, 271 - "voice_speed": PlayerData.voice_speed, 272 - "locked_refs": PlayerData.locked_refs, 273 - } 274 - save_data = save_data.duplicate(true) 275 - 276 - # JOURNAL 277 - var modified_journal = [] 278 - for area in save_data.journal: 279 - var area_entry = { 280 - name = area, 281 - entries = [] 282 - } 283 - for entry_name in save_data.journal[area]: 284 - var entry = save_data.journal[area][entry_name] 285 - area_entry.entries.append({ 286 - name = entry_name, 287 - count = entry.count, 288 - record = str(entry.record), 289 - quality = entry.quality 290 - }) 291 - modified_journal.append(area_entry) 292 - save_data.journal = modified_journal 293 - 294 - # Quests 295 - var modified_quests = [] 296 - for quest_id in save_data.quests: 297 - var entry = save_data.quests[quest_id].duplicate(true) 298 - entry.id = quest_id 299 - modified_quests.append(entry) 300 - save_data.quests = modified_quests 301 - 302 - # Inventory 303 - for item in save_data.inventory: 304 - item.size = str(item.size) 305 - 306 - 307 - # Version 308 - save_data.version = str(save_data.version) 309 - 310 - # Voice Pitch 311 - save_data.voice_pitch = str(save_data.voice_pitch) 312 - 313 - # Aqua Fish 314 - save_data.saved_aqua_fish.size = str(save_data.saved_aqua_fish.size) 315 - 316 - # Letters 317 - for letter in save_data.inbound_mail: 318 - for item in letter.items: 319 - item.size = str(item.size) 320 - save_data.at_type = "dev.regnault.webfishing.save" 321 - 322 - if Atproto.save_loaded: 323 - put_record(Atproto.save_loaded, save_data) 324 - else: 325 - create_record(save_data, callback) 326 - 327 - func load_save(uri: String): 328 - var splitted_uri = uri.split("/") 329 - var did = splitted_uri[2] 330 - var collection = splitted_uri[3] 331 - var rkey = splitted_uri[4] 332 - get_record(funcref(self, "_after_get_save"), did, collection, rkey) 333 - pass 334 - 335 - func _after_get_save(save_record): 336 - var save = save_record.value 337 - 338 - var modified_journal: Dictionary = {} 339 - for area in save.journal: 340 - var area_entries = {} 341 - for entry in area.entries: 342 - area_entries[entry.name] = { 343 - count = entry.count, 344 - record = float(entry.record), 345 - quality = entry.quality 346 - } 347 - 348 - modified_journal[area.name] = area_entries 349 - save.journal = modified_journal 350 - 351 - var modified_quests = {} 352 - for quest in save.quests: 353 - var id = quest.id 354 - modified_quests[quest.id] = quest 355 - modified_quests[quest.id].erase("id") 356 - save.quests = modified_quests 357 - 358 - # Inventory 359 - for item in save.inventory: 360 - item.size = float(item.size) 361 - item.quality = int(item.quality) 362 - var x = PlayerData.QUALITY_DATA[item.quality] 363 - 364 - save.version = float(save.version) 365 - save.saved_aqua_fish.size = float(save.saved_aqua_fish.size) 366 - for letter in save.inbound_mail: 367 - for item in letter.items: 368 - item.size = float(item.size) 369 - item.quality = int(item.quality) 370 - var x = PlayerData.QUALITY_DATA[item.quality] 371 - 372 - var modified_hotbar = {} 373 - for item in save.hotbar: 374 - modified_hotbar[int(item)] = save.hotbar[item] 375 - save.hotbar = modified_hotbar 376 - 377 - PlayerData.inventory = save.inventory 378 - PlayerData.hotbar = save.hotbar 379 - PlayerData.cosmetics_unlocked = save.cosmetics_unlocked 380 - PlayerData.cosmetics_equipped = save.cosmetics_equipped 381 - PlayerData.money = save.money 382 - PlayerData.players_muted = save.muted_players 383 - PlayerData.players_hidden = save.hidden_players 384 - PlayerData.bait_inv = save.bait_inv 385 - PlayerData.bait_selected = save.bait_selected 386 - PlayerData.bait_unlocked = save.bait_unlocked 387 - PlayerData.max_bait = save.max_bait 388 - PlayerData.lure_unlocked = save.lure_unlocked 389 - PlayerData.lure_selected = save.lure_selected 390 - PlayerData.journal_logs = save.journal 391 - PlayerData.current_quests = save.quests 392 - PlayerData.completed_quests = save.completed_quests 393 - PlayerData.badge_level = int(save.level) 394 - PlayerData.badge_xp = int(save.xp) 395 - PlayerData.saved_aqua_fish = save.saved_aqua_fish 396 - PlayerData.inbound_mail = save.inbound_mail 397 - PlayerData.saved_tags = save.saved_tags 398 - PlayerData.loan_level = int(save.loan_level) 399 - PlayerData.loan_left = save.loan_left 400 - PlayerData.rod_power_level = save.rod_power 401 - PlayerData.rod_speed_level = save.rod_speed 402 - PlayerData.rod_chance_level = save.rod_chance 403 - PlayerData.rod_luck_level = save.rod_luck 404 - PlayerData.buddy_level = save.buddy_level 405 - PlayerData.buddy_speed = save.buddy_speed 406 - PlayerData.guitar_shapes = save.guitar_shapes 407 - PlayerData.fish_caught = save.fish_caught 408 - PlayerData.cash_total = save.cash_total 409 - PlayerData.voice_pitch = float(save.voice_pitch) 410 - PlayerData.voice_speed = save.voice_speed 411 - PlayerData.locked_refs = save.locked_refs 412 - PlayerData._validate_guitar_shapes() 413 - PlayerData._validate_inventory() 414 - PlayerData._journal_check() 415 - PlayerData._missing_quest_check() 416 - PlayerData._unlock_defaults() 417 - 418 - Atproto.config.Save = save_record.uri 419 - Atproto.save_loaded = save_record.uri 420 - PopupMessage._show_popup("AtProto save file loaded") 421 -
-72
gdscript/mods/Atproto/main.gd
··· 1 - extends Node 2 - 3 - var config: Dictionary 4 - var save_loaded: String 5 - var default_config: Dictionary = {} 6 - 7 - onready var TackleBox := $"/root/TackleBox" 8 - const AtProtoClient_t := preload("res://mods/Atproto/atproto_client.gd") 9 - var AtProtoClient: AtProtoClient_t 10 - 11 - # UI 12 - const AtProtoMenu := preload("res://mods/Atproto/ui/menus/atproto_config.tscn") 13 - const AtProtoButton := preload("res://mods/Atproto/ui/buttons/atproto.tscn") 14 - 15 - var setuped = false 16 - 17 - func _enter_tree(): 18 - AtProtoClient = AtProtoClient_t.new() 19 - add_child(AtProtoClient) 20 - get_tree().connect("node_added", self, "_add_atproto_menu") 21 - 22 - 23 - func _ready() -> void: 24 - print("QUOTA:", Steam.getQuota()) 25 - TackleBox.connect("mod_config_updated", self, "_on_config_update") 26 - 27 - _init_config() 28 - 29 - func _init_config(): 30 - var saved_config = TackleBox.get_mod_config(name) 31 - for key in default_config.keys(): 32 - if not saved_config[key]: 33 - saved_config[key] = default_config[key] 34 - config = saved_config 35 - TackleBox.set_mod_config(name, config) 36 - if config.Autoconnect == true: 37 - AtProtoClient.login(config.Handle, config.Password) 38 - 39 - 40 - func _save_config(): 41 - TackleBox.set_mod_config(name, config) 42 - 43 - func _on_config_update(mod_id: String, new_config: Dictionary) -> void: 44 - if mod_id != name: 45 - return 46 - if config.hash() == new_config.hash(): 47 - return 48 - config = new_config 49 - if config.Handle != "" and config.Password != "": 50 - AtProtoClient.login(config.Handle, config.Password) 51 - 52 - func _add_atproto_menu(node: Node): 53 - if node.name == "main_menu": 54 - var atproto_menu: Node = AtProtoMenu.instance() 55 - atproto_menu.visible = false 56 - node.add_child(atproto_menu) 57 - 58 - var button = AtProtoButton.instance() 59 - var menu_list: Node = node.get_node("VBoxContainer") 60 - var settings_button: Node = menu_list.get_node("settings") 61 - menu_list.add_child(button) 62 - menu_list.move_child(button, settings_button.get_index() + 1) 63 - atproto_menu.connect("setup_done", self, "_after_setup") 64 - pass 65 - 66 - func _after_setup(): 67 - if setuped: 68 - return 69 - setuped = true 70 - 71 - if config.Save != "" and config.Autoload and AtProtoClient.connected(): 72 - AtProtoClient.load_save(config.Save)
-6
gdscript/mods/Atproto/ui/buttons/atproto.gd
··· 1 - extends GenericUIButton 2 - 3 - 4 - func _on_mods_pressed() -> void: 5 - var atproto_menu = $"../../atproto_config" 6 - atproto_menu.visible = true
-38
gdscript/mods/Atproto/ui/buttons/atproto.tscn
··· 1 - [gd_scene load_steps=8 format=2] 2 - 3 - [ext_resource path="res://Scenes/Singletons/Tooltips/tooltip_node.gd" type="Script" id=1] 4 - [ext_resource path="res://Assets/Themes/accid___.ttf" type="DynamicFontData" id=2] 5 - [ext_resource path="res://Assets/Themes/button_tan_hover.tres" type="StyleBox" id=3] 6 - [ext_resource path="res://Assets/Themes/button_tan_pressed.tres" type="StyleBox" id=4] 7 - [ext_resource path="res://Assets/Themes/button_tan_normal.tres" type="StyleBox" id=5] 8 - [ext_resource path="res://mods/Atproto/ui/buttons/atproto.gd" type="Script" id=6] 9 - 10 - [sub_resource type="DynamicFont" id=1] 11 - size = 34 12 - font_data = ExtResource( 2 ) 13 - 14 - [node name="atproto" type="Button" groups=["menu_button"]] 15 - margin_right = 12.0 16 - margin_bottom = 20.0 17 - size_flags_vertical = 3 18 - custom_colors/font_color_disabled = Color( 1, 0.929412, 0.839216, 1 ) 19 - custom_colors/font_color_focus = Color( 0.419608, 0.270588, 0.129412, 1 ) 20 - custom_colors/font_color = Color( 0.419608, 0.270588, 0.129412, 1 ) 21 - custom_colors/font_color_hover = Color( 1, 0.929412, 0.839216, 1 ) 22 - custom_colors/font_color_pressed = Color( 1, 0.929412, 0.839216, 1 ) 23 - custom_fonts/font = SubResource( 1 ) 24 - custom_styles/hover = ExtResource( 3 ) 25 - custom_styles/pressed = ExtResource( 4 ) 26 - custom_styles/disabled = ExtResource( 4 ) 27 - custom_styles/normal = ExtResource( 5 ) 28 - text = "Atproto Config" 29 - script = ExtResource( 6 ) 30 - 31 - [node name="TooltipNode" type="Control" parent="."] 32 - anchor_right = 1.0 33 - anchor_bottom = 1.0 34 - script = ExtResource( 1 ) 35 - header = "[color=#6a4420]Mods" 36 - body = "Manage your AtProto Data !" 37 - 38 - [connection signal="pressed" from="." to="." method="_on_mods_pressed"]
-253
gdscript/mods/Atproto/ui/menus/atproto_config.gd
··· 1 - extends Node 2 - 3 - onready var Atproto := $"/root/Atproto" 4 - const AtProtoNewSaveMenu := preload("res://mods/Atproto/ui/menus/new_save.tscn") 5 - 6 - signal setup_done() 7 - 8 - var SaveMenu: Node 9 - var Settings: VBoxContainer 10 - var Credentials: VBoxContainer 11 - var Saves : VBoxContainer 12 - 13 - func _ready(): 14 - Settings = $"%atproto_settings" 15 - Credentials = Settings.get_node("credentials") 16 - Saves = Settings.get_node("saves") 17 - init_save_menu() 18 - init_credentials() 19 - 20 - if Atproto.AtProtoClient.connected() : 21 - after_login() 22 - else: 23 - init_saves() 24 - 25 - func init_credentials() -> void: 26 - 27 - Credentials.get_node("handle/LineEdit").text = Atproto.config.Handle 28 - Credentials.get_node("password/LineEdit").text = Atproto.config.Password 29 - 30 - var autoconnect: OptionButton = Credentials.get_node("autoconnect").get_node("OptionButton") 31 - autoconnect.add_item("No", 0) 32 - autoconnect.set_item_metadata(0, false) 33 - autoconnect.add_item("Yes", 1) 34 - autoconnect.set_item_metadata(1, true) 35 - 36 - if Atproto.config.Autoconnect: 37 - autoconnect.select(1) 38 - 39 - func init_saves(saves = []) -> void: 40 - var new_save_button: Button = Saves.get_node("buttons").get_node("new_save") 41 - var load_save_button: Button = Saves.get_node("buttons").get_node("load_save") 42 - 43 - var autoload: OptionButton = Saves.get_node("autoload").get_node("OptionButton") 44 - autoload.clear() 45 - autoload.add_item("No", 0) 46 - autoload.set_item_metadata(0, false) 47 - autoload.add_item("Yes", 1) 48 - autoload.set_item_metadata(1, true) 49 - if Atproto.config.Autoload: 50 - autoload.select(1) 51 - 52 - var save_option: OptionButton = Saves.get_node("save").get_node("OptionButton") 53 - save_option.clear() 54 - if Atproto.AtProtoClient.connected(): 55 - var i = 0 56 - for save_record in saves: 57 - var save = save_record.value 58 - save_option.add_item(save.name) 59 - save_option.set_item_metadata(save_option.get_item_count()-1, save.uri) 60 - if Atproto.config.Save == save.uri: 61 - save_option.select(i) 62 - i += 1 63 - save_option.disabled = save_option.get_item_count() == 0 64 - load_save_button.disabled = save_option.get_item_count() == 0 65 - new_save_button.disabled = false 66 - else: 67 - save_option.disabled = true 68 - save_option.add_item("No saves") 69 - 70 - load_save_button.disabled = true 71 - new_save_button.disabled = true 72 - 73 - emit_signal("setup_done") 74 - 75 - func _on_apply_pressed() -> void: 76 - var save : OptionButton = Saves.get_node("save/OptionButton") 77 - Atproto.config.Autoload = Saves.get_node("autoload/OptionButton").get_selected_id() == 1 78 - if (Atproto.config.Save != save.get_selected_metadata() or Atproto.save_loaded != save.get_selected_metadata()) and Atproto.config.Autoload: 79 - Atproto.AtProtoClient.load_save(save.get_selected_metadata()) 80 - 81 - 82 - var autoconnect: OptionButton = Credentials.get_node("autoconnect").get_node("OptionButton") 83 - 84 - Atproto.config.Autoconnect = autoconnect.get_selected_id() == 1 85 - 86 - 87 - Atproto.config.Handle = Credentials.get_node("handle/LineEdit").text 88 - Atproto.config.Password = Credentials.get_node("password/LineEdit").text 89 - 90 - Atproto._save_config() 91 - 92 - set("visible", false) 93 - 94 - func _on_close_pressed() -> void: 95 - set("visible", false) 96 - 97 - 98 - func start_loading(): 99 - var panel = get_node("Panel") 100 - panel.get_node("Loader").set("visible", true) 101 - panel.get_node("close").set("disabled", true) 102 - panel.get_node("apply").set("disabled", true) 103 - 104 - func stop_loading(): 105 - var panel = get_node("Panel") 106 - panel.get_node("Loader").set("visible", false) 107 - panel.get_node("close").set("disabled", false) 108 - panel.get_node("apply").set("disabled", false) 109 - 110 - # CONNECTION 111 - 112 - func _on_connect_button_button_down(): 113 - var handle_field : LineEdit = Credentials.get_node("handle/LineEdit") 114 - var password_field : LineEdit = Credentials.get_node("password/LineEdit") 115 - Atproto.AtProtoClient.connect("connection", self, "_after_connect") 116 - start_loading() 117 - Atproto.AtProtoClient.login(handle_field.text, password_field.text) 118 - 119 - func _after_connect(success): 120 - if !success: 121 - PopupMessage._show_popup("An error has occured !") 122 - else: 123 - PopupMessage._show_popup("Connection successful !") 124 - after_login() 125 - stop_loading() 126 - 127 - func after_login(_a = null): 128 - Atproto.AtProtoClient.get_saves(funcref(self, "init_saves")) 129 - 130 - 131 - # SAVES 132 - 133 - func _on_load_save_button_down(): 134 - var save: OptionButton = Saves.get_node("save").get_node("OptionButton") 135 - Atproto.AtProtoClient.load_save(save.get_selected_metadata()) 136 - pass 137 - 138 - 139 - func _on_new_save_button_down(): 140 - SaveMenu.visible = true 141 - pass # Replace with function body. 142 - 143 - # Create Save Menu 144 - func init_save_menu(): 145 - SaveMenu = AtProtoNewSaveMenu.instance() 146 - add_child(SaveMenu) 147 - SaveMenu.visible = false 148 - var x : Button 149 - SaveMenu.get_node("save_menu/close").connect("button_down", self, "close_save_menu") 150 - SaveMenu.get_node("save_menu/duplicate").connect("button_down", self, "create_save", [true]) 151 - SaveMenu.get_node("save_menu/new").connect("button_down", self, "create_save", [false]) 152 - 153 - func create_save(duplicate = false): 154 - var backup = backup_save() 155 - if !duplicate: 156 - PlayerData._reset_save() 157 - Atproto.AtProtoClient.save_file(funcref(self, "create_save_file")) 158 - close_save_menu() 159 - restore_save(backup) 160 - pass 161 - 162 - func create_save_file(save_record): 163 - var file_name = SaveMenu.get_node("save_menu/Panel/save_name/LineEdit").text 164 - var uri = save_record.uri 165 - Atproto.AtProtoClient.create_save_file(uri, file_name, funcref(self, "after_login")) 166 - pass 167 - 168 - func backup_save(): 169 - return { 170 - "inventory": PlayerData.inventory, 171 - "hotbar": PlayerData.hotbar, 172 - "cosmetics_unlocked": PlayerData.cosmetics_unlocked, 173 - "cosmetics_equipped": PlayerData.cosmetics_equipped, 174 - "new_cosmetics": PlayerData.new_cosmetics, 175 - "version": Globals.GAME_VERSION, 176 - "muted_players": PlayerData.players_muted, 177 - "hidden_players": PlayerData.players_hidden, 178 - "recorded_time": PlayerData.last_recorded_time, 179 - "money": PlayerData.money, 180 - "bait_inv": PlayerData.bait_inv, 181 - "bait_selected": PlayerData.bait_selected, 182 - "bait_unlocked": PlayerData.bait_unlocked, 183 - "shop": PlayerData.current_shop, 184 - "journal": PlayerData.journal_logs, 185 - "quests": PlayerData.current_quests, 186 - "completed_quests": PlayerData.completed_quests, 187 - "level": PlayerData.badge_level, 188 - "xp": PlayerData.badge_xp, 189 - "max_bait": PlayerData.max_bait, 190 - "lure_unlocked": PlayerData.lure_unlocked, 191 - "lure_selected": PlayerData.lure_selected, 192 - "saved_aqua_fish": PlayerData.saved_aqua_fish, 193 - "inbound_mail": PlayerData.inbound_mail, 194 - "rod_power": PlayerData.rod_power_level, 195 - "rod_speed": PlayerData.rod_speed_level, 196 - "rod_chance": PlayerData.rod_chance_level, 197 - "rod_luck": PlayerData.rod_luck_level, 198 - "saved_tags": PlayerData.saved_tags, 199 - "loan_level": PlayerData.loan_level, 200 - "loan_left": PlayerData.loan_left, 201 - "buddy_level": PlayerData.buddy_level, 202 - "buddy_speed": PlayerData.buddy_speed, 203 - "guitar_shapes": PlayerData.guitar_shapes, 204 - "fish_caught": PlayerData.fish_caught, 205 - "cash_total": PlayerData.cash_total, 206 - "voice_pitch": PlayerData.voice_pitch, 207 - "voice_speed": PlayerData.voice_speed, 208 - "locked_refs": PlayerData.locked_refs, 209 - }.duplicate(true) 210 - 211 - func restore_save(data): 212 - PlayerData.inventory = data.inventory 213 - PlayerData.hotbar = data.hotbar 214 - PlayerData.cosmetics_unlocked = data.cosmetics_unlocked 215 - PlayerData.cosmetics_equipped = data.cosmetics_equipped 216 - PlayerData.new_cosmetics = data.new_cosmetics 217 - PlayerData.players_muted = data.muted_players 218 - PlayerData.players_hidden = data.hidden_players 219 - PlayerData.last_recorded_time = data.recorded_time 220 - PlayerData.money = data.money 221 - PlayerData.bait_inv = data.bait_inv 222 - PlayerData.bait_selected = data.bait_selected 223 - PlayerData.bait_unlocked = data.bait_unlocked 224 - PlayerData.current_shop = data.shop 225 - PlayerData.journal_logs = data.journal 226 - PlayerData.current_quests = data.quests 227 - PlayerData.completed_quests = data.completed_quests 228 - PlayerData.badge_level = data.level 229 - PlayerData.badge_xp = data.xp 230 - PlayerData.max_bait = data.max_bait 231 - PlayerData.lure_unlocked = data.lure_unlocked 232 - PlayerData.lure_selected = data.lure_selected 233 - PlayerData.saved_aqua_fish = data.saved_aqua_fish 234 - PlayerData.inbound_mail = data.inbound_mail 235 - PlayerData.rod_power_level = data.rod_power 236 - PlayerData.rod_speed_level = data.rod_speed 237 - PlayerData.rod_chance_level = data.rod_chance 238 - PlayerData.rod_luck_level = data.rod_luck 239 - PlayerData.saved_tags = data.saved_tags 240 - PlayerData.loan_level = data.loan_level 241 - PlayerData.loan_left = data.loan_left 242 - PlayerData.buddy_level = data.buddy_level 243 - PlayerData.buddy_speed = data.buddy_speed 244 - PlayerData.guitar_shapes = data.guitar_shapes 245 - PlayerData.fish_caught = data.fish_caught 246 - PlayerData.cash_total = data.cash_total 247 - PlayerData.voice_pitch = data.voice_pitch 248 - PlayerData.voice_speed = data.voice_speed 249 - PlayerData.locked_refs = data.locked_refs 250 - 251 - 252 - func close_save_menu(): 253 - SaveMenu.visible = false
-295
gdscript/mods/Atproto/ui/menus/atproto_config.tscn
··· 1 - [gd_scene load_steps=8 format=2] 2 - 3 - [ext_resource path="res://Scenes/Menus/Main Menu/ui_generic_button.gd" type="Script" id=1] 4 - [ext_resource path="res://Assets/Themes/accid___.ttf" type="DynamicFontData" id=3] 5 - [ext_resource path="res://mods/Atproto/ui/menus/atproto_config.gd" type="Script" id=4] 6 - [ext_resource path="res://mods/TackleBox/assets/mod_menu.tres" type="Theme" id=5] 7 - [ext_resource path="res://Assets/Textures/UI/knot_sep2.png" type="Texture" id=6] 8 - 9 - [sub_resource type="DynamicFont" id=2] 10 - size = 48 11 - font_data = ExtResource( 3 ) 12 - 13 - [sub_resource type="StyleBoxFlat" id=1] 14 - content_margin_left = 16.0 15 - content_margin_right = 16.0 16 - content_margin_top = 16.0 17 - content_margin_bottom = 16.0 18 - bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 19 - corner_radius_top_left = 16 20 - corner_radius_top_right = 16 21 - corner_radius_bottom_right = 16 22 - corner_radius_bottom_left = 16 23 - 24 - [node name="atproto_config" type="Control"] 25 - anchor_right = 1.0 26 - anchor_bottom = 1.0 27 - rect_pivot_offset = Vector2( -335, -90 ) 28 - theme = ExtResource( 5 ) 29 - script = ExtResource( 4 ) 30 - 31 - [node name="background" type="ColorRect" parent="."] 32 - anchor_right = 1.0 33 - anchor_bottom = 1.0 34 - size_flags_horizontal = 3 35 - size_flags_vertical = 3 36 - color = Color( 0.0627451, 0.109804, 0.192157, 0.431373 ) 37 - 38 - [node name="Panel" type="Panel" parent="."] 39 - anchor_left = 0.3 40 - anchor_top = 0.2 41 - anchor_right = 0.7 42 - anchor_bottom = 0.8 43 - 44 - [node name="Title" type="Label" parent="Panel"] 45 - unique_name_in_owner = true 46 - margin_left = 16.0 47 - margin_top = 16.0 48 - margin_right = 752.0 49 - margin_bottom = 58.0 50 - theme = ExtResource( 5 ) 51 - custom_fonts/font = SubResource( 2 ) 52 - text = "CONFIGURING ATPROTO" 53 - align = 1 54 - 55 - [node name="sep" type="TextureRect" parent="Panel"] 56 - anchor_left = 0.5 57 - anchor_right = 0.5 58 - margin_left = -384.0 59 - margin_top = 80.0 60 - margin_right = 384.0 61 - margin_bottom = 112.0 62 - rect_min_size = Vector2( 0, 32 ) 63 - size_flags_horizontal = 3 64 - texture = ExtResource( 6 ) 65 - expand = true 66 - stretch_mode = 4 67 - 68 - [node name="Panel" type="Panel" parent="Panel"] 69 - anchor_right = 1.0 70 - anchor_bottom = 1.0 71 - margin_left = 16.0 72 - margin_top = 131.0 73 - margin_right = -16.0 74 - margin_bottom = -16.0 75 - custom_styles/panel = SubResource( 1 ) 76 - 77 - [node name="ScrollContainer" type="ScrollContainer" parent="Panel/Panel"] 78 - anchor_right = 1.0 79 - anchor_bottom = 1.0 80 - margin_left = 16.0 81 - margin_top = 8.0 82 - margin_right = -16.0 83 - margin_bottom = -51.0 84 - __meta__ = { 85 - "_editor_description_": " " 86 - } 87 - 88 - [node name="atproto_settings" type="VBoxContainer" parent="Panel/Panel/ScrollContainer"] 89 - unique_name_in_owner = true 90 - margin_right = 704.0 91 - margin_bottom = 356.0 92 - size_flags_horizontal = 3 93 - custom_constants/separation = 40 94 - 95 - [node name="credentials" type="VBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings"] 96 - margin_right = 704.0 97 - margin_bottom = 176.0 98 - size_flags_horizontal = 3 99 - size_flags_vertical = 3 100 - custom_constants/separation = 4 101 - 102 - [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 103 - margin_right = 704.0 104 - margin_bottom = 32.0 105 - text = "Credentials" 106 - align = 1 107 - 108 - [node name="handle" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 109 - margin_top = 36.0 110 - margin_right = 704.0 111 - margin_bottom = 68.0 112 - 113 - [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/handle"] 114 - margin_right = 350.0 115 - margin_bottom = 32.0 116 - size_flags_horizontal = 3 117 - text = "Handle:" 118 - 119 - [node name="LineEdit" type="LineEdit" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/handle"] 120 - margin_left = 354.0 121 - margin_right = 704.0 122 - margin_bottom = 32.0 123 - size_flags_horizontal = 3 124 - placeholder_text = "alice.bsky.social" 125 - caret_blink = true 126 - __meta__ = { 127 - "_editor_description_": "" 128 - } 129 - 130 - [node name="password" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 131 - margin_top = 72.0 132 - margin_right = 704.0 133 - margin_bottom = 104.0 134 - 135 - [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/password"] 136 - margin_right = 350.0 137 - margin_bottom = 32.0 138 - size_flags_horizontal = 3 139 - text = "App Password:" 140 - 141 - [node name="LineEdit" type="LineEdit" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/password"] 142 - margin_left = 354.0 143 - margin_right = 704.0 144 - margin_bottom = 32.0 145 - size_flags_horizontal = 3 146 - secret = true 147 - placeholder_text = "mysecretpassword" 148 - caret_blink = true 149 - __meta__ = { 150 - "_editor_description_": "" 151 - } 152 - 153 - [node name="autoconnect" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 154 - margin_top = 108.0 155 - margin_right = 704.0 156 - margin_bottom = 140.0 157 - 158 - [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/autoconnect"] 159 - margin_right = 350.0 160 - margin_bottom = 32.0 161 - size_flags_horizontal = 3 162 - text = "Auto-connect:" 163 - 164 - [node name="OptionButton" type="OptionButton" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/autoconnect"] 165 - margin_left = 354.0 166 - margin_right = 704.0 167 - margin_bottom = 32.0 168 - size_flags_horizontal = 3 169 - 170 - [node name="connect_button" type="Button" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 171 - margin_top = 144.0 172 - margin_right = 704.0 173 - margin_bottom = 176.0 174 - size_flags_horizontal = 5 175 - text = "Connect" 176 - 177 - [node name="saves" type="VBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings"] 178 - margin_top = 216.0 179 - margin_right = 704.0 180 - margin_bottom = 356.0 181 - 182 - [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 183 - margin_right = 704.0 184 - margin_bottom = 32.0 185 - text = "Saves" 186 - align = 1 187 - 188 - [node name="autoload" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 189 - margin_top = 36.0 190 - margin_right = 704.0 191 - margin_bottom = 68.0 192 - 193 - [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/autoload"] 194 - margin_right = 350.0 195 - margin_bottom = 32.0 196 - size_flags_horizontal = 3 197 - text = "Autoload :" 198 - 199 - [node name="OptionButton" type="OptionButton" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/autoload"] 200 - margin_left = 354.0 201 - margin_right = 704.0 202 - margin_bottom = 32.0 203 - size_flags_horizontal = 3 204 - 205 - [node name="save" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 206 - margin_top = 72.0 207 - margin_right = 704.0 208 - margin_bottom = 104.0 209 - 210 - [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/save"] 211 - margin_right = 350.0 212 - margin_bottom = 32.0 213 - size_flags_horizontal = 3 214 - text = "Save :" 215 - 216 - [node name="OptionButton" type="OptionButton" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/save"] 217 - margin_left = 354.0 218 - margin_right = 704.0 219 - margin_bottom = 32.0 220 - size_flags_horizontal = 3 221 - 222 - [node name="buttons" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 223 - margin_top = 108.0 224 - margin_right = 704.0 225 - margin_bottom = 140.0 226 - 227 - [node name="new_save" type="Button" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons"] 228 - margin_right = 350.0 229 - margin_bottom = 32.0 230 - size_flags_horizontal = 3 231 - text = "New Save" 232 - 233 - [node name="load_save" type="Button" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons"] 234 - margin_left = 354.0 235 - margin_right = 704.0 236 - margin_bottom = 32.0 237 - size_flags_horizontal = 3 238 - text = "Load Save" 239 - 240 - [node name="Loader" type="Panel" parent="Panel"] 241 - visible = false 242 - modulate = Color( 1, 1, 1, 0.654902 ) 243 - anchor_right = 1.0 244 - anchor_bottom = 1.0 245 - margin_left = 16.0 246 - margin_top = 131.0 247 - margin_right = -16.0 248 - margin_bottom = -16.0 249 - custom_styles/panel = SubResource( 1 ) 250 - 251 - [node name="Container" type="CenterContainer" parent="Panel/Loader"] 252 - margin_left = -16.0 253 - margin_top = -127.0 254 - margin_right = 755.0 255 - margin_bottom = 523.0 256 - 257 - [node name="Title" type="Label" parent="Panel/Loader/Container"] 258 - margin_left = 314.0 259 - margin_top = 297.0 260 - margin_right = 457.0 261 - margin_bottom = 353.0 262 - size_flags_horizontal = 3 263 - size_flags_vertical = 3 264 - theme = ExtResource( 5 ) 265 - custom_colors/font_color = Color( 0, 0, 0, 1 ) 266 - custom_fonts/font = SubResource( 2 ) 267 - text = "Loading..." 268 - 269 - [node name="close" type="Button" parent="Panel"] 270 - anchor_left = 1.0 271 - anchor_right = 1.0 272 - margin_left = -24.0 273 - margin_top = -16.0 274 - margin_right = 16.0 275 - margin_bottom = 24.0 276 - text = "X" 277 - script = ExtResource( 1 ) 278 - 279 - [node name="apply" type="Button" parent="Panel"] 280 - anchor_left = 1.0 281 - anchor_top = 1.0 282 - anchor_right = 1.0 283 - anchor_bottom = 1.0 284 - margin_left = -188.0 285 - margin_top = -56.0 286 - margin_right = 24.0 287 - margin_bottom = 24.0 288 - text = "Save Changes" 289 - script = ExtResource( 1 ) 290 - 291 - [connection signal="button_down" from="Panel/Panel/ScrollContainer/atproto_settings/credentials/connect_button" to="." method="_on_connect_button_button_down"] 292 - [connection signal="button_down" from="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons/new_save" to="." method="_on_new_save_button_down"] 293 - [connection signal="button_down" from="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons/load_save" to="." method="_on_load_save_button_down"] 294 - [connection signal="pressed" from="Panel/close" to="." method="_on_close_pressed"] 295 - [connection signal="pressed" from="Panel/apply" to="." method="_on_apply_pressed"]
-167
gdscript/mods/Atproto/ui/menus/new_save.tscn
··· 1 - [gd_scene load_steps=8 format=2] 2 - 3 - [ext_resource path="res://Assets/Themes/main.tres" type="Theme" id=1] 4 - [ext_resource path="res://Scenes/Menus/Main Menu/ui_generic_button.gd" type="Script" id=2] 5 - [ext_resource path="res://Assets/Themes/accid___.ttf" type="DynamicFontData" id=3] 6 - [ext_resource path="res://mods/TackleBox/assets/mod_menu.tres" type="Theme" id=4] 7 - [ext_resource path="res://Assets/Textures/UI/knot_sep2.png" type="Texture" id=5] 8 - 9 - [sub_resource type="DynamicFont" id=1] 10 - size = 48 11 - font_data = ExtResource( 3 ) 12 - 13 - [sub_resource type="StyleBoxFlat" id=2] 14 - content_margin_left = 16.0 15 - content_margin_right = 16.0 16 - content_margin_top = 16.0 17 - content_margin_bottom = 16.0 18 - bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 19 - corner_radius_top_left = 16 20 - corner_radius_top_right = 16 21 - corner_radius_bottom_right = 16 22 - corner_radius_bottom_left = 16 23 - 24 - [node name="Node2D" type="Control"] 25 - margin_right = 1920.0 26 - margin_bottom = 1080.0 27 - theme = ExtResource( 1 ) 28 - 29 - [node name="background" type="ColorRect" parent="."] 30 - anchor_right = 1.0 31 - anchor_bottom = 1.0 32 - margin_left = -67.0 33 - margin_top = 17.0 34 - margin_right = 1853.0 35 - margin_bottom = 1097.0 36 - size_flags_horizontal = 3 37 - size_flags_vertical = 3 38 - color = Color( 0.0627451, 0.109804, 0.192157, 0.431373 ) 39 - 40 - [node name="save_menu" type="Panel" parent="."] 41 - unique_name_in_owner = true 42 - anchor_left = 0.3 43 - anchor_top = 0.374 44 - anchor_right = 0.712 45 - anchor_bottom = 0.675 46 - margin_top = 0.0799866 47 - margin_right = 0.959961 48 - 49 - [node name="Title" type="Label" parent="save_menu"] 50 - margin_left = 16.0 51 - margin_top = 16.0 52 - margin_right = 752.0 53 - margin_bottom = 58.0 54 - theme = ExtResource( 4 ) 55 - custom_fonts/font = SubResource( 1 ) 56 - text = "Create a new save" 57 - align = 1 58 - 59 - [node name="sep" type="TextureRect" parent="save_menu"] 60 - anchor_left = 0.5 61 - anchor_right = 0.5 62 - margin_left = -384.0 63 - margin_top = 80.0 64 - margin_right = 384.0 65 - margin_bottom = 112.0 66 - rect_min_size = Vector2( 0, 32 ) 67 - size_flags_horizontal = 3 68 - texture = ExtResource( 5 ) 69 - expand = true 70 - stretch_mode = 4 71 - 72 - [node name="Panel" type="Panel" parent="save_menu"] 73 - anchor_left = 0.119 74 - anchor_top = 0.403 75 - anchor_right = 0.893 76 - anchor_bottom = 0.745 77 - margin_left = -0.248001 78 - margin_top = 0.0249939 79 - margin_right = -0.256042 80 - margin_bottom = -0.125015 81 - custom_styles/panel = SubResource( 2 ) 82 - 83 - [node name="save_name" type="VBoxContainer" parent="save_menu/Panel"] 84 - anchor_right = 1.0 85 - anchor_bottom = 1.0 86 - margin_left = 40.0 87 - margin_top = 8.0 88 - margin_right = -52.0 89 - margin_bottom = -35.0 90 - size_flags_horizontal = 3 91 - 92 - [node name="Label" type="Label" parent="save_menu/Panel/save_name"] 93 - margin_right = 521.0 94 - margin_bottom = 32.0 95 - text = "Save Name" 96 - align = 1 97 - 98 - [node name="LineEdit" type="LineEdit" parent="save_menu/Panel/save_name"] 99 - margin_top = 36.0 100 - margin_right = 521.0 101 - margin_bottom = 68.0 102 - size_flags_horizontal = 3 103 - 104 - [node name="Loader" type="Panel" parent="save_menu"] 105 - visible = false 106 - modulate = Color( 1, 1, 1, 0.654902 ) 107 - anchor_right = 1.0 108 - anchor_bottom = 1.0 109 - margin_left = 16.0 110 - margin_top = 131.0 111 - margin_right = -16.0 112 - margin_bottom = -16.0 113 - custom_styles/panel = SubResource( 2 ) 114 - 115 - [node name="Container" type="CenterContainer" parent="save_menu/Loader"] 116 - margin_left = -16.0 117 - margin_top = -127.0 118 - margin_right = 755.0 119 - margin_bottom = 523.0 120 - 121 - [node name="Title" type="Label" parent="save_menu/Loader/Container"] 122 - margin_left = 314.0 123 - margin_top = 297.0 124 - margin_right = 457.0 125 - margin_bottom = 353.0 126 - size_flags_horizontal = 3 127 - size_flags_vertical = 3 128 - theme = ExtResource( 4 ) 129 - custom_colors/font_color = Color( 0, 0, 0, 1 ) 130 - custom_fonts/font = SubResource( 1 ) 131 - text = "Loading..." 132 - 133 - [node name="close" type="Button" parent="save_menu"] 134 - anchor_left = 1.0 135 - anchor_right = 1.0 136 - margin_left = -24.0 137 - margin_top = -16.0 138 - margin_right = 16.0 139 - margin_bottom = 24.0 140 - text = "X" 141 - script = ExtResource( 2 ) 142 - 143 - [node name="duplicate" type="Button" parent="save_menu"] 144 - anchor_left = 0.734 145 - anchor_top = 1.0 146 - anchor_right = 0.734 147 - anchor_bottom = 1.0 148 - margin_left = -211.712 149 - margin_top = -56.0 150 - margin_right = 0.287964 151 - margin_bottom = 24.0 152 - rect_pivot_offset = Vector2( 89, 24 ) 153 - text = "Duplicate Save" 154 - script = ExtResource( 2 ) 155 - 156 - [node name="new" type="Button" parent="save_menu"] 157 - anchor_left = 1.0 158 - anchor_top = 1.0 159 - anchor_right = 1.0 160 - anchor_bottom = 1.0 161 - margin_left = -188.0 162 - margin_top = -56.0 163 - margin_right = 24.0 164 - margin_bottom = 24.0 165 - rect_pivot_offset = Vector2( 89, 24 ) 166 - text = "Create Save" 167 - script = ExtResource( 2 )
-21
gdscript/project.godot
··· 1 - ; Engine configuration file. 2 - ; It's best edited using the editor UI and not directly, 3 - ; since the parameters that go here are not all obvious. 4 - ; 5 - ; Format: 6 - ; [section] ; section goes between [] 7 - ; param=value ; assign values to parameters 8 - 9 - config_version=4 10 - 11 - [application] 12 - 13 - config/name="AtProto Webfishing" 14 - 15 - [gui] 16 - 17 - common/drop_mouse_on_gui_input_disabled=true 18 - 19 - [physics] 20 - 21 - common/enable_pause_aware_picking=true
icon.png

This is a binary file and will not be displayed.

+20
manifestation.toml
··· 1 + id = "Atproto" 2 + name = "Webfishing_Atproto" 3 + description = "A mod that sends data to your AtProto PDS." 4 + version = "1.0.4" 5 + homepage = "https://tangled.org/@regnault.dev/webfishing-atproto" 6 + author = "Estym" 7 + 8 + icon = "icon.png" 9 + readme = "README.md" 10 + 11 + [project] 12 + csharp = "./Atproto/Atproto.csproj" 13 + godot = "./project/project.godot" 14 + 15 + [[dependencies]] 16 + thunderstore_version = "NotNet-GDWeave-2.0.12" 17 + 18 + [[dependencies]] 19 + id = "TackleBox" 20 + thunderstore_version = "PuppyGirl-TackleBox-0.5.2"
+2
project/.gitignore
··· 1 + .import 2 + export_presets.cfg
+264
project/mods/Atproto/assets/at_proto.tres
··· 1 + [gd_resource type="Theme" load_steps=28 format=2] 2 + 3 + [ext_resource path="res://Assets/Textures/UI/scrollbar.png" type="Texture" id=1] 4 + [ext_resource path="res://Assets/Themes/main_font.tres" type="DynamicFont" id=2] 5 + 6 + [sub_resource type="StyleBoxFlat" id=1] 7 + content_margin_left = 12.0 8 + content_margin_right = 12.0 9 + bg_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 10 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 11 + corner_radius_top_left = 12 12 + corner_radius_top_right = 12 13 + corner_radius_bottom_right = 12 14 + corner_radius_bottom_left = 12 15 + corner_detail = 5 16 + 17 + [sub_resource type="StyleBoxEmpty" id=34] 18 + 19 + [sub_resource type="StyleBoxFlat" id=30] 20 + content_margin_left = 12.0 21 + content_margin_right = 12.0 22 + bg_color = Color( 0.611765, 0.568627, 0.290196, 1 ) 23 + border_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 24 + corner_radius_top_left = 12 25 + corner_radius_top_right = 12 26 + corner_radius_bottom_right = 12 27 + corner_radius_bottom_left = 12 28 + corner_detail = 5 29 + expand_margin_left = 1.0 30 + expand_margin_right = 1.0 31 + expand_margin_top = 1.0 32 + expand_margin_bottom = 1.0 33 + 34 + [sub_resource type="StyleBoxFlat" id=31] 35 + content_margin_left = 12.0 36 + content_margin_right = 12.0 37 + bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 38 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 39 + corner_radius_top_left = 12 40 + corner_radius_top_right = 12 41 + corner_radius_bottom_right = 12 42 + corner_radius_bottom_left = 12 43 + 44 + [sub_resource type="StyleBoxFlat" id=32] 45 + content_margin_left = 12.0 46 + content_margin_right = 12.0 47 + bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 48 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 49 + corner_radius_top_left = 12 50 + corner_radius_top_right = 12 51 + corner_radius_bottom_right = 12 52 + corner_radius_bottom_left = 12 53 + corner_detail = 5 54 + 55 + [sub_resource type="StyleBoxFlat" id=18] 56 + bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 57 + border_width_left = 6 58 + border_color = Color( 1, 1, 1, 0 ) 59 + corner_radius_top_left = 4 60 + corner_radius_top_right = 4 61 + corner_radius_bottom_right = 4 62 + corner_radius_bottom_left = 4 63 + 64 + [sub_resource type="StyleBoxFlat" id=15] 65 + bg_color = Color( 0.611765, 0.568627, 0.290196, 1 ) 66 + border_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 67 + corner_radius_top_left = 12 68 + corner_radius_top_right = 12 69 + corner_radius_bottom_right = 12 70 + corner_radius_bottom_left = 12 71 + corner_detail = 5 72 + 73 + [sub_resource type="StyleBoxFlat" id=21] 74 + bg_color = Color( 0.0627451, 0.109804, 0.192157, 1 ) 75 + draw_center = false 76 + border_width_left = 16 77 + border_color = Color( 1, 1, 1, 0 ) 78 + corner_radius_top_left = 4 79 + corner_radius_top_right = 4 80 + corner_radius_bottom_right = 4 81 + corner_radius_bottom_left = 4 82 + 83 + [sub_resource type="StyleBoxEmpty" id=20] 84 + 85 + [sub_resource type="StyleBoxFlat" id=35] 86 + 87 + [sub_resource type="StyleBoxFlat" id=36] 88 + 89 + [sub_resource type="StyleBoxFlat" id=37] 90 + bg_color = Color( 0.0627451, 0.109804, 0.192157, 1 ) 91 + corner_radius_top_left = 8 92 + corner_radius_top_right = 8 93 + corner_radius_bottom_right = 8 94 + corner_radius_bottom_left = 8 95 + expand_margin_top = 3.0 96 + expand_margin_bottom = 3.0 97 + 98 + [sub_resource type="StyleBoxFlat" id=33] 99 + content_margin_left = 12.0 100 + content_margin_right = 12.0 101 + bg_color = Color( 0.572549, 0.45098, 0.290196, 1 ) 102 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 103 + corner_radius_top_left = 12 104 + corner_radius_top_right = 12 105 + corner_radius_bottom_right = 12 106 + corner_radius_bottom_left = 12 107 + 108 + [sub_resource type="StyleBoxFlat" id=9] 109 + bg_color = Color( 1, 0.933333, 0.835294, 1 ) 110 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 111 + corner_radius_top_left = 32 112 + corner_radius_top_right = 32 113 + corner_radius_bottom_right = 32 114 + corner_radius_bottom_left = 32 115 + 116 + [sub_resource type="ImageTexture" id=24] 117 + 118 + [sub_resource type="StyleBoxFlat" id=25] 119 + content_margin_left = 4.0 120 + content_margin_right = 4.0 121 + bg_color = Color( 0.611765, 0.568627, 0.290196, 1 ) 122 + corner_radius_top_left = 8 123 + corner_radius_top_right = 8 124 + corner_radius_bottom_right = 8 125 + corner_radius_bottom_left = 8 126 + expand_margin_left = 2.0 127 + expand_margin_right = 2.0 128 + expand_margin_top = 2.0 129 + 130 + [sub_resource type="StyleBoxEmpty" id=26] 131 + 132 + [sub_resource type="StyleBoxEmpty" id=27] 133 + 134 + [sub_resource type="StyleBoxFlat" id=28] 135 + content_margin_left = 8.0 136 + content_margin_right = 8.0 137 + bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 138 + corner_radius_bottom_right = 12 139 + corner_radius_bottom_left = 12 140 + expand_margin_top = 10.0 141 + expand_margin_bottom = 8.0 142 + 143 + [sub_resource type="StyleBoxEmpty" id=29] 144 + 145 + [sub_resource type="StyleBoxFlat" id=4] 146 + bg_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 147 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 148 + corner_radius_top_left = 12 149 + corner_radius_top_right = 12 150 + corner_radius_bottom_right = 12 151 + corner_radius_bottom_left = 12 152 + expand_margin_left = 2.0 153 + expand_margin_right = 2.0 154 + 155 + [sub_resource type="StyleBoxFlat" id=8] 156 + bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 157 + border_width_left = 2 158 + border_width_top = 2 159 + border_width_right = 2 160 + border_width_bottom = 2 161 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 162 + corner_radius_top_left = 6 163 + corner_radius_top_right = 6 164 + corner_radius_bottom_right = 6 165 + corner_radius_bottom_left = 6 166 + corner_detail = 5 167 + anti_aliasing = false 168 + 169 + [sub_resource type="StyleBoxFlat" id=6] 170 + bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 171 + border_width_left = 2 172 + border_width_top = 2 173 + border_width_right = 2 174 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 175 + corner_radius_top_left = 6 176 + corner_radius_top_right = 6 177 + corner_detail = 5 178 + anti_aliasing = false 179 + 180 + [sub_resource type="StyleBoxFlat" id=7] 181 + bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 182 + border_width_left = 2 183 + border_width_top = 2 184 + border_width_right = 2 185 + border_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 186 + corner_radius_top_left = 6 187 + corner_radius_top_right = 6 188 + corner_detail = 5 189 + expand_margin_bottom = 2.0 190 + anti_aliasing = false 191 + 192 + [sub_resource type="StyleBoxEmpty" id=23] 193 + 194 + [resource] 195 + default_font = ExtResource( 2 ) 196 + Button/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 197 + Button/colors/font_color_disabled = Color( 0.835294, 0.666667, 0.45098, 1 ) 198 + Button/colors/font_color_focus = Color( 1, 0.933333, 0.835294, 1 ) 199 + Button/colors/font_color_hover = Color( 1, 0.933333, 0.835294, 1 ) 200 + Button/colors/font_color_pressed = Color( 0.835294, 0.666667, 0.45098, 1 ) 201 + Button/styles/disabled = SubResource( 1 ) 202 + Button/styles/focus = SubResource( 34 ) 203 + Button/styles/hover = SubResource( 30 ) 204 + Button/styles/normal = SubResource( 31 ) 205 + Button/styles/pressed = SubResource( 32 ) 206 + HScrollBar/styles/grabber = SubResource( 18 ) 207 + HScrollBar/styles/grabber_highlight = SubResource( 15 ) 208 + HScrollBar/styles/grabber_pressed = SubResource( 15 ) 209 + HScrollBar/styles/scroll = SubResource( 21 ) 210 + HScrollBar/styles/scroll_focus = SubResource( 20 ) 211 + HSlider/icons/grabber = ExtResource( 1 ) 212 + HSlider/icons/grabber_disabled = ExtResource( 1 ) 213 + HSlider/icons/grabber_highlight = ExtResource( 1 ) 214 + HSlider/styles/grabber_area = SubResource( 35 ) 215 + HSlider/styles/grabber_area_highlight = SubResource( 36 ) 216 + HSlider/styles/slider = SubResource( 37 ) 217 + Label/colors/font_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 218 + LineEdit/colors/cursor_color = Color( 1, 0.933333, 0.835294, 1 ) 219 + LineEdit/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 220 + LineEdit/colors/font_color_selected = Color( 1, 0.933333, 0.835294, 1 ) 221 + LineEdit/colors/font_color_uneditable = Color( 0.835294, 0.666667, 0.45098, 1 ) 222 + LineEdit/styles/focus = SubResource( 33 ) 223 + LineEdit/styles/normal = SubResource( 33 ) 224 + LineEdit/styles/read_only = SubResource( 33 ) 225 + Panel/styles/panel = SubResource( 9 ) 226 + PopupMenu/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 227 + PopupMenu/colors/font_color_hover = Color( 1, 0.933333, 0.835294, 1 ) 228 + PopupMenu/icons/checked = SubResource( 24 ) 229 + PopupMenu/icons/radio_checked = SubResource( 24 ) 230 + PopupMenu/icons/radio_unchecked = SubResource( 24 ) 231 + PopupMenu/icons/submenu = SubResource( 24 ) 232 + PopupMenu/icons/unchecked = SubResource( 24 ) 233 + PopupMenu/styles/hover = SubResource( 25 ) 234 + PopupMenu/styles/labeled_separator_left = SubResource( 26 ) 235 + PopupMenu/styles/labeled_separator_right = SubResource( 27 ) 236 + PopupMenu/styles/panel = SubResource( 28 ) 237 + PopupMenu/styles/panel_disabled = SubResource( 28 ) 238 + PopupMenu/styles/separator = SubResource( 29 ) 239 + ProgressBar/colors/font_color = Color( 1, 0.933333, 0.835294, 1 ) 240 + ProgressBar/styles/bg = SubResource( 1 ) 241 + ProgressBar/styles/fg = SubResource( 4 ) 242 + RichTextLabel/colors/default_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 243 + TabContainer/colors/font_color_bg = Color( 0.415686, 0.266667, 0.12549, 1 ) 244 + TabContainer/colors/font_color_disabled = Color( 0.611765, 0.0784314, 0.0784314, 1 ) 245 + TabContainer/colors/font_color_fg = Color( 1, 0.933333, 0.835294, 1 ) 246 + TabContainer/styles/panel = SubResource( 8 ) 247 + TabContainer/styles/tab_bg = SubResource( 6 ) 248 + TabContainer/styles/tab_disabled = SubResource( 1 ) 249 + TabContainer/styles/tab_fg = SubResource( 7 ) 250 + Tabs/colors/font_color_bg = Color( 0.835294, 0.666667, 0.45098, 1 ) 251 + Tabs/colors/font_color_fg = Color( 0.835294, 0.666667, 0.45098, 1 ) 252 + TextEdit/colors/caret_color = Color( 1, 0.933333, 0.835294, 1 ) 253 + TextEdit/colors/font_color = Color( 0.415686, 0.266667, 0.12549, 1 ) 254 + TextEdit/colors/font_color_readonly = Color( 0.415686, 0.266667, 0.12549, 1 ) 255 + TextEdit/colors/selection_color = Color( 0.352941, 0.458824, 0.352941, 1 ) 256 + TextEdit/styles/completion = SubResource( 23 ) 257 + TextEdit/styles/focus = SubResource( 23 ) 258 + TextEdit/styles/normal = SubResource( 23 ) 259 + TextEdit/styles/read_only = SubResource( 23 ) 260 + VScrollBar/styles/grabber = SubResource( 18 ) 261 + VScrollBar/styles/grabber_highlight = SubResource( 15 ) 262 + VScrollBar/styles/grabber_pressed = SubResource( 15 ) 263 + VScrollBar/styles/scroll = SubResource( 21 ) 264 + VScrollBar/styles/scroll_focus = SubResource( 20 )
+465
project/mods/Atproto/atproto_client.gd
··· 1 + extends Node 2 + 3 + # Signals 4 + signal connection(suceeded) 5 + signal savefile_loaded(uri) 6 + 7 + # State 8 + var can_save = true 9 + 10 + # AtProto 11 + var did 12 + var pds 13 + var accessJwt 14 + var refreshJwt 15 + var Atproto 16 + 17 + func _enter_tree(): 18 + Atproto = self.get_parent() 19 + 20 + func connected() -> bool: 21 + return accessJwt != null 22 + 23 + func is_token_expired() -> bool: 24 + var token_data = self.accessJwt.split(".")[1] 25 + var data = null 26 + for x in ["", "=", "=="] : 27 + var json = Marshalls.base64_to_utf8(token_data + x) 28 + data = parse_json(json) 29 + if data != null: break 30 + var expires = data.exp 31 + var unix = floor(Time.get_unix_time_from_system()) 32 + return expires < unix 33 + 34 + func get_header(): 35 + return [ 36 + "Authorization: Bearer " + self.accessJwt, 37 + "Content-Type: application/json" 38 + ] 39 + 40 + func create_record(record, callback : FuncRef = null): 41 + 42 + if is_token_expired(): 43 + refresh_token("create_record", [record]) 44 + return 45 + 46 + var payload = { 47 + repo = did, 48 + collection = record.at_type, 49 + record = record 50 + } 51 + 52 + var json_payload = JSON.print(payload) 53 + json_payload = json_payload.replace("at_type", "$type") 54 + 55 + var req = HTTPRequest.new() 56 + self.add_child(req) 57 + req.connect("request_completed", self, "_create_record_handler", [req, callback]) 58 + req.request(pds + "/xrpc/com.atproto.repo.createRecord", get_header(), true, HTTPClient.METHOD_POST, json_payload) 59 + 60 + 61 + func _create_record_handler(_result, code, _headers, body: PoolByteArray, req: HTTPRequest, callback: FuncRef): 62 + req.queue_free() 63 + if callback == null: 64 + return 65 + 66 + var res = parse_json(body.get_string_from_utf8()) 67 + callback.call_func(res) 68 + 69 + ## LIST RECORDS 70 + 71 + func list_records(callback: FuncRef, collection: String, limit: int = 50, cursor = ""): 72 + var query_string = "repo=" + did 73 + query_string += "&collection=" + collection.http_escape() 74 + query_string += "&limit=" + str(limit).http_escape() 75 + query_string += "&cursor=" + str(limit).http_escape() 76 + var req_str = pds + "/xrpc/com.atproto.repo.listRecords?" + query_string 77 + 78 + var req = HTTPRequest.new() 79 + self.add_child(req) 80 + req.connect("request_completed", self, "_list_record_handler", [req, callback]) 81 + req.request(req_str, get_header(), true, HTTPClient.METHOD_GET) 82 + 83 + func _list_record_handler(_result, code, _headers, body: PoolByteArray, req: HTTPRequest, callback: FuncRef): 84 + req.queue_free() 85 + var b = body.get_string_from_utf8() 86 + var res = parse_json(b) 87 + callback.call_func(res.records) 88 + 89 + 90 + ## GET RECORD 91 + 92 + func get_record(callback: FuncRef, did: String, collection: String, rkey: String): 93 + var query_string = "repo=" + did.http_escape() 94 + query_string += "&collection=" + collection.http_escape() 95 + query_string += "&rkey=" + rkey.http_escape() 96 + 97 + var req = HTTPRequest.new() 98 + self.add_child(req) 99 + req.connect("request_completed", self, "_get_record_handler", [req, callback]) 100 + req.request(pds + "/xrpc/com.atproto.repo.getRecord?" + query_string, get_header(), true, HTTPClient.METHOD_GET) 101 + 102 + func _get_record_handler(_result, code, _headers, body: PoolByteArray, req: HTTPRequest, callback: FuncRef): 103 + req.queue_free() 104 + var res = parse_json(body.get_string_from_utf8()) 105 + callback.call_func(res) 106 + 107 + 108 + ## PUT RECORD 109 + 110 + func put_record(uri, record, callback: FuncRef = null): 111 + if is_token_expired(): 112 + refresh_token("put_record", [uri, record]) 113 + return 114 + 115 + var splitted_uri = uri.split("/") 116 + 117 + 118 + var payload = { 119 + repo = splitted_uri[2], 120 + collection = splitted_uri[3], 121 + rkey = splitted_uri[4], 122 + record = record 123 + } 124 + 125 + var json_payload = JSON.print(payload) 126 + json_payload = json_payload.replace("at_type", "$type") 127 + 128 + var req = HTTPRequest.new() 129 + self.add_child(req) 130 + req.connect("request_completed", self, "_put_record_handler", [req, callback]) 131 + req.request(pds + "/xrpc/com.atproto.repo.putRecord", get_header(), true, HTTPClient.METHOD_POST, json_payload) 132 + 133 + func _put_record_handler(_result, code, _headers, body: PoolByteArray, req: HTTPRequest, callback: FuncRef): 134 + req.queue_free() 135 + if callback == null: 136 + return 137 + var res = parse_json(body.get_string_from_utf8()) 138 + callback.call_func(res) 139 + 140 + ################ 141 + # LOGIN # 142 + ################ 143 + 144 + func login(handle, password): 145 + var req = HTTPRequest.new() 146 + self.add_child(req) 147 + 148 + req.connect("request_completed", self, "after_handle_resolver", [req, password]) 149 + req.request("https://bsky.social/xrpc/com.atproto.identity.resolveHandle?handle=" + handle) 150 + 151 + 152 + func after_handle_resolver(_result, code, _headers, body: PoolByteArray, req: HTTPRequest, password): 153 + req.disconnect("request_completed", self, "after_handle_resolver") 154 + 155 + if code != 200: 156 + emit_signal("connection", false) 157 + return 158 + 159 + var res = parse_json(body.get_string_from_utf8()) 160 + self.did = res.did 161 + 162 + req.connect("request_completed", self, "after_get_pds", [req, password]) 163 + req.request("https://plc.directory/" + self.did) 164 + 165 + 166 + func after_get_pds(_result, code, _headers, body: PoolByteArray,req: HTTPRequest, password): 167 + req.disconnect("request_completed", self, "after_get_pds") 168 + 169 + if code != 200: 170 + emit_signal("connection", false) 171 + return 172 + 173 + var res = parse_json(body.get_string_from_utf8()) 174 + for x in res.service: 175 + if x.id == "#atproto_pds": 176 + self.pds = x.serviceEndpoint 177 + 178 + var payload = { 179 + identifier = self.did, 180 + password = password 181 + } 182 + 183 + req.connect("request_completed", self, "after_create_session", [req]) 184 + req.request(pds + "/xrpc/com.atproto.server.createSession", ["Content-Type: application/json"], true, HTTPClient.METHOD_POST, JSON.print(payload)) 185 + 186 + 187 + func after_create_session(_result, code, _headers, body: PoolByteArray, req: HTTPRequest): 188 + req.queue_free() 189 + 190 + if code != 200: 191 + emit_signal("connection", false) 192 + return 193 + 194 + var res = parse_json(body.get_string_from_utf8()) 195 + self.accessJwt = res.accessJwt 196 + self.refreshJwt = res.refreshJwt 197 + emit_signal("connection", true) 198 + 199 + ####################### 200 + # REFRESH TOKEN # 201 + ####################### 202 + func refresh_token(method = "", payload = []): 203 + var req = self.requester 204 + 205 + var headers = [ 206 + "Authorization: Bearer " + self.refreshJwt, 207 + "Content-Type: application/json" 208 + ] 209 + req.connect("request_completed", self, "after_refresh_token", [method, payload]) 210 + req.request(pds + "/xrpc/com.atproto.server.refreshSession", headers, true, HTTPClient.METHOD_POST) 211 + 212 + func after_refresh_token(_result, _response_code, _headers, body: PoolByteArray, method, payload): 213 + var req = self.requester 214 + req.disconnect("request_completed", self, "after_refresh_token") 215 + 216 + var res = parse_json(body.get_string_from_utf8()) 217 + self.accessJwt = res.accessJwt 218 + self.refreshJwt = res.refreshJwt 219 + 220 + if method != "": 221 + self.callv(method, payload) 222 + 223 + 224 + ###################### 225 + # Method Calls # 226 + ###################### 227 + 228 + func catch_fish(fish, size, quality): 229 + var fish_data = Globals.item_data[fish]["file"] 230 + var record = { 231 + at_type = "dev.regnault.webfishing.fish", 232 + id = fish, 233 + name = fish_data.item_name, 234 + size = str(size), 235 + quality = quality 236 + } 237 + create_record(record) 238 + 239 + 240 + # SAVES 241 + 242 + func create_save_file(uri: String, filename: String, callback: FuncRef = null): 243 + var record = { 244 + at_type = "dev.regnault.webfishing.savefile", 245 + uri = uri, 246 + name = filename, 247 + } 248 + create_record(record, callback) 249 + pass 250 + 251 + func get_saves(callback: FuncRef): 252 + list_records(callback, "dev.regnault.webfishing.savefile") 253 + 254 + 255 + func get_save_data(): 256 + var save_data = { 257 + "inventory": PlayerData.inventory, 258 + "hotbar": PlayerData.hotbar, 259 + "cosmetics_unlocked": PlayerData.cosmetics_unlocked, 260 + "cosmetics_equipped": PlayerData.cosmetics_equipped, 261 + "new_cosmetics": [], 262 + "version": Globals.GAME_VERSION, 263 + "muted_players": PlayerData.players_muted, 264 + "hidden_players": PlayerData.players_hidden, 265 + "recorded_time": PlayerData.last_recorded_time, 266 + "money": PlayerData.money, 267 + "bait_inv": PlayerData.bait_inv, 268 + "bait_selected": PlayerData.bait_selected, 269 + "bait_unlocked": PlayerData.bait_unlocked, 270 + "shop": PlayerData.current_shop, 271 + "journal": PlayerData.journal_logs, 272 + "quests": PlayerData.current_quests, 273 + "completed_quests": PlayerData.completed_quests, 274 + "level": PlayerData.badge_level, 275 + "xp": PlayerData.badge_xp, 276 + "max_bait": PlayerData.max_bait, 277 + "lure_unlocked": PlayerData.lure_unlocked, 278 + "lure_selected": PlayerData.lure_selected, 279 + "saved_aqua_fish": PlayerData.saved_aqua_fish, 280 + "inbound_mail": PlayerData.inbound_mail, 281 + "rod_power": PlayerData.rod_power_level, 282 + "rod_speed": PlayerData.rod_speed_level, 283 + "rod_chance": PlayerData.rod_chance_level, 284 + "rod_luck": PlayerData.rod_luck_level, 285 + "saved_tags": PlayerData.saved_tags, 286 + "loan_level": PlayerData.loan_level, 287 + "loan_left": PlayerData.loan_left, 288 + "buddy_level": PlayerData.buddy_level, 289 + "buddy_speed": PlayerData.buddy_speed, 290 + "guitar_shapes": PlayerData.guitar_shapes, 291 + "fish_caught": PlayerData.fish_caught, 292 + "cash_total": PlayerData.cash_total, 293 + "voice_pitch": PlayerData.voice_pitch, 294 + "voice_speed": PlayerData.voice_speed, 295 + "locked_refs": PlayerData.locked_refs, 296 + } 297 + save_data = save_data.duplicate(true) 298 + 299 + # JOURNAL 300 + var modified_journal = [] 301 + for area in save_data.journal: 302 + var area_entry = { 303 + name = area, 304 + entries = [] 305 + } 306 + for entry_name in save_data.journal[area]: 307 + var entry = save_data.journal[area][entry_name] 308 + area_entry.entries.append({ 309 + name = entry_name, 310 + count = entry.count, 311 + record = str(entry.record), 312 + quality = entry.quality 313 + }) 314 + modified_journal.append(area_entry) 315 + save_data.journal = modified_journal 316 + 317 + # Quests 318 + var modified_quests = [] 319 + for quest_id in save_data.quests: 320 + var entry = save_data.quests[quest_id].duplicate(true) 321 + entry.id = quest_id 322 + modified_quests.append(entry) 323 + save_data.quests = modified_quests 324 + 325 + # Inventory 326 + for item in save_data.inventory: 327 + item.size = str(item.size) 328 + 329 + 330 + # Version 331 + save_data.version = str(save_data.version) 332 + 333 + # Voice Pitch 334 + save_data.voice_pitch = str(save_data.voice_pitch) 335 + 336 + # Aqua Fish 337 + save_data.saved_aqua_fish.size = str(save_data.saved_aqua_fish.size) 338 + 339 + # Letters 340 + for letter in save_data.inbound_mail: 341 + for item in letter.items: 342 + item.size = str(item.size) 343 + 344 + return save_data 345 + 346 + func save_file(callback: FuncRef = null, creation = false): 347 + if UserSave.current_loaded_slot != Atproto.ATPROTO_SLOT: 348 + return 349 + if !connected(): return 350 + 351 + var save_data = get_save_data() 352 + save_data.at_type = "dev.regnault.webfishing.save" 353 + 354 + if Atproto.save_loaded != "": 355 + put_record(Atproto.save_loaded, save_data) 356 + 357 + func create_save(callback: FuncRef = null): 358 + if !connected(): return 359 + var save_data = get_save_data() 360 + save_data.at_type = "dev.regnault.webfishing.save" 361 + create_record(save_data, callback) 362 + 363 + func load_save(uri: String): 364 + var splitted_uri = uri.split("/") 365 + var did = splitted_uri[2] 366 + var collection = splitted_uri[3] 367 + var rkey = splitted_uri[4] 368 + get_record(funcref(self, "_after_get_save"), did, collection, rkey) 369 + pass 370 + 371 + func _after_get_save(save_record): 372 + var save = save_record.value 373 + 374 + UserSave._load_save(Atproto.ATPROTO_SLOT) 375 + 376 + var modified_journal: Dictionary = {} 377 + for area in save.journal: 378 + var area_entries = {} 379 + for entry in area.entries: 380 + var new_quality = [] 381 + for x in entry.quality: 382 + if !new_quality.has(int(x)): 383 + new_quality.append(int(x)) 384 + area_entries[entry.name] = { 385 + count = entry.count, 386 + record = float(entry.record), 387 + quality = new_quality 388 + } 389 + 390 + modified_journal[area.name] = area_entries 391 + save.journal = modified_journal 392 + 393 + var modified_quests = {} 394 + for quest in save.quests: 395 + var id = quest.id 396 + modified_quests[quest.id] = quest 397 + modified_quests[quest.id].erase("id") 398 + save.quests = modified_quests 399 + 400 + # Inventory 401 + for item in save.inventory: 402 + item.size = float(item.size) 403 + item.quality = int(item.quality) 404 + 405 + save.version = float(save.version) 406 + save.saved_aqua_fish.quality = int(save.saved_aqua_fish.quality) 407 + save.saved_aqua_fish.size = float(save.saved_aqua_fish.size) 408 + for letter in save.inbound_mail: 409 + for item in letter.items: 410 + item.size = float(item.size) 411 + item.quality = int(item.quality) 412 + 413 + var modified_hotbar = {} 414 + for item in save.hotbar: 415 + modified_hotbar[int(item)] = save.hotbar[item] 416 + save.hotbar = modified_hotbar 417 + 418 + PlayerData.inventory = save.inventory 419 + PlayerData.hotbar = save.hotbar 420 + PlayerData.cosmetics_unlocked = save.cosmetics_unlocked 421 + PlayerData.cosmetics_equipped = save.cosmetics_equipped 422 + PlayerData.money = save.money 423 + PlayerData.players_muted = save.muted_players 424 + PlayerData.players_hidden = save.hidden_players 425 + PlayerData.bait_inv = save.bait_inv 426 + PlayerData.bait_selected = save.bait_selected 427 + PlayerData.bait_unlocked = save.bait_unlocked 428 + PlayerData.max_bait = save.max_bait 429 + PlayerData.lure_unlocked = save.lure_unlocked 430 + PlayerData.lure_selected = save.lure_selected 431 + PlayerData.journal_logs = save.journal 432 + PlayerData.current_quests = save.quests 433 + PlayerData.completed_quests = save.completed_quests 434 + PlayerData.badge_level = int(save.level) 435 + PlayerData.badge_xp = int(save.xp) 436 + PlayerData.saved_aqua_fish = save.saved_aqua_fish 437 + PlayerData.inbound_mail = save.inbound_mail 438 + PlayerData.saved_tags = save.saved_tags 439 + PlayerData.loan_level = int(save.loan_level) 440 + PlayerData.loan_left = save.loan_left 441 + PlayerData.rod_power_level = save.rod_power 442 + PlayerData.rod_speed_level = save.rod_speed 443 + PlayerData.rod_chance_level = save.rod_chance 444 + PlayerData.rod_luck_level = save.rod_luck 445 + PlayerData.buddy_level = save.buddy_level 446 + PlayerData.buddy_speed = save.buddy_speed 447 + PlayerData.guitar_shapes = save.guitar_shapes 448 + PlayerData.fish_caught = save.fish_caught 449 + PlayerData.cash_total = save.cash_total 450 + PlayerData.voice_pitch = float(save.voice_pitch) 451 + PlayerData.voice_speed = save.voice_speed 452 + PlayerData.locked_refs = save.locked_refs 453 + PlayerData._validate_guitar_shapes() 454 + PlayerData._validate_inventory() 455 + PlayerData._journal_check() 456 + PlayerData._missing_quest_check() 457 + PlayerData._unlock_defaults() 458 + 459 + can_save = false 460 + UserSave._save_slot(Atproto.ATPROTO_SLOT) 461 + can_save = true 462 + 463 + emit_signal("savefile_loaded", save_record.uri) 464 + 465 +
+68
project/mods/Atproto/main.gd
··· 1 + extends Node 2 + 3 + var config: Dictionary 4 + 5 + const ATPROTO_SLOT = 99 6 + var save_loaded: String 7 + var default_config: Dictionary = {} 8 + 9 + onready var TackleBox := $"/root/TackleBox" 10 + const AtProtoClient_t := preload("res://mods/Atproto/atproto_client.gd") 11 + var AtProtoClient: AtProtoClient_t 12 + 13 + # UI 14 + const AtProtoMenu := preload("res://mods/Atproto/ui/menus/atproto_config.tscn") 15 + const AtProtoButton := preload("res://mods/Atproto/ui/buttons/atproto.tscn") 16 + 17 + var setuped = false 18 + 19 + func _enter_tree(): 20 + AtProtoClient = AtProtoClient_t.new() 21 + add_child(AtProtoClient) 22 + AtProtoClient.connect("savefile_loaded", self, "set_save_file") 23 + get_tree().connect("node_added", self, "_add_atproto_menu") 24 + 25 + 26 + func _ready() -> void: 27 + _init_config() 28 + 29 + func _init_config(): 30 + var saved_config = TackleBox.get_mod_config(name) 31 + for key in default_config.keys(): 32 + if not saved_config[key]: 33 + saved_config[key] = default_config[key] 34 + config = saved_config 35 + TackleBox.set_mod_config(name, config) 36 + if config.Autoconnect == true: 37 + AtProtoClient.login(config.Handle, config.Password) 38 + 39 + func _save_config(): 40 + TackleBox.set_mod_config(name, config) 41 + 42 + func _add_atproto_menu(node: Node): 43 + if node.name == "main_menu": 44 + var atproto_menu: Node = AtProtoMenu.instance() 45 + atproto_menu.visible = false 46 + node.add_child(atproto_menu) 47 + 48 + var button = AtProtoButton.instance() 49 + var menu_list: Node = node.get_node("VBoxContainer") 50 + var settings_button: Node = menu_list.get_node("settings") 51 + menu_list.add_child(button) 52 + menu_list.move_child(button, settings_button.get_index() + 1) 53 + atproto_menu.connect("setup_done", self, "_after_setup") 54 + pass 55 + 56 + func _after_setup(): 57 + if setuped: 58 + return 59 + setuped = true 60 + 61 + if config.Save != "" and config.Autoload and AtProtoClient.connected(): 62 + AtProtoClient.load_save(config.Save) 63 + 64 + func can_save_to_atproto(): 65 + return AtProtoClient.can_save && UserSave.current_loaded_slot == ATPROTO_SLOT && AtProtoClient.connected() 66 + 67 + func set_save_file(save_uri): 68 + save_loaded = save_uri
+7
project/mods/Atproto/ui/buttons/atproto.gd
··· 1 + extends GenericUIButton 2 + 3 + 4 + func _on_mods_pressed() -> void: 5 + var atproto_menu = $"../../atproto_config" 6 + atproto_menu._refresh() 7 + atproto_menu.visible = true
+38
project/mods/Atproto/ui/buttons/atproto.tscn
··· 1 + [gd_scene load_steps=8 format=2] 2 + 3 + [ext_resource path="res://Scenes/Singletons/Tooltips/tooltip_node.gd" type="Script" id=1] 4 + [ext_resource path="res://Assets/Themes/accid___.ttf" type="DynamicFontData" id=2] 5 + [ext_resource path="res://Assets/Themes/button_tan_hover.tres" type="StyleBox" id=3] 6 + [ext_resource path="res://Assets/Themes/button_tan_pressed.tres" type="StyleBox" id=4] 7 + [ext_resource path="res://Assets/Themes/button_tan_normal.tres" type="StyleBox" id=5] 8 + [ext_resource path="res://mods/Atproto/ui/buttons/atproto.gd" type="Script" id=6] 9 + 10 + [sub_resource type="DynamicFont" id=1] 11 + size = 34 12 + font_data = ExtResource( 2 ) 13 + 14 + [node name="atproto" type="Button" groups=["menu_button"]] 15 + margin_right = 12.0 16 + margin_bottom = 20.0 17 + size_flags_vertical = 3 18 + custom_colors/font_color_disabled = Color( 1, 0.929412, 0.839216, 1 ) 19 + custom_colors/font_color_focus = Color( 0.419608, 0.270588, 0.129412, 1 ) 20 + custom_colors/font_color = Color( 0.419608, 0.270588, 0.129412, 1 ) 21 + custom_colors/font_color_hover = Color( 1, 0.929412, 0.839216, 1 ) 22 + custom_colors/font_color_pressed = Color( 1, 0.929412, 0.839216, 1 ) 23 + custom_fonts/font = SubResource( 1 ) 24 + custom_styles/hover = ExtResource( 3 ) 25 + custom_styles/pressed = ExtResource( 4 ) 26 + custom_styles/disabled = ExtResource( 4 ) 27 + custom_styles/normal = ExtResource( 5 ) 28 + text = "Atproto Config" 29 + script = ExtResource( 6 ) 30 + 31 + [node name="TooltipNode" type="Control" parent="."] 32 + anchor_right = 1.0 33 + anchor_bottom = 1.0 34 + script = ExtResource( 1 ) 35 + header = "[color=#6a4420]Mods" 36 + body = "Manage your AtProto Data !" 37 + 38 + [connection signal="pressed" from="." to="." method="_on_mods_pressed"]
+304
project/mods/Atproto/ui/menus/atproto_config.gd
··· 1 + extends Node 2 + 3 + onready var Atproto := $"/root/Atproto" 4 + 5 + const AtProtoNewSaveMenu := preload("res://mods/Atproto/ui/menus/new_save.tscn") 6 + 7 + signal setup_done() 8 + 9 + var SaveMenu: Node 10 + var Settings: VBoxContainer 11 + var Credentials: VBoxContainer 12 + var Saves : VBoxContainer 13 + 14 + func _ready(): 15 + Atproto.AtProtoClient.connect("savefile_loaded", self, "set_save_file") 16 + Settings = $"%atproto_settings" 17 + Credentials = Settings.get_node("credentials") 18 + Saves = Settings.get_node("saves") 19 + init_save_menu() 20 + init_credentials() 21 + 22 + if Atproto.AtProtoClient.connected() : 23 + after_login() 24 + else: 25 + init_saves() 26 + 27 + func init_credentials() -> void: 28 + 29 + Credentials.get_node("handle/LineEdit").text = Atproto.config.Handle 30 + Credentials.get_node("password/LineEdit").text = Atproto.config.Password 31 + 32 + var autoconnect: OptionButton = Credentials.get_node("autoconnect").get_node("OptionButton") 33 + autoconnect.add_item("No", 0) 34 + autoconnect.set_item_metadata(0, false) 35 + autoconnect.add_item("Yes", 1) 36 + autoconnect.set_item_metadata(1, true) 37 + 38 + if Atproto.config.Autoconnect: 39 + autoconnect.select(1) 40 + 41 + func init_saves(saves = []) -> void: 42 + var new_save_button: Button = Saves.get_node("buttons").get_node("new_save") 43 + var load_save_button: Button = Saves.get_node("buttons").get_node("load_save") 44 + 45 + var autoload: OptionButton = Saves.get_node("autoload").get_node("OptionButton") 46 + autoload.clear() 47 + autoload.add_item("No", 0) 48 + autoload.set_item_metadata(0, false) 49 + autoload.add_item("Yes", 1) 50 + autoload.set_item_metadata(1, true) 51 + if Atproto.config.Autoload: 52 + autoload.select(1) 53 + 54 + var save_option: OptionButton = Saves.get_node("save").get_node("OptionButton") 55 + save_option.clear() 56 + if Atproto.AtProtoClient.connected(): 57 + var i = 0 58 + for save_record in saves: 59 + var save = save_record.value 60 + save_option.add_item(save.name) 61 + save_option.set_item_metadata(save_option.get_item_count()-1, save.uri) 62 + if Atproto.config.Save == save.uri: 63 + save_option.select(i) 64 + i += 1 65 + save_option.disabled = save_option.get_item_count() == 0 66 + load_save_button.disabled = save_option.get_item_count() == 0 67 + new_save_button.disabled = false 68 + else: 69 + save_option.disabled = true 70 + save_option.add_item("No saves") 71 + 72 + load_save_button.disabled = true 73 + new_save_button.disabled = true 74 + 75 + _refresh() 76 + emit_signal("setup_done") 77 + 78 + func _on_apply_pressed() -> void: 79 + var save : OptionButton = Saves.get_node("save/OptionButton") 80 + Atproto.config.Autoload = Saves.get_node("autoload/OptionButton").get_selected_id() == 1 81 + if (Atproto.config.Save != save.get_selected_metadata() or Atproto.save_loaded != save.get_selected_metadata()) and Atproto.config.Autoload: 82 + Atproto.AtProtoClient.load_save(save.get_selected_metadata()) 83 + 84 + 85 + var autoconnect: OptionButton = Credentials.get_node("autoconnect").get_node("OptionButton") 86 + 87 + Atproto.config.Autoconnect = autoconnect.get_selected_id() == 1 88 + 89 + 90 + Atproto.config.Handle = Credentials.get_node("handle/LineEdit").text 91 + Atproto.config.Password = Credentials.get_node("password/LineEdit").text 92 + 93 + Atproto._save_config() 94 + 95 + set("visible", false) 96 + 97 + func _on_close_pressed() -> void: 98 + set("visible", false) 99 + 100 + 101 + func start_loading(): 102 + var panel = get_node("Panel") 103 + panel.get_node("Loader").set("visible", true) 104 + panel.get_node("close").set("disabled", true) 105 + panel.get_node("apply").set("disabled", true) 106 + 107 + func stop_loading(): 108 + var panel = get_node("Panel") 109 + panel.get_node("Loader").set("visible", false) 110 + panel.get_node("close").set("disabled", false) 111 + panel.get_node("apply").set("disabled", false) 112 + 113 + # CONNECTION 114 + 115 + func _on_connect_button_button_down(): 116 + var handle_field : LineEdit = Credentials.get_node("handle/LineEdit") 117 + var password_field : LineEdit = Credentials.get_node("password/LineEdit") 118 + Atproto.AtProtoClient.connect("connection", self, "_after_connect") 119 + start_loading() 120 + Atproto.AtProtoClient.login(handle_field.text, password_field.text) 121 + 122 + func _after_connect(success): 123 + if !success: 124 + PopupMessage._show_popup("An error has occured !") 125 + else: 126 + PopupMessage._show_popup("Connection successful !") 127 + after_login() 128 + stop_loading() 129 + 130 + func after_login(_a = null): 131 + Atproto.AtProtoClient.get_saves(funcref(self, "init_saves")) 132 + 133 + func _refresh(): 134 + $"%atproto_settings/save_info".text = get_loaded_save_info() 135 + 136 + func get_loaded_save_info(): 137 + if UserSave.current_loaded_slot != Atproto.ATPROTO_SLOT: 138 + return "No AtProto save loaded" 139 + else: 140 + var save_option: OptionButton = Saves.get_node("save").get_node("OptionButton") 141 + var i = 0 142 + while i < save_option.get_item_count(): 143 + var metadata = save_option.get_item_metadata(i) 144 + if metadata == Atproto.save_loaded: 145 + return save_option.get_item_text(i) + " is currently loaded" 146 + i+=1 147 + return "Invalid save file loaded" 148 + # SAVES 149 + 150 + func set_save_file(save_uri): 151 + Atproto.config.Save = save_uri 152 + PopupMessage._show_popup("AtProto save loaded : " + get_current_save_name()) 153 + _refresh() 154 + pass 155 + 156 + func _on_load_save_button_down(): 157 + var save: OptionButton = Saves.get_node("save").get_node("OptionButton") 158 + Atproto.AtProtoClient.load_save(save.get_selected_metadata()) 159 + pass 160 + 161 + 162 + func get_current_save_name() -> String: 163 + if UserSave.current_loaded_slot != 99: 164 + return "Slot " + str(UserSave.current_loaded_slot + 1) 165 + 166 + var save_option: OptionButton = Saves.get_node("save").get_node("OptionButton") 167 + var i = 0 168 + while i < save_option.get_item_count(): 169 + var metadata = save_option.get_item_metadata(i) 170 + if metadata == Atproto.save_loaded: 171 + return save_option.get_item_text(i) 172 + i+=1 173 + return "" 174 + 175 + func _on_new_save_button_down(): 176 + var current = get_current_save_name() 177 + if current != "": 178 + SaveMenu.get_node("save_menu/duplicate").text = "Duplicate " + current 179 + SaveMenu.get_node("save_menu/duplicate").disabled = false 180 + else: 181 + SaveMenu.get_node("save_menu/duplicate").text = "Invalid Save" 182 + SaveMenu.get_node("save_menu/duplicate").disabled = true 183 + 184 + SaveMenu.visible = true 185 + 186 + 187 + # Create Save Menu 188 + func init_save_menu(): 189 + SaveMenu = AtProtoNewSaveMenu.instance() 190 + add_child(SaveMenu) 191 + SaveMenu.visible = false 192 + var x : Button 193 + SaveMenu.get_node("save_menu/close").connect("button_down", self, "close_save_menu") 194 + SaveMenu.get_node("save_menu/duplicate").connect("button_down", self, "create_save", [true]) 195 + SaveMenu.get_node("save_menu/new").connect("button_down", self, "create_save", [false]) 196 + 197 + func create_save(duplicate = false): 198 + var backup = backup_save() 199 + if !duplicate: 200 + PlayerData._reset_save() 201 + Atproto.AtProtoClient.create_save(funcref(self, "create_save_file")) 202 + close_save_menu() 203 + restore_save(backup) 204 + pass 205 + 206 + func save_file_created(record): 207 + var file_name = SaveMenu.get_node("save_menu/Panel/save_name/LineEdit").text 208 + PopupMessage._show_popup("AtProto save created : " + file_name) 209 + SaveMenu.get_node("save_menu/Panel/save_name/LineEdit").text = "" 210 + after_login() 211 + pass 212 + 213 + func create_save_file(save_record): 214 + var file_name = SaveMenu.get_node("save_menu/Panel/save_name/LineEdit").text 215 + var uri = save_record.uri 216 + Atproto.AtProtoClient.create_save_file(uri, file_name, funcref(self, "save_file_created")) 217 + pass 218 + 219 + func backup_save(): 220 + return { 221 + "inventory": PlayerData.inventory, 222 + "hotbar": PlayerData.hotbar, 223 + "cosmetics_unlocked": PlayerData.cosmetics_unlocked, 224 + "cosmetics_equipped": PlayerData.cosmetics_equipped, 225 + "new_cosmetics": PlayerData.new_cosmetics, 226 + "version": Globals.GAME_VERSION, 227 + "muted_players": PlayerData.players_muted, 228 + "hidden_players": PlayerData.players_hidden, 229 + "recorded_time": PlayerData.last_recorded_time, 230 + "money": PlayerData.money, 231 + "bait_inv": PlayerData.bait_inv, 232 + "bait_selected": PlayerData.bait_selected, 233 + "bait_unlocked": PlayerData.bait_unlocked, 234 + "shop": PlayerData.current_shop, 235 + "journal": PlayerData.journal_logs, 236 + "quests": PlayerData.current_quests, 237 + "completed_quests": PlayerData.completed_quests, 238 + "level": PlayerData.badge_level, 239 + "xp": PlayerData.badge_xp, 240 + "max_bait": PlayerData.max_bait, 241 + "lure_unlocked": PlayerData.lure_unlocked, 242 + "lure_selected": PlayerData.lure_selected, 243 + "saved_aqua_fish": PlayerData.saved_aqua_fish, 244 + "inbound_mail": PlayerData.inbound_mail, 245 + "rod_power": PlayerData.rod_power_level, 246 + "rod_speed": PlayerData.rod_speed_level, 247 + "rod_chance": PlayerData.rod_chance_level, 248 + "rod_luck": PlayerData.rod_luck_level, 249 + "saved_tags": PlayerData.saved_tags, 250 + "loan_level": PlayerData.loan_level, 251 + "loan_left": PlayerData.loan_left, 252 + "buddy_level": PlayerData.buddy_level, 253 + "buddy_speed": PlayerData.buddy_speed, 254 + "guitar_shapes": PlayerData.guitar_shapes, 255 + "fish_caught": PlayerData.fish_caught, 256 + "cash_total": PlayerData.cash_total, 257 + "voice_pitch": PlayerData.voice_pitch, 258 + "voice_speed": PlayerData.voice_speed, 259 + "locked_refs": PlayerData.locked_refs, 260 + }.duplicate(true) 261 + 262 + func restore_save(data): 263 + PlayerData.inventory = data.inventory 264 + PlayerData.hotbar = data.hotbar 265 + PlayerData.cosmetics_unlocked = data.cosmetics_unlocked 266 + PlayerData.cosmetics_equipped = data.cosmetics_equipped 267 + PlayerData.new_cosmetics = data.new_cosmetics 268 + PlayerData.players_muted = data.muted_players 269 + PlayerData.players_hidden = data.hidden_players 270 + PlayerData.last_recorded_time = data.recorded_time 271 + PlayerData.money = data.money 272 + PlayerData.bait_inv = data.bait_inv 273 + PlayerData.bait_selected = data.bait_selected 274 + PlayerData.bait_unlocked = data.bait_unlocked 275 + PlayerData.current_shop = data.shop 276 + PlayerData.journal_logs = data.journal 277 + PlayerData.current_quests = data.quests 278 + PlayerData.completed_quests = data.completed_quests 279 + PlayerData.badge_level = data.level 280 + PlayerData.badge_xp = data.xp 281 + PlayerData.max_bait = data.max_bait 282 + PlayerData.lure_unlocked = data.lure_unlocked 283 + PlayerData.lure_selected = data.lure_selected 284 + PlayerData.saved_aqua_fish = data.saved_aqua_fish 285 + PlayerData.inbound_mail = data.inbound_mail 286 + PlayerData.rod_power_level = data.rod_power 287 + PlayerData.rod_speed_level = data.rod_speed 288 + PlayerData.rod_chance_level = data.rod_chance 289 + PlayerData.rod_luck_level = data.rod_luck 290 + PlayerData.saved_tags = data.saved_tags 291 + PlayerData.loan_level = data.loan_level 292 + PlayerData.loan_left = data.loan_left 293 + PlayerData.buddy_level = data.buddy_level 294 + PlayerData.buddy_speed = data.buddy_speed 295 + PlayerData.guitar_shapes = data.guitar_shapes 296 + PlayerData.fish_caught = data.fish_caught 297 + PlayerData.cash_total = data.cash_total 298 + PlayerData.voice_pitch = data.voice_pitch 299 + PlayerData.voice_speed = data.voice_speed 300 + PlayerData.locked_refs = data.locked_refs 301 + 302 + 303 + func close_save_menu(): 304 + SaveMenu.visible = false
+302
project/mods/Atproto/ui/menus/atproto_config.tscn
··· 1 + [gd_scene load_steps=8 format=2] 2 + 3 + [ext_resource path="res://Scenes/Menus/Main Menu/ui_generic_button.gd" type="Script" id=1] 4 + [ext_resource path="res://Assets/Themes/accid___.ttf" type="DynamicFontData" id=3] 5 + [ext_resource path="res://mods/Atproto/ui/menus/atproto_config.gd" type="Script" id=4] 6 + [ext_resource path="res://mods/TackleBox/assets/mod_menu.tres" type="Theme" id=5] 7 + [ext_resource path="res://Assets/Textures/UI/knot_sep2.png" type="Texture" id=6] 8 + 9 + [sub_resource type="DynamicFont" id=2] 10 + size = 48 11 + font_data = ExtResource( 3 ) 12 + 13 + [sub_resource type="StyleBoxFlat" id=1] 14 + content_margin_left = 16.0 15 + content_margin_right = 16.0 16 + content_margin_top = 16.0 17 + content_margin_bottom = 16.0 18 + bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 19 + corner_radius_top_left = 16 20 + corner_radius_top_right = 16 21 + corner_radius_bottom_right = 16 22 + corner_radius_bottom_left = 16 23 + 24 + [node name="atproto_config" type="Control"] 25 + anchor_right = 1.0 26 + anchor_bottom = 1.0 27 + rect_pivot_offset = Vector2( -335, -90 ) 28 + theme = ExtResource( 5 ) 29 + script = ExtResource( 4 ) 30 + 31 + [node name="background" type="ColorRect" parent="."] 32 + anchor_right = 1.0 33 + anchor_bottom = 1.0 34 + size_flags_horizontal = 3 35 + size_flags_vertical = 3 36 + color = Color( 0.0627451, 0.109804, 0.192157, 0.431373 ) 37 + 38 + [node name="Panel" type="Panel" parent="."] 39 + anchor_left = 0.3 40 + anchor_top = 0.2 41 + anchor_right = 0.7 42 + anchor_bottom = 0.8 43 + 44 + [node name="Title" type="Label" parent="Panel"] 45 + unique_name_in_owner = true 46 + margin_left = 16.0 47 + margin_top = 16.0 48 + margin_right = 752.0 49 + margin_bottom = 58.0 50 + theme = ExtResource( 5 ) 51 + custom_fonts/font = SubResource( 2 ) 52 + text = "CONFIGURING ATPROTO" 53 + align = 1 54 + 55 + [node name="sep" type="TextureRect" parent="Panel"] 56 + anchor_left = 0.5 57 + anchor_right = 0.5 58 + margin_left = -384.0 59 + margin_top = 80.0 60 + margin_right = 384.0 61 + margin_bottom = 112.0 62 + rect_min_size = Vector2( 0, 32 ) 63 + size_flags_horizontal = 3 64 + texture = ExtResource( 6 ) 65 + expand = true 66 + stretch_mode = 4 67 + 68 + [node name="Panel" type="Panel" parent="Panel"] 69 + anchor_right = 1.0 70 + anchor_bottom = 1.0 71 + margin_left = 16.0 72 + margin_top = 131.0 73 + margin_right = -16.0 74 + margin_bottom = -16.0 75 + custom_styles/panel = SubResource( 1 ) 76 + 77 + [node name="ScrollContainer" type="ScrollContainer" parent="Panel/Panel"] 78 + anchor_right = 1.0 79 + anchor_bottom = 1.0 80 + margin_left = 16.0 81 + margin_top = 8.0 82 + margin_right = -16.0 83 + margin_bottom = -51.0 84 + __meta__ = { 85 + "_editor_description_": " " 86 + } 87 + 88 + [node name="atproto_settings" type="VBoxContainer" parent="Panel/Panel/ScrollContainer"] 89 + unique_name_in_owner = true 90 + margin_right = 704.0 91 + margin_bottom = 428.0 92 + size_flags_horizontal = 3 93 + custom_constants/separation = 40 94 + 95 + [node name="credentials" type="VBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings"] 96 + margin_right = 704.0 97 + margin_bottom = 176.0 98 + size_flags_horizontal = 3 99 + size_flags_vertical = 3 100 + custom_constants/separation = 4 101 + 102 + [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 103 + margin_right = 704.0 104 + margin_bottom = 32.0 105 + text = "Credentials" 106 + align = 1 107 + 108 + [node name="handle" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 109 + margin_top = 36.0 110 + margin_right = 704.0 111 + margin_bottom = 68.0 112 + 113 + [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/handle"] 114 + margin_right = 350.0 115 + margin_bottom = 32.0 116 + size_flags_horizontal = 3 117 + text = "Handle:" 118 + 119 + [node name="LineEdit" type="LineEdit" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/handle"] 120 + margin_left = 354.0 121 + margin_right = 704.0 122 + margin_bottom = 32.0 123 + size_flags_horizontal = 3 124 + placeholder_text = "alice.bsky.social" 125 + caret_blink = true 126 + __meta__ = { 127 + "_editor_description_": "" 128 + } 129 + 130 + [node name="password" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 131 + margin_top = 72.0 132 + margin_right = 704.0 133 + margin_bottom = 104.0 134 + 135 + [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/password"] 136 + margin_right = 350.0 137 + margin_bottom = 32.0 138 + size_flags_horizontal = 3 139 + text = "App Password:" 140 + 141 + [node name="LineEdit" type="LineEdit" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/password"] 142 + margin_left = 354.0 143 + margin_right = 704.0 144 + margin_bottom = 32.0 145 + size_flags_horizontal = 3 146 + secret = true 147 + placeholder_text = "mysecretpassword" 148 + caret_blink = true 149 + __meta__ = { 150 + "_editor_description_": "" 151 + } 152 + 153 + [node name="autoconnect" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 154 + margin_top = 108.0 155 + margin_right = 704.0 156 + margin_bottom = 140.0 157 + 158 + [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/autoconnect"] 159 + margin_right = 350.0 160 + margin_bottom = 32.0 161 + size_flags_horizontal = 3 162 + text = "Auto-connect:" 163 + 164 + [node name="OptionButton" type="OptionButton" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials/autoconnect"] 165 + margin_left = 354.0 166 + margin_right = 704.0 167 + margin_bottom = 32.0 168 + size_flags_horizontal = 3 169 + 170 + [node name="connect_button" type="Button" parent="Panel/Panel/ScrollContainer/atproto_settings/credentials"] 171 + margin_top = 144.0 172 + margin_right = 704.0 173 + margin_bottom = 176.0 174 + size_flags_horizontal = 5 175 + text = "Connect" 176 + 177 + [node name="saves" type="VBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings"] 178 + margin_top = 216.0 179 + margin_right = 704.0 180 + margin_bottom = 356.0 181 + 182 + [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 183 + margin_right = 704.0 184 + margin_bottom = 32.0 185 + text = "Saves" 186 + align = 1 187 + 188 + [node name="autoload" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 189 + margin_top = 36.0 190 + margin_right = 704.0 191 + margin_bottom = 68.0 192 + 193 + [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/autoload"] 194 + margin_right = 350.0 195 + margin_bottom = 32.0 196 + size_flags_horizontal = 3 197 + text = "Autoload :" 198 + 199 + [node name="OptionButton" type="OptionButton" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/autoload"] 200 + margin_left = 354.0 201 + margin_right = 704.0 202 + margin_bottom = 32.0 203 + size_flags_horizontal = 3 204 + 205 + [node name="save" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 206 + margin_top = 72.0 207 + margin_right = 704.0 208 + margin_bottom = 104.0 209 + 210 + [node name="Label" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/save"] 211 + margin_right = 350.0 212 + margin_bottom = 32.0 213 + size_flags_horizontal = 3 214 + text = "Save :" 215 + 216 + [node name="OptionButton" type="OptionButton" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/save"] 217 + margin_left = 354.0 218 + margin_right = 704.0 219 + margin_bottom = 32.0 220 + size_flags_horizontal = 3 221 + 222 + [node name="buttons" type="HBoxContainer" parent="Panel/Panel/ScrollContainer/atproto_settings/saves"] 223 + margin_top = 108.0 224 + margin_right = 704.0 225 + margin_bottom = 140.0 226 + 227 + [node name="new_save" type="Button" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons"] 228 + margin_right = 350.0 229 + margin_bottom = 32.0 230 + size_flags_horizontal = 3 231 + text = "New Save" 232 + 233 + [node name="load_save" type="Button" parent="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons"] 234 + margin_left = 354.0 235 + margin_right = 704.0 236 + margin_bottom = 32.0 237 + size_flags_horizontal = 3 238 + text = "Load Save" 239 + 240 + [node name="save_info" type="Label" parent="Panel/Panel/ScrollContainer/atproto_settings"] 241 + margin_top = 396.0 242 + margin_right = 704.0 243 + margin_bottom = 428.0 244 + text = "[No Save File Loaded]" 245 + align = 1 246 + 247 + [node name="Loader" type="Panel" parent="Panel"] 248 + visible = false 249 + modulate = Color( 1, 1, 1, 0.654902 ) 250 + anchor_right = 1.0 251 + anchor_bottom = 1.0 252 + margin_left = 16.0 253 + margin_top = 131.0 254 + margin_right = -16.0 255 + margin_bottom = -16.0 256 + custom_styles/panel = SubResource( 1 ) 257 + 258 + [node name="Container" type="CenterContainer" parent="Panel/Loader"] 259 + margin_left = -16.0 260 + margin_top = -127.0 261 + margin_right = 755.0 262 + margin_bottom = 523.0 263 + 264 + [node name="Title" type="Label" parent="Panel/Loader/Container"] 265 + margin_left = 314.0 266 + margin_top = 297.0 267 + margin_right = 457.0 268 + margin_bottom = 353.0 269 + size_flags_horizontal = 3 270 + size_flags_vertical = 3 271 + theme = ExtResource( 5 ) 272 + custom_colors/font_color = Color( 0, 0, 0, 1 ) 273 + custom_fonts/font = SubResource( 2 ) 274 + text = "Loading..." 275 + 276 + [node name="close" type="Button" parent="Panel"] 277 + anchor_left = 1.0 278 + anchor_right = 1.0 279 + margin_left = -24.0 280 + margin_top = -16.0 281 + margin_right = 16.0 282 + margin_bottom = 24.0 283 + text = "X" 284 + script = ExtResource( 1 ) 285 + 286 + [node name="apply" type="Button" parent="Panel"] 287 + anchor_left = 1.0 288 + anchor_top = 1.0 289 + anchor_right = 1.0 290 + anchor_bottom = 1.0 291 + margin_left = -188.0 292 + margin_top = -56.0 293 + margin_right = 24.0 294 + margin_bottom = 24.0 295 + text = "Save Changes" 296 + script = ExtResource( 1 ) 297 + 298 + [connection signal="button_down" from="Panel/Panel/ScrollContainer/atproto_settings/credentials/connect_button" to="." method="_on_connect_button_button_down"] 299 + [connection signal="button_down" from="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons/new_save" to="." method="_on_new_save_button_down"] 300 + [connection signal="button_down" from="Panel/Panel/ScrollContainer/atproto_settings/saves/buttons/load_save" to="." method="_on_load_save_button_down"] 301 + [connection signal="pressed" from="Panel/close" to="." method="_on_close_pressed"] 302 + [connection signal="pressed" from="Panel/apply" to="." method="_on_apply_pressed"]
+168
project/mods/Atproto/ui/menus/new_save.tscn
··· 1 + [gd_scene load_steps=8 format=2] 2 + 3 + [ext_resource path="res://Assets/Themes/main.tres" type="Theme" id=1] 4 + [ext_resource path="res://Scenes/Menus/Main Menu/ui_generic_button.gd" type="Script" id=2] 5 + [ext_resource path="res://Assets/Themes/accid___.ttf" type="DynamicFontData" id=3] 6 + [ext_resource path="res://mods/TackleBox/assets/mod_menu.tres" type="Theme" id=4] 7 + [ext_resource path="res://Assets/Textures/UI/knot_sep2.png" type="Texture" id=5] 8 + 9 + [sub_resource type="DynamicFont" id=1] 10 + size = 48 11 + font_data = ExtResource( 3 ) 12 + 13 + [sub_resource type="StyleBoxFlat" id=2] 14 + content_margin_left = 16.0 15 + content_margin_right = 16.0 16 + content_margin_top = 16.0 17 + content_margin_bottom = 16.0 18 + bg_color = Color( 0.835294, 0.666667, 0.45098, 1 ) 19 + corner_radius_top_left = 16 20 + corner_radius_top_right = 16 21 + corner_radius_bottom_right = 16 22 + corner_radius_bottom_left = 16 23 + 24 + [node name="Node2D" type="Control"] 25 + anchor_right = 1.0 26 + anchor_bottom = 1.0 27 + theme = ExtResource( 1 ) 28 + 29 + [node name="background" type="ColorRect" parent="."] 30 + anchor_right = 1.0 31 + anchor_bottom = 1.0 32 + margin_left = -83.0 33 + margin_top = -47.0 34 + margin_right = 33.0 35 + margin_bottom = 29.0 36 + size_flags_horizontal = 3 37 + size_flags_vertical = 3 38 + color = Color( 0.0627451, 0.109804, 0.192157, 0.431373 ) 39 + 40 + [node name="save_menu" type="Panel" parent="."] 41 + unique_name_in_owner = true 42 + anchor_left = 0.3 43 + anchor_top = 0.374 44 + anchor_right = 0.712 45 + anchor_bottom = 0.675 46 + margin_top = 0.0799866 47 + margin_right = 0.959961 48 + 49 + [node name="Title" type="Label" parent="save_menu"] 50 + margin_left = 16.0 51 + margin_top = 16.0 52 + margin_right = 752.0 53 + margin_bottom = 58.0 54 + theme = ExtResource( 4 ) 55 + custom_fonts/font = SubResource( 1 ) 56 + text = "Create a new save" 57 + align = 1 58 + 59 + [node name="sep" type="TextureRect" parent="save_menu"] 60 + anchor_left = 0.5 61 + anchor_right = 0.5 62 + margin_left = -384.0 63 + margin_top = 80.0 64 + margin_right = 384.0 65 + margin_bottom = 112.0 66 + rect_min_size = Vector2( 0, 32 ) 67 + size_flags_horizontal = 3 68 + texture = ExtResource( 5 ) 69 + expand = true 70 + stretch_mode = 4 71 + 72 + [node name="Panel" type="Panel" parent="save_menu"] 73 + anchor_left = 0.119 74 + anchor_top = 0.403 75 + anchor_right = 0.893 76 + anchor_bottom = 0.745 77 + margin_left = -0.248001 78 + margin_top = 0.0249939 79 + margin_right = -0.256042 80 + margin_bottom = -0.125015 81 + custom_styles/panel = SubResource( 2 ) 82 + 83 + [node name="save_name" type="VBoxContainer" parent="save_menu/Panel"] 84 + anchor_right = 1.0 85 + anchor_bottom = 1.0 86 + margin_left = 40.0 87 + margin_top = 8.0 88 + margin_right = -52.0 89 + margin_bottom = -35.0 90 + size_flags_horizontal = 3 91 + 92 + [node name="Label" type="Label" parent="save_menu/Panel/save_name"] 93 + margin_right = 520.0 94 + margin_bottom = 32.0 95 + text = "Save Name" 96 + align = 1 97 + 98 + [node name="LineEdit" type="LineEdit" parent="save_menu/Panel/save_name"] 99 + margin_top = 36.0 100 + margin_right = 520.0 101 + margin_bottom = 68.0 102 + size_flags_horizontal = 3 103 + 104 + [node name="Loader" type="Panel" parent="save_menu"] 105 + visible = false 106 + modulate = Color( 1, 1, 1, 0.654902 ) 107 + anchor_right = 1.0 108 + anchor_bottom = 1.0 109 + margin_left = 16.0 110 + margin_top = 131.0 111 + margin_right = -16.0 112 + margin_bottom = -16.0 113 + custom_styles/panel = SubResource( 2 ) 114 + 115 + [node name="Container" type="CenterContainer" parent="save_menu/Loader"] 116 + margin_left = -16.0 117 + margin_top = -127.0 118 + margin_right = 755.0 119 + margin_bottom = 523.0 120 + 121 + [node name="Title" type="Label" parent="save_menu/Loader/Container"] 122 + margin_left = 314.0 123 + margin_top = 297.0 124 + margin_right = 457.0 125 + margin_bottom = 353.0 126 + size_flags_horizontal = 3 127 + size_flags_vertical = 3 128 + theme = ExtResource( 4 ) 129 + custom_colors/font_color = Color( 0, 0, 0, 1 ) 130 + custom_fonts/font = SubResource( 1 ) 131 + text = "Loading..." 132 + 133 + [node name="close" type="Button" parent="save_menu"] 134 + anchor_left = 1.0 135 + anchor_right = 1.0 136 + margin_left = -24.0 137 + margin_top = -16.0 138 + margin_right = 16.0 139 + margin_bottom = 24.0 140 + text = "X" 141 + script = ExtResource( 2 ) 142 + 143 + [node name="duplicate" type="Button" parent="save_menu"] 144 + anchor_left = 0.734 145 + anchor_top = 1.0 146 + anchor_right = 0.734 147 + anchor_bottom = 1.0 148 + margin_left = -211.712 149 + margin_top = -56.0 150 + margin_right = 0.287964 151 + margin_bottom = 24.0 152 + grow_horizontal = 0 153 + rect_pivot_offset = Vector2( 89, 24 ) 154 + text = "Duplicate Save" 155 + script = ExtResource( 2 ) 156 + 157 + [node name="new" type="Button" parent="save_menu"] 158 + anchor_left = 1.0 159 + anchor_top = 1.0 160 + anchor_right = 1.0 161 + anchor_bottom = 1.0 162 + margin_left = -188.0 163 + margin_top = -56.0 164 + margin_right = 24.0 165 + margin_bottom = 24.0 166 + rect_pivot_offset = Vector2( 89, 24 ) 167 + text = "Create Save" 168 + script = ExtResource( 2 )
+21
project/project.godot
··· 1 + ; Engine configuration file. 2 + ; It's best edited using the editor UI and not directly, 3 + ; since the parameters that go here are not all obvious. 4 + ; 5 + ; Format: 6 + ; [section] ; section goes between [] 7 + ; param=value ; assign values to parameters 8 + 9 + config_version=4 10 + 11 + [application] 12 + 13 + config/name="AtProto Webfishing" 14 + 15 + [gui] 16 + 17 + common/drop_mouse_on_gui_input_disabled=true 18 + 19 + [physics] 20 + 21 + common/enable_pause_aware_picking=true