Skip to content

Commit

Permalink
ver_20190914.13
Browse files Browse the repository at this point in the history
  • Loading branch information
FEBuilderGBA committed Sep 14, 2019
1 parent 005f2ce commit 1407ec1
Show file tree
Hide file tree
Showing 20 changed files with 190 additions and 5 deletions.
4 changes: 4 additions & 0 deletions FEBuilderGBA/EventScript.cs
Expand Up @@ -93,6 +93,7 @@ public enum ArgType
, FSEC //フレーム秒
, TILE //マップのタイル名
, SUPPORT_LEVEL //支援レベル
, GAMEOPTION //ゲームオプション
};

public class Arg
Expand Down Expand Up @@ -660,6 +661,9 @@ public static void ParseInfoString(string infostring, char symbol, out ArgType t
case "SUPPORT_LEVEL":
type = ArgType.SUPPORT_LEVEL;
break;
case "GAMEOPTION":
type = ArgType.GAMEOPTION;
break;
case "RAM_UNIT_PARAM":
type = ArgType.RAM_UNIT_PARAM;
break;
Expand Down
13 changes: 9 additions & 4 deletions FEBuilderGBA/EventScriptForm.cs
Expand Up @@ -1357,19 +1357,24 @@ public static Size DrawCode(ListBox lb, Graphics g, Rectangle listbounds, bool i
else if (arg.Type == EventScript.ArgType.POINTER_AITILE)
{
isENumText = true;
text = AITilesForm.GetNames(v);
text = " " + AITilesForm.GetNames(v);
}
else if (arg.Type == EventScript.ArgType.TILE)
{
isENumText = true;
text = MapTerrainNameForm.GetNameExcept00(v);
text = " " + MapTerrainNameForm.GetNameExcept00(v);
}
else if (arg.Type == EventScript.ArgType.SUPPORT_LEVEL)
{
isENumText = true;
text = InputFormRef.GetSuportLevel(v);
text = " " + InputFormRef.GetSuportLevel(v);
}

else if (arg.Type == EventScript.ArgType.GAMEOPTION)
{
isENumText = true;
text = " " + StatusOptionForm.GetNameIndex(v);
}

if (isENumText)
{
bounds.X += U.DrawText(text, g, boldFont, brush, isWithDraw, bounds);
Expand Down
20 changes: 19 additions & 1 deletion FEBuilderGBA/EventScriptInnerControl.cs
Expand Up @@ -993,6 +993,11 @@ private void ParamSrc_ValueChanged(object sender, EventArgs e)
{
text = " " + InputFormRef.GetSuportLevel(v);
}
else if (arg.Type == EventScript.ArgType.GAMEOPTION)
{
image = StatusOptionForm.DrawIcon(v);
text = " " + StatusOptionForm.GetNameIndex(v);
}
else if (arg.Type == EventScript.ArgType.None)
{//10進数表記を書いてやる.
text = " " + InputFormRef.GetDigitHint(v);
Expand Down Expand Up @@ -1297,14 +1302,22 @@ private void ParamLabel_Clicked(object sender, EventArgs e)
f.JumpTo(value, MakeAddressListFlagExpandsCallback_Handler(src_object) , this.MapID);
}
else if (arg.Type == EventScript.ArgType.RAM_UNIT_STATE)
{//RAM_UNIT_STATE
{
RAMUnitStateFlagForm f = (RAMUnitStateFlagForm)InputFormRef.JumpForm<RAMUnitStateFlagForm>(U.NOT_FOUND);
f.JumpTo(value);
MakeInjectionApplyButtonCallback(f
, (Button)InputFormRef.FindObjectByForm<Button>
(InputFormRef.GetAllControls(f), "ApplyButton")
, src_object);
}
else if (arg.Type == EventScript.ArgType.GAMEOPTION)
{
StatusOptionForm f = (StatusOptionForm)InputFormRef.JumpForm<StatusOptionForm>();
MakeInjectionCallback(f
, (ListBox)InputFormRef.FindObjectByForm<ListBox>
(InputFormRef.GetAllControls(f), "AddressList")
, src_object, false);
}
}

EventHandler MakeAddressListExpandsCallback_Handler(NumericUpDown injectionCallback)
Expand Down Expand Up @@ -2675,6 +2688,11 @@ private string EventToTextOne(int number)
sb.Append(" ");
sb.Append(InputFormRef.GetSuportLevel(v));
}
else if (arg.Type == EventScript.ArgType.GAMEOPTION)
{
sb.Append(" ");
sb.Append(StatusOptionForm.GetNameIndex(v));
}

sb.Append("]");
break;
Expand Down
4 changes: 4 additions & 0 deletions FEBuilderGBA/bin/Debug/config/data/asmmap_FE8.en.txt
Expand Up @@ -12592,3 +12592,7 @@ r3=X tile position of menu of right {U}
0809EB38 CallSupply1 {U}
0809EB58 CallSupply2 {U}
08A92410 &LZ77 Some TSA data. 1 {J}
080B6B7C SetGameOption r0=OptionIndex r1=OptionValue {J}
080B1F64 SetGameOption r0=OptionIndex r1=OptionValue {U}
080B6A00 GetGameOption RET=OptionValue r0=OptionIndex {J}
080B1DE8 GetGameOption RET=OptionValue r0=OptionIndex {U}
4 changes: 4 additions & 0 deletions FEBuilderGBA/bin/Debug/config/data/asmmap_FE8.txt
Expand Up @@ -12590,3 +12590,7 @@
08050E40 LoadHPBarImage {U}
0809EB38 CallSupply1 {U}
0809EB58 CallSupply2 {U}
080B6B7C SetGameOption r0=OptionIndex r1=OptionValue {J}
080B1F64 SetGameOption r0=OptionIndex r1=OptionValue {U}
080B6A00 GetGameOption RET=OptionValue r0=OptionIndex {J}
080B1DE8 GetGameOption RET=OptionValue r0=OptionIndex {U}
4 changes: 4 additions & 0 deletions FEBuilderGBA/bin/Debug/config/data/asmmap_FE8.zh.txt
Expand Up @@ -12547,3 +12547,7 @@ r3=X tile position of menu of the right {U}
0809EB38 CallSupply1 {U}
0809EB58 CallSupply2 {U}
08A92410 &LZ77 一些TSA数据。 1 {J}
080B6B7C SetGameOption r0=OptionIndex r1=OptionValue {J}
080B1F64 SetGameOption r0=OptionIndex r1=OptionValue {U}
080B6A00 GetGameOption RET=OptionValue r0=OptionIndex {J}
080B1DE8 GetGameOption RET=OptionValue r0=OptionIndex {U}
Binary file not shown.
@@ -0,0 +1,23 @@
@
@ゲームオプションの取得
@
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
.thumb

push {lr}
ldr r3, [r0, #0x38] @イベント命令にアクセスらしい [r0,#0x38] でイベント命令が書いてあるアドレスの場所へ

ldrb r0, [r3, #0x2] @引数1 [game option]
blh 0x080B6A00 @GetGameOption RET=OptionValue r0=OptionIndex {J}
@blh 0x080B1DE8 @GetGameOption RET=OptionValue r0=OptionIndex {U}

ldr r2, =0x030004B0 @MemorySlot {J}
@ldr r2, =0x030004B8 @MemorySlot {U}
str r0, [r2, #0x30] @SlotCに結果を書き込む

pop {r0}
bx r0
Binary file not shown.
@@ -0,0 +1,20 @@
@
@ゲームオプションの設定
@
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
.thumb

push {lr}
ldr r3, [r0, #0x38] @イベント命令にアクセスらしい [r0,#0x38] でイベント命令が書いてあるアドレスの場所へ

ldrb r0, [r3, #0x2] @引数1 [game option]
ldrb r1, [r3, #0x3] @引数2 [option new value]
blh 0x080B6B7C @SetGameOption r0=OptionIndex r1=OptionValue {J}
@blh 0x080B1F64 @SetGameOption r0=OptionIndex r1=OptionValue {U}

pop {r0}
bx r0
@@ -0,0 +1,30 @@
NAME=イベント命令からゲームオプションを変更する追加ルーチン
TYPE=BIN
TAG=#EVENT

//既に適応されたかどうか
PATCHED_IF:$FGREP4 ASMC_SetGameOption.dmp=0x00 0xB5 0x83 0x6B

//本体をフリーエリアにいれる.
BIN:$FREEAREA:1=ASMC_GetGameOption.dmp
BIN:$FREEAREA:2=ASMC_SetGameOption.dmp

AUTHOR=7743

INFO=イベント命令から、ゲームオプションの値の取得と、値の設定をできるようにします。\r\n設定する値は、ゲームの設定画面での選択肢の並び順です。\r\n左から0,1,2,3...と数えます。\r\n例えば戦闘アニメオフは、Anime1,Anime2,OFF と並んでいるため、2を設定すると、OFFになります。

EVENTSCRIPT:1=400DXX00{$L1:ASMC_GetGameOption.dmp} ゲームオプションの取得[XX:GAMEOPTION:Option] {COND}
EVENTSCRIPT:5=400DXXYY{$L1:ASMC_SetGameOption.dmp} ゲームオプションの設定[XX:GAMEOPTION:Option][YY::NewValue]

NAME.en=Add Event: GetGameOption,SetGameOption
INFO.en=Change game options from event script.\r\nThe value to set is the order of choices on the game settings screen.\r\nCount as 0,1,2,3 ... from the left.\r\nFor example, battle animation off is aligned with Anime1, Anime2, OFF, so setting 2 turns it off.

EVENTSCRIPT:1.en=400DXX00{$L1:ASMC_GetGameOption.dmp} GetGameOption[XX:GAMEOPTION:Option] {COND}
EVENTSCRIPT:5.en=400DXXYY{$L1:ASMC_SetGameOption.dmp} SetGameOption[XX:GAMEOPTION:Option][YY::NewValue]

NAME.zh=Add Event: GetGameOption,SetGameOption
INFO.zh=Change game options from event script.\r\nThe value to set is the order of choices on the game settings screen.\r\nCount as 0,1,2,3 ... from the left.\r\nFor example, battle animation off is aligned with Anime1, Anime2, OFF, so setting 2 turns it off.


EVENTSCRIPT:1.zh=400DXX00{$L1:ASMC_GetGameOption.dmp} GetGameOption[XX:GAMEOPTION:Option] {COND}
EVENTSCRIPT:5.zh=400DXXYY{$L1:ASMC_SetGameOption.dmp} SetGameOption[XX:GAMEOPTION:Option][YY::NewValue]
Binary file not shown.
@@ -0,0 +1,23 @@
@
@ゲームオプションの取得
@
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
.thumb

push {lr}
ldr r3, [r0, #0x38] @イベント命令にアクセスらしい [r0,#0x38] でイベント命令が書いてあるアドレスの場所へ

ldrb r0, [r3, #0x2] @引数1 [game option]
@blh 0x080B6A00 @GetGameOption RET=OptionValue r0=OptionIndex {J}
blh 0x080B1DE8 @GetGameOption RET=OptionValue r0=OptionIndex {U}

@ldr r2, =0x030004B0 @MemorySlot {J}
ldr r2, =0x030004B8 @MemorySlot {U}
str r0, [r2, #0x30] @SlotCに結果を書き込む

pop {r0}
bx r0
Binary file not shown.
@@ -0,0 +1,20 @@
@
@ゲームオプションの設定
@
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endm
.thumb

push {lr}
ldr r3, [r0, #0x38] @イベント命令にアクセスらしい [r0,#0x38] でイベント命令が書いてあるアドレスの場所へ

ldrb r0, [r3, #0x2] @引数1 [game option]
ldrb r1, [r3, #0x3] @引数2 [option new value]
@blh 0x080B6B7C @SetGameOption r0=OptionIndex r1=OptionValue {J}
blh 0x080B1F64 @SetGameOption r0=OptionIndex r1=OptionValue {U}

pop {r0}
bx r0
@@ -0,0 +1,30 @@
NAME=イベント命令からゲームオプションを変更する追加ルーチン
TYPE=BIN
TAG=#EVENT

//既に適応されたかどうか
PATCHED_IF:$FGREP4 ASMC_SetGameOption.dmp=0x00 0xB5 0x83 0x6B

//本体をフリーエリアにいれる.
BIN:$FREEAREA:1=ASMC_GetGameOption.dmp
BIN:$FREEAREA:2=ASMC_SetGameOption.dmp

AUTHOR=7743

INFO=イベント命令から、ゲームオプションの値の取得と、値の設定をできるようにします。\r\n設定する値は、ゲームの設定画面での選択肢の並び順です。\r\n左から0,1,2,3...と数えます。\r\n例えば戦闘アニメオフは、Anime1,Anime2,OFF と並んでいるため、2を設定すると、OFFになります。

EVENTSCRIPT:1=400DXX00{$L1:ASMC_GetGameOption.dmp} ゲームオプションの取得[XX:GAMEOPTION:Option] {COND}
EVENTSCRIPT:5=400DXXYY{$L1:ASMC_SetGameOption.dmp} ゲームオプションの設定[XX:GAMEOPTION:Option][YY::NewValue]

NAME.en=Add Event: GetGameOption,SetGameOption
INFO.en=Change game options from event script.\r\nThe value to set is the order of choices on the game settings screen.\r\nCount as 0,1,2,3 ... from the left.\r\nFor example, battle animation off is aligned with Anime1, Anime2, OFF, so setting 2 turns it off.

EVENTSCRIPT:1.en=400DXX00{$L1:ASMC_GetGameOption.dmp} GetGameOption[XX:GAMEOPTION:Option] {COND}
EVENTSCRIPT:5.en=400DXXYY{$L1:ASMC_SetGameOption.dmp} SetGameOption[XX:GAMEOPTION:Option][YY::NewValue]

NAME.zh=Add Event: GetGameOption,SetGameOption
INFO.zh=Change game options from event script.\r\nThe value to set is the order of choices on the game settings screen.\r\nCount as 0,1,2,3 ... from the left.\r\nFor example, battle animation off is aligned with Anime1, Anime2, OFF, so setting 2 turns it off.


EVENTSCRIPT:1.zh=400DXX00{$L1:ASMC_GetGameOption.dmp} GetGameOption[XX:GAMEOPTION:Option] {COND}
EVENTSCRIPT:5.zh=400DXXYY{$L1:ASMC_SetGameOption.dmp} SetGameOption[XX:GAMEOPTION:Option][YY::NewValue]

0 comments on commit 1407ec1

Please sign in to comment.