Skip to content

Commit 98af804

Browse files
author
REME
committed
2026-04-04 怪物
1 parent 85ed301 commit 98af804

10 files changed

Lines changed: 419 additions & 33 deletions

File tree

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

55
```csharp
6-
[ModInitializer("Init")]
7-
public class Entry
6+
public enum FjordMosaicMode
87
{
9-
public static void Init()
10-
{
11-
ModConfigRegistry.Register("test", new ModConfig());
12-
}
8+
Alpha,
9+
Beta,
10+
Gamma
1311
}
1412

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

2360
![示例配置](../../../images/image12.png)
2461

25-
更多请参考`baselib``BaseLibConfig`
62+
更多请参考`baselib``BaseLib.Config`下的类

Basics/03 - BaseLib接口/06 - 添加新药水/README.md

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

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

3738
// 打出时的效果逻辑,这里是创造3张灵魂到手牌中。
3839
protected override async Task OnUse(PlayerChoiceContext choiceContext, Creature? target)

Basics/03 - BaseLib接口/07 - 添加先古之民/README.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,20 +119,20 @@ group_uniforms Layout;
119119
uniform float vertical_mix : hint_range(0.0, 1.0, 0.01) = 0.22;
120120
121121
void fragment() {
122-
float t = TIME / max(cycle_seconds, 0.001);
123-
float w_ab = sin(t * TAU) * 0.5 + 0.5;
124-
float w_c = sin(t * TAU + phase_offset) * 0.5 + 0.5;
125-
vec3 rgb = mix(color_a.rgb, color_b.rgb, w_ab);
126-
rgb = mix(rgb, color_c.rgb, w_c);
127-
128-
float v = clamp(UV.y, 0.0, 1.0);
129-
vec3 top_bias = mix(rgb, color_a.rgb, (1.0 - v) * vertical_mix);
130-
vec3 bot_bias = mix(top_bias, color_b.rgb, v * vertical_mix);
131-
rgb = bot_bias;
132-
133-
vec4 tex = texture(TEXTURE, UV);
134-
vec4 out_c = vec4(rgb, color_a.a * tex.a) * tex * COLOR;
135-
COLOR = out_c;
122+
float t = TIME / max(cycle_seconds, 0.001);
123+
float w_ab = sin(t * TAU) * 0.5 + 0.5;
124+
float w_c = sin(t * TAU + phase_offset) * 0.5 + 0.5;
125+
vec3 rgb = mix(color_a.rgb, color_b.rgb, w_ab);
126+
rgb = mix(rgb, color_c.rgb, w_c);
127+
128+
float v = clamp(UV.y, 0.0, 1.0);
129+
vec3 top_bias = mix(rgb, color_a.rgb, (1.0 - v) * vertical_mix);
130+
vec3 bot_bias = mix(top_bias, color_b.rgb, v * vertical_mix);
131+
rgb = bot_bias;
132+
133+
vec4 tex = texture(TEXTURE, UV);
134+
vec4 out_c = vec4(rgb, color_a.a * tex.a) * tex * COLOR;
135+
COLOR = out_c;
136136
}
137137
"
138138
@@ -190,8 +190,4 @@ offset_right = 1044.0
190190
offset_bottom = 515.0
191191
texture = ExtResource("1_xjdov")
192192
193-
[node name="ColorRect" type="ColorRect" parent="."]
194-
layout_mode = 0
195-
offset_right = 217.0
196-
offset_bottom = 248.0
197193
```

Basics/03 - BaseLib接口/10 - mod联动/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,11 @@ public static class TestInterop
4545
}
4646
```
4747

48-
然后在合适的时机调用即可:`TestInterop.Register("JustAnotherModId");`
48+
然后在合适的时机调用即可:
49+
50+
```csharp
51+
if (ModManager.GetLoadedMods().Any(m => string.Equals(m.manifest?.id, "test")))
52+
{
53+
TestInterop.Register("JustAnotherModId");
54+
}
55+
```

0 commit comments

Comments
 (0)