Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev to prepare 260 #6587

Merged
merged 18 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions nekoyume/Assets/Editor/AvatarAddressQueryEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using Libplanet.Action.State;
using Libplanet.Crypto;
using Nekoyume;
using Nekoyume.Model.EnumType;
using Nekoyume.Model.State;
using UnityEditor;
using UnityEngine;

namespace Editor
{
public class AvatarAddressQueryEditor : EditorWindow
{
private static string _avatarAddress;
private static string _avatarQuery;
private static string _inventoryQuery;
private static string _allRuneQuery;
private static string _runeSlotQuery;
private static string _collectionQuery;

[MenuItem("Tools/Show AvatarAddressQuery Editor")]
private static void Init()
{
_avatarAddress = string.Empty;
var window = GetWindow(typeof(AvatarAddressQueryEditor));
window.Show();
}

private void OnGUI()
{
GUILayout.Label("아바타 주소로 시뮬레이션에 필요한 상태를 가져오는 쿼리를 생성해줍니다.");
_avatarAddress = EditorGUILayout.TextField("avatar address: ", _avatarAddress);
if (GUILayout.Button("try to generate gql"))
{
Debug.Log("Trying...");
const string query =
"state(accountAddress:\"{0}\", address:\"{1}\")";
_avatarQuery = $"query {{ {string.Format(format: query, Addresses.Avatar.ToString(), _avatarAddress)} }}";
_inventoryQuery = $"query {{ {string.Format(format: query, Addresses.Inventory.ToString(), _avatarAddress)} }}";
_allRuneQuery = $"query {{ {string.Format(format: query, Addresses.RuneState.ToString(), _avatarAddress)} }}";
_runeSlotQuery = $"query {{ {string.Format(format: query, ReservedAddresses.LegacyAccount.ToString(), RuneSlotState.DeriveAddress(new Address(_avatarAddress), BattleType.Arena))} }}";
_collectionQuery = $"query {{ {string.Format(format: query, Addresses.Collection.ToString(), _avatarAddress)} }}";
}

CopyableLabelField("avatar state: ", _avatarQuery);
CopyableLabelField("inventory state: ", _inventoryQuery);
CopyableLabelField("all rune state: ", _allRuneQuery);
CopyableLabelField("rune slot state: ", _runeSlotQuery);
CopyableLabelField("collection state: ", _collectionQuery);
}

private static void CopyableLabelField(string label, string value)
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField(label, value);
var icon = EditorGUIUtility.IconContent("clipboard", "Copy to clipboard");
if (GUILayout.Button(icon, GUILayout.ExpandWidth(false)))
{
EditorGUIUtility.systemCopyBuffer = value;
}

EditorGUILayout.EndHorizontal();
}
}
}
3 changes: 3 additions & 0 deletions nekoyume/Assets/Editor/AvatarAddressQueryEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_allrune1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/serialized_allrune1.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_allrune2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/serialized_allrune2.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_avatar1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/serialized_avatar1.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_avatar2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/serialized_avatar2.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_collection1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@


Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_collection2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@


Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_inventory1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@


Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_inventory2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@


Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot1.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions nekoyume/Assets/StreamingAssets/serialized_runeslot2.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading