horiyouta commited on
Commit
c3de7ac
1 Parent(s): d814a30

2410232053

Browse files
Files changed (6) hide show
  1. app.py +4 -4
  2. public/data.js +124 -0
  3. public/func.js +17 -0
  4. public/index.html +38 -0
  5. public/mmp4.zip +2 -2
  6. public/script.js +1 -0
app.py CHANGED
@@ -82,12 +82,12 @@ async def sb3(req_data: TextRequest):
82
 
83
  names = StringGenerator('[a-f\\d]{32}').render_list(len(data) - 1, unique=True)
84
  for i in range(1, len(data)):
85
- name = f'{names[i-1]}.png'
86
  image_data = base64.b64decode(data[i].split(',', 1)[1])
87
 
88
  # 画像をリサイズ
89
  img = Image.open(BytesIO(image_data))
90
- img_resized = img.resize((40, 40))
91
  img_buffer = BytesIO()
92
  img_resized.save(img_buffer, format='PNG')
93
  img_buffer.seek(0)
@@ -99,8 +99,8 @@ async def sb3(req_data: TextRequest):
99
  "name": str(i),
100
  "bitmapResolution": 2,
101
  "dataFormat": "png",
102
- "assetId": names[i-1],
103
- "md5ext": f"{names[i-1]}.png",
104
  "rotationCenterX": 40,
105
  "rotationCenterY": 40
106
  })
 
82
 
83
  names = StringGenerator('[a-f\\d]{32}').render_list(len(data) - 1, unique=True)
84
  for i in range(1, len(data)):
85
+ name = f'{names[i - 1]}.png'
86
  image_data = base64.b64decode(data[i].split(',', 1)[1])
87
 
88
  # 画像をリサイズ
89
  img = Image.open(BytesIO(image_data))
90
+ img_resized = img.resize((80, 80))
91
  img_buffer = BytesIO()
92
  img_resized.save(img_buffer, format='PNG')
93
  img_buffer.seek(0)
 
99
  "name": str(i),
100
  "bitmapResolution": 2,
101
  "dataFormat": "png",
102
+ "assetId": names[i - 1],
103
+ "md5ext": f"{names[i - 1]}.png",
104
  "rotationCenterX": 40,
105
  "rotationCenterY": 40
106
  })
public/data.js CHANGED
@@ -4492,5 +4492,129 @@ Blockly.defineBlocksWithJsonArray([
4492
  "tooltip": "",
4493
  "helpUrl": "",
4494
  "style": "data"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4495
  }
4496
  ]);
 
4492
  "tooltip": "",
4493
  "helpUrl": "",
4494
  "style": "data"
4495
+ },
4496
+ {
4497
+ "type": "add_tool",
4498
+ "message0": "ツールデータ追加 %1 ツール名: %2 %3 画像ID: %4 %5 採掘速度: %6 %7 タイプ: %8 の %9 %10 攻撃力: %11 %12 耐久力: %13",
4499
+ "args0": [
4500
+ {
4501
+ "type": "input_end_row"
4502
+ },
4503
+ {
4504
+ "type": "input_value",
4505
+ "name": "1"
4506
+ },
4507
+ {
4508
+ "type": "input_end_row"
4509
+ },
4510
+ {
4511
+ "type": "input_value",
4512
+ "name": "7"
4513
+ },
4514
+ {
4515
+ "type": "input_end_row"
4516
+ },
4517
+ {
4518
+ "type": "input_value",
4519
+ "name": "2"
4520
+ },
4521
+ {
4522
+ "type": "input_end_row"
4523
+ },
4524
+ {
4525
+ "type": "field_dropdown",
4526
+ "name": "4",
4527
+ "options": [
4528
+ [
4529
+ "木",
4530
+ "1"
4531
+ ],
4532
+ [
4533
+ "石",
4534
+ "2"
4535
+ ],
4536
+ [
4537
+ "鉄",
4538
+ "3"
4539
+ ],
4540
+ [
4541
+ "ダイヤ",
4542
+ "4"
4543
+ ],
4544
+ [
4545
+ "金",
4546
+ "5"
4547
+ ],
4548
+ [
4549
+ "ネザライト",
4550
+ "6"
4551
+ ]
4552
+ ]
4553
+ },
4554
+ {
4555
+ "type": "field_dropdown",
4556
+ "name": "3",
4557
+ "options": [
4558
+ [
4559
+ "剣",
4560
+ "W"
4561
+ ],
4562
+ [
4563
+ "つるはし",
4564
+ "P"
4565
+ ],
4566
+ [
4567
+ "斧",
4568
+ "A"
4569
+ ],
4570
+ [
4571
+ "シャベル",
4572
+ "S"
4573
+ ],
4574
+ [
4575
+ "くわ",
4576
+ "H"
4577
+ ]
4578
+ ]
4579
+ },
4580
+ {
4581
+ "type": "input_end_row"
4582
+ },
4583
+ {
4584
+ "type": "input_value",
4585
+ "name": "5"
4586
+ },
4587
+ {
4588
+ "type": "input_end_row"
4589
+ },
4590
+ {
4591
+ "type": "input_value",
4592
+ "name": "6"
4593
+ }
4594
+ ],
4595
+ "previousStatement": null,
4596
+ "nextStatement": null,
4597
+ "tooltip": "",
4598
+ "helpUrl": "",
4599
+ "style": "motion"
4600
+ },
4601
+ {
4602
+ "type": "join",
4603
+ "message0": "%1 と %2",
4604
+ "args0": [
4605
+ {
4606
+ "type": "input_value",
4607
+ "name": "value"
4608
+ },
4609
+ {
4610
+ "type": "input_value",
4611
+ "name": "value2"
4612
+ }
4613
+ ],
4614
+ "inputsInline": true,
4615
+ "output": null,
4616
+ "tooltip": "",
4617
+ "helpUrl": "",
4618
+ "style": "operators"
4619
  }
4620
  ]);
public/func.js CHANGED
@@ -362,4 +362,21 @@ javascript.javascriptGenerator.forBlock[`material`] = (block, generator) => {
362
  javascript.javascriptGenerator.forBlock[`dye`] = (block, generator) => {
363
  const type = block.getFieldValue(`type`);
364
  return type;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
365
  };
 
362
  javascript.javascriptGenerator.forBlock[`dye`] = (block, generator) => {
363
  const type = block.getFieldValue(`type`);
364
  return type;
365
+ };
366
+
367
+ javascript.javascriptGenerator.forBlock[`add_tool`] = (block, generator) => {
368
+ const v1 = stc(block, generator, `1`);
369
+ const v7 = stc(block, generator, `7`);
370
+ const v2 = stc(block, generator, `2`);
371
+ const v4 = block.getFieldValue(`4`);
372
+ const v3 = block.getFieldValue(`3`);
373
+ const v5 = stc(block, generator, `5`);
374
+ const v6 = stc(block, generator, `6`);
375
+ return `at[${v1}][${v7}][${v2}][${v3}${v4}][${v5}][${v6}]`;
376
+ };
377
+
378
+ javascript.javascriptGenerator.forBlock[`join`] = (block, generator) => {
379
+ const value = stc(block, generator, `value`);
380
+ const value2 = stc(block, generator, `value2`);
381
+ return `jo[${value}][${value2}]`;
382
  };
public/index.html CHANGED
@@ -156,6 +156,30 @@
156
  </value>
157
  </block>
158
  <sep gap="10"></sep>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  <block type="add_food">
160
  <value name="1">
161
  <shadow type="input"></shadow>
@@ -359,6 +383,19 @@
359
  <sep gap="10"></sep>
360
  <block type="not"></block>
361
  <sep gap="30"></sep>
 
 
 
 
 
 
 
 
 
 
 
 
 
362
  <block type="place">
363
  <value name="x">
364
  <shadow type="input"></shadow>
@@ -480,6 +517,7 @@
480
  <script src="https://unpkg.com/blockly/msg/ja.js"></script>
481
  <script src="data.js"></script>
482
  <script src="func.js"></script>
 
483
  <script src="script.js"></script>
484
  </body>
485
 
 
156
  </value>
157
  </block>
158
  <sep gap="10"></sep>
159
+ <block type="add_tool">
160
+ <value name="1">
161
+ <shadow type="input"></shadow>
162
+ </value>
163
+ <value name="2">
164
+ <shadow type="input">
165
+ <field name="value">6</field>
166
+ </shadow>
167
+ </value>
168
+ <value name="5">
169
+ <shadow type="input">
170
+ <field name="value">7</field>
171
+ </shadow>
172
+ </value>
173
+ <value name="6">
174
+ <shadow type="input">
175
+ <field name="value">1000</field>
176
+ </shadow>
177
+ </value>
178
+ <value name="7">
179
+ <shadow type="input"></shadow>
180
+ </value>
181
+ </block>
182
+ <sep gap="10"></sep>
183
  <block type="add_food">
184
  <value name="1">
185
  <shadow type="input"></shadow>
 
383
  <sep gap="10"></sep>
384
  <block type="not"></block>
385
  <sep gap="30"></sep>
386
+ <block type="join">
387
+ <value name="value">
388
+ <shadow type="input">
389
+ <field name="value">りんご</field>
390
+ </shadow>
391
+ </value>
392
+ <value name="value2">
393
+ <shadow type="input">
394
+ <field name="value">バナナ</field>
395
+ </shadow>
396
+ </value>
397
+ </block>
398
+ <sep gap="30"></sep>
399
  <block type="place">
400
  <value name="x">
401
  <shadow type="input"></shadow>
 
517
  <script src="https://unpkg.com/blockly/msg/ja.js"></script>
518
  <script src="data.js"></script>
519
  <script src="func.js"></script>
520
+ <script src="eel.js"></script>
521
  <script src="script.js"></script>
522
  </body>
523
 
public/mmp4.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5e79821c3e65e85abf1c6eb8a45cf9143d6844f15e2402f080cd06de018af428
3
- size 11143447
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c631bc11a539f9cfa027d2682c42bafbeb9a928f75978d7d83234c4b1f7e487a
3
+ size 11144356
public/script.js CHANGED
@@ -105,6 +105,7 @@ const reloadCos = () => {
105
 
106
  const addCos = () => {
107
  const file = document.createElement(`input`);
 
108
  file.type = `file`;
109
  file.click();
110
  file.addEventListener(`change`, () => {
 
105
 
106
  const addCos = () => {
107
  const file = document.createElement(`input`);
108
+ file.accept = `.png`;
109
  file.type = `file`;
110
  file.click();
111
  file.addEventListener(`change`, () => {