Skip to content

Commit

Permalink
kurone-kito/implement-new-prefabsからプルリクエスト#6をマージする
Browse files Browse the repository at this point in the history
v0.4.0: Added some UI prefabs and cumulative updates
  • Loading branch information
kurone-kito authored May 31, 2024
2 parents b4c6cc9 + 6771616 commit 196d5b3
Show file tree
Hide file tree
Showing 144 changed files with 39,343 additions and 7,142 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/Assets/UdonSharp/** linguist-vendored
/Assets/** linguist-vendored
/Packages/*.json linguist-vendored
/Packages/com.*/** linguist-vendored
/Packages/dev.*/** linguist-vendored
Expand All @@ -15,3 +15,4 @@
.github export-ignore
.gitignore export-ignore
.gitkeep export-ignore
.imgbotconfig export-ignore
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Language: [🇬🇧](./CONTRIBUTING.md) | [🇯🇵](./CONTRIBUTING.ja.md) | **

---

1. 请注意我们有[行为准则](./CODE_OF_CONDUCT.ja.md),请在与项目的所有互动中遵循。
1. 请注意我们有[行为准则](./CODE_OF_CONDUCT.zh.md),请在与项目的所有互动中遵循。
2. 在为此存储库做出贡献时,请首先在进行更改之前与该存储库的所有者讨论您希望通过问题或任何其他方法进行的更改。
3. 如果您的想法可以通过**小修复显示,请直接使用[拉取请求](https://github.com/kurone-kito/vrc-ui/pulls)**
- 本版本库有时会在拉取请求和发布之间建立一对一的绑定关系,但这并**不是必须的**。我们欢迎您的拉取请求。
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build-listing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ on:
types:
- completed
release:
types:
- created
- deleted
- edited
- published
- released
- unpublished
types:
- created
- deleted
- edited
- published
- released
- unpublished

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
Expand All @@ -28,7 +28,7 @@ permissions:

# Allow one concurrent deployment
concurrency:
group: "pages"
group: pages
cancel-in-progress: true

jobs:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ jobs:
outputs:
config_package: ${{ steps.config_package.outputs.configPackage }}
steps:
- name: Ensure that required repository variable has been created for the Package
id: config_package
run: |
if [ "${{ vars.PACKAGE_NAME }}" != "" ]; then
echo "configPackage=true" >> $GITHUB_OUTPUT;
else
echo "configPackage=false" >> $GITHUB_OUTPUT;
fi
- name: Ensure that required repository variable has been created for the Package
id: config_package
run: |
if [ "${{ vars.PACKAGE_NAME }}" != "" ]; then
echo "configPackage=true" >> $GITHUB_OUTPUT;
else
echo "configPackage=false" >> $GITHUB_OUTPUT;
fi
build:
needs: config
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .tool-version

This file was deleted.

1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet 6.0.422
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The DEFAULT LICENSE applied is Creative Commons CC BY-NC 4.0.
If you apply the MIT License, please follow one of the following conditions:

1. This project depends on LaunchPad Icons.
(https://github.com/kurone-kito/launchpad-icons)
You should REMOVE this dependency.
2. If the above is not possible, at least implement the LaunchPad Icons so
that you DO NOT EXPOSE LaunchPad Icons on your product.
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@

namespace black.kit.vrcui.Editor
{
/// <summary>The inspector of the <see cref="IconToggle"/>.</summary>
[CustomEditor(typeof(IconToggle))]
public sealed class IconToggleEditor : EditorBase<IconToggle>
/// <summary>The inspector of the <see cref="ImageToggle"/>.</summary>
[CustomEditor(typeof(ImageToggle))]
public sealed class ImageToggleEditor : EditorBase<ImageToggle>
{
/// <summary>The usage of the target.</summary>
private readonly string[] usage = new[]
{
T.USAGE_ICON_TOGGLE_0,
T.USAGE_REGIST_SPRITES,
T.USAGE_ICON_TOGGLE_1,
};

/// <summary>Initialize the editor.</summary>
public IconToggleEditor() : base(L10n.Tr(T.DETAIL_ICON_TOGGLE))
public ImageToggleEditor() : base(L10n.Tr(T.DETAIL_ICON_TOGGLE))
{
}

Expand All @@ -30,18 +30,24 @@ public override void OnInspectorGUI()
var style = defaultStyle.Value;
EditorGUILayout.LabelField(L10n.Tr(T.USAGE_COMPONENT), style);
EditorGUILayout.Space();
DrawList(usage, new ListOptions());
DrawList(
usage,
new ListOptions(ordered: true, tr: (t) => L10n.Tr(t)));
EditorGUILayout.EndVertical();
base.OnInspectorGUI();

serializedObject.Update();
var image = serializedObject
.FindProperty(IconToggle.NAME_IMAGES)
.GetArrayElementAtIndex(1)
.objectReferenceValue as Image;
if (image)
var images = serializedObject.FindProperty(
ImageToggle.NAME_IMAGES);
if (images.arraySize >= 2)
{
image.sprite = GetSprite();
var image = images
.GetArrayElementAtIndex(1)
.objectReferenceValue as Image;
if (image)
{
image.sprite = GetSprite();
}
}
serializedObject.ApplyModifiedProperties();
}
Expand All @@ -51,7 +57,11 @@ public override void OnInspectorGUI()
private Sprite GetSprite()
{
var (sprites, index, _) = GetArrayProperty(
IconToggle.NAME_SPRITES, TypedTarget.Index);
ImageToggle.NAME_SPRITES, TypedTarget.Index);
if (index < 0)
{
return null; // 'sprites' is empty
}
var element = sprites.GetArrayElementAtIndex(index);
return element.objectReferenceValue as Sprite;
}
Expand Down
2 changes: 1 addition & 1 deletion Packages/black.kit.vrcui/Editor/T.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ public static class T
nameof(DETAIL_TOGGLE_WITH_ANIMATION);
public const string USAGE_COMPONENT = nameof(USAGE_COMPONENT);
public const string USAGE_EVENT_TOGGLE = nameof(USAGE_EVENT_TOGGLE);
public const string USAGE_ICON_TOGGLE_0 = nameof(USAGE_ICON_TOGGLE_0);
public const string USAGE_ICON_TOGGLE_1 = nameof(USAGE_ICON_TOGGLE_1);
public const string USAGE_LINK_ANIMATOR = nameof(USAGE_LINK_ANIMATOR);
public const string USAGE_LINK_TOGGLE = nameof(USAGE_LINK_TOGGLE);
public const string USAGE_ON_VALUE_CHANGED =
nameof(USAGE_ON_VALUE_CHANGED);
public const string USAGE_REGIST_SPRITES = nameof(USAGE_REGIST_SPRITES);
public const string USAGE_RUNTIME_ONLY = nameof(USAGE_RUNTIME_ONLY);
public const string USAGE_SEND_CUSTOM_EVENT =
nameof(USAGE_SEND_CUSTOM_EVENT);
Expand Down
6 changes: 3 additions & 3 deletions Packages/black.kit.vrcui/Editor/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ msgstr "For this component to work correctly, please follow these steps:"
msgid "USAGE_EVENT_TOGGLE"
msgstr "Set the following to <b>OnValueChanged (Boolean)</b> of the Toggle component."

msgid "USAGE_ICON_TOGGLE_0"
msgstr "Register the icon image to be switched to in the <b>sprites</b>. Any number of images can be added."

msgid "USAGE_ICON_TOGGLE_1"
msgstr "DO NOT CHANGE the <b>images</b>"

Expand All @@ -32,6 +29,9 @@ msgstr "Deploy this component on the same object as the Toggle component or manu
msgid "USAGE_ON_VALUE_CHANGED"
msgstr "Argument: <b>OnValueChanged</b>"

msgid "USAGE_REGIST_SPRITES"
msgstr "Register the icon image to be switched to in the <b>sprites</b>. Any number of images can be added."

msgid "USAGE_RUNTIME_ONLY"
msgstr "Timing: <b>Runtime Only</b>"

Expand Down
6 changes: 3 additions & 3 deletions Packages/black.kit.vrcui/Editor/ja.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ msgstr "このコンポーネントを正しく動作するために、以下の
msgid "USAGE_EVENT_TOGGLE"
msgstr "Toggleコンポーネントの<b>値の変更時(Boolean)</b>へ、以下を設定してください。"

msgid "USAGE_ICON_TOGGLE_0"
msgstr "<b>sprites</b>に、切り替えるアイコン画像を登録します。いくつでも追加可能です。"

msgid "USAGE_ICON_TOGGLE_1"
msgstr "<b>images</b>は変更しないでください。"

Expand All @@ -32,6 +29,9 @@ msgstr "Toggleコンポーネントと同一のオブジェクトに配置する
msgid "USAGE_ON_VALUE_CHANGED"
msgstr "引数: <b>OnValueChanged</b>"

msgid "USAGE_REGIST_SPRITES"
msgstr "<b>sprites</b>に、切り替えるアイコン画像を登録します。いくつでも追加可能です。"

msgid "USAGE_RUNTIME_ONLY"
msgstr "タイミング: <b>Runtime Only</b>"

Expand Down
Loading

0 comments on commit 196d5b3

Please sign in to comment.