2025-02-12 16:48:15 +00:00
|
|
|
|
|
|
|
|
using Godot;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
namespace Rokojori
|
|
|
|
|
{
|
|
|
|
|
public enum AppPlatformOS
|
|
|
|
|
{
|
|
|
|
|
Windows,
|
|
|
|
|
MacOS,
|
|
|
|
|
iOS,
|
|
|
|
|
Android,
|
|
|
|
|
MetaHorizonOS,
|
|
|
|
|
Switch,
|
|
|
|
|
Switch2,
|
|
|
|
|
PS4,
|
|
|
|
|
PS5,
|
|
|
|
|
XBoxOne,
|
|
|
|
|
XBoxSeriesXS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum AppLauncher
|
|
|
|
|
{
|
|
|
|
|
Native,
|
|
|
|
|
Steam,
|
|
|
|
|
Epic,
|
|
|
|
|
Web
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Tool]
|
2025-08-31 06:05:39 +00:00
|
|
|
[GlobalClass,Icon("res://addons/rokojori_action_library/Icons/App.svg")]
|
2025-02-12 16:48:15 +00:00
|
|
|
public partial class App: Node
|
|
|
|
|
{
|
|
|
|
|
[Export]
|
|
|
|
|
public AppPlatformOS os;
|
|
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
|
public AppLauncher launcher;
|
|
|
|
|
|
2026-02-26 14:06:27 +00:00
|
|
|
[Export]
|
|
|
|
|
public AppSettings settings;
|
|
|
|
|
|
|
|
|
|
[Export]
|
|
|
|
|
public Action onAppStart;
|
|
|
|
|
|
|
|
|
|
Dictionary<string,string> _settingsData = new Dictionary<string, string>();
|
|
|
|
|
public Dictionary<string,string> GetAppSettingsData() =>_settingsData;
|
|
|
|
|
|
|
|
|
|
public string GetSetting( AppSetting appSetting )
|
|
|
|
|
{
|
|
|
|
|
return _settingsData.ContainsKey( appSetting.id ) ? _settingsData[ appSetting.id ] : appSetting.GetDefaultValue();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string GetSetting( string id )
|
|
|
|
|
{
|
|
|
|
|
return _settingsData.ContainsKey( id ) ? _settingsData[ id ] : null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetSetting( string id, string value )
|
|
|
|
|
{
|
|
|
|
|
// this.LogInfo( "Set setting:", id, value );
|
|
|
|
|
_settingsData[ id ] = value;
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-12 16:48:15 +00:00
|
|
|
int _fps = 60;
|
2025-03-13 16:19:28 +00:00
|
|
|
|
|
|
|
|
public int x = 0;
|
|
|
|
|
|
2025-02-12 16:48:15 +00:00
|
|
|
[Export]
|
|
|
|
|
public int fps
|
|
|
|
|
{
|
|
|
|
|
get => _fps;
|
|
|
|
|
set { _fps = value; Engine.MaxFps = _fps; }
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 14:06:27 +00:00
|
|
|
public override void _Ready()
|
|
|
|
|
{
|
|
|
|
|
if ( Engine.IsEditorHint() )
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onAppStart?.Trigger();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2025-02-12 16:48:15 +00:00
|
|
|
}
|
|
|
|
|
}
|