Skip to content

Commit f8930fc

Browse files
author
REME
committed
2026-04-04 sync
1 parent 98af804 commit f8930fc

11 files changed

Lines changed: 416 additions & 23 deletions

_config.kira.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ docsTree:
8181
title: 10 mod联动,
8282
path: /docs/03-10-mod-integration/,
8383
},
84+
{
85+
title: 11 添加新怪物,
86+
path: /docs/03-11-add-monster/,
87+
},
8488
],
8589
},
8690
{ title: 04 添加新人物, path: /docs/04-add-new-character/ },

source/_posts/02-install-view-source-and-patch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: 02 准备工作
2+
title: 02 常见问题
33
date: 2026-03-15 00:00:00
44
permalink: docs/02-install-view-source-and-patch/
55
categories:

source/_posts/03-02-mod-config.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,65 @@ categories:
66
- Basics
77
---
88
* 要使用此功能,需要先放一张图片到`{modId}\mod_image.png`作为mod图标,尺寸任意,否则会由于报错不显示配置。
9-
* 添加一个继承`SimpleModConfig`(或者是`ModConfig`如果你想要更复杂的设置)的类,在其中添加`public static bool`变量。支持`bool``double``enum``int``string`
9+
* 添加一个继承`SimpleModConfig`(或者是`ModConfig`如果你想要更复杂的设置)的类,在其中添加`public static bool`变量。支持`bool``double``enum``string`
1010
* 在初始化函数调用`ModConfigRegistry.Register`。字符串写你的`modId`
1111

1212
```csharp
13-
[ModInitializer("Init")]
14-
public class Entry
13+
public enum FjordMosaicMode
1514
{
16-
public static void Init()
17-
{
18-
ModConfigRegistry.Register("test", new ModConfig());
19-
}
15+
Alpha,
16+
Beta,
17+
Gamma
2018
}
2119

22-
public class ModConfig : SimpleModConfig
20+
[HoverTipsByDefault]
21+
public sealed class TestModConfig : SimpleModConfig
2322
{
24-
public static bool Test1 { get; set; } = true;
25-
public static bool Test2 { get; set; } = false;
26-
public static bool Test3 { get; set; } = true;
23+
[ConfigSection("NimbusWard")]
24+
public static bool WobbleVexFlag { get; set; } = true;
25+
26+
public static double PlinthKiteVolume { get; set; } = 2.5;
27+
28+
[SliderRange(-12.5, 88, 0.25)]
29+
[SliderLabelFormat("{0:0.##}")]
30+
[ConfigHoverTip]
31+
public static double MothBanjoBias { get; set; } = 14;
32+
33+
[ConfigSection("HarborTokens")]
34+
[ConfigTextInput(TextInputPreset.SafeDisplayName)]
35+
public static string GlintHarborAlias { get; set; } = "rift_op";
36+
37+
[ConfigTextInput("[A-Z0-9_]+")]
38+
public static string KiteVaultCode { get; set; } = "X9";
39+
40+
public static FjordMosaicMode CruxEnumPick { get; set; } = FjordMosaicMode.Beta;
41+
42+
[ConfigHoverTip(false)]
43+
public static bool SilentSporeGate { get; set; }
44+
45+
[ConfigIgnore]
46+
public static double OrphanLedgerAmt { get; set; } = -1;
47+
48+
[ConfigHideInUI]
49+
public static string NimbusVaultToken { get; set; } = "";
50+
51+
[ConfigButton("QrkvVaultPing")]
52+
public static void OnVaultPing(ModConfig cfg, NConfigOptionRow row)
53+
{
54+
_ = cfg;
55+
_ = row;
56+
}
57+
58+
[ConfigButton("QrkvRowClear")]
59+
public void OnRowClear(NConfigButton btn)
60+
{
61+
_ = btn;
62+
}
2763
}
64+
2865
```
2966

3067
![示例配置](../../images/image12.png)
3168

32-
更多请参考`baselib``BaseLibConfig`
69+
更多请参考`baselib``BaseLib.Config`下的类
3370

source/_posts/03-06-add-potion.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ public class TestPotion : CustomPotionModel
3838
// 这里显示预览卡牌灵魂。或者你可以添加提示关键词
3939
public override IEnumerable<IHoverTip> ExtraHoverTips => [HoverTipFactory.FromCard<Soul>()];
4040

41-
public override string? PackedImagePath => "res://icon.svg";
42-
public override string? PackedOutlinePath => "res://icon.svg";
41+
// 药水图片。不一定svg,只要最终能变成Texture的格式就行。
42+
public override string? CustomPackedImagePath => "res://icon.svg";
43+
public override string? CustomPackedOutlinePath => "res://icon.svg";
4344

4445
// 打出时的效果逻辑,这里是创造3张灵魂到手牌中。
4546
protected override async Task OnUse(PlayerChoiceContext choiceContext, Creature? target)
@@ -57,4 +58,4 @@ public class TestPotion : CustomPotionModel
5758
"TEST-TEST_POTION.title": "戈多药水",
5859
"TEST-TEST_POTION.description": "将[blue]{Cards}[/blue]张[gold]灵魂[/gold]加入你的[gold]手牌[/gold]。"
5960
}
60-
```
61+
```

source/_posts/03-07-add-ancient.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,4 @@ offset_right = 1044.0
197197
offset_bottom = 515.0
198198
texture = ExtResource("1_xjdov")
199199
200-
[node name="ColorRect" type="ColorRect" parent="."]
201-
layout_mode = 0
202-
offset_right = 217.0
203-
offset_bottom = 248.0
204-
```
205-
200+
```

source/_posts/03-10-mod-integration.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,11 @@ public static class TestInterop
5252
}
5353
```
5454

55-
然后在合适的时机调用即可:`TestInterop.Register("JustAnotherModId");`
55+
然后在合适的时机调用即可:
56+
57+
```csharp
58+
if (ModManager.GetLoadedMods().Any(m => string.Equals(m.manifest?.id, "test")))
59+
{
60+
TestInterop.Register("JustAnotherModId");
61+
}
62+
```

0 commit comments

Comments
 (0)