예제 #1
0
    // Start is called before the first frame update
    public override void Start()
    {
        base.Start();
        UserData.RegisterType <PlatformCode>();

        Table envTable = new Table(Environment);

        luaPlatforms = new List <PlatformCode>();

        for (int i = 0; i < transform.childCount; i++)
        {
            GameObject   g = transform.GetChild(i).gameObject;
            PlatformCode c = new PlatformCode();
            luaPlatforms.Add(c);
            c.Parent = this;
            c.A      = g;

            c.OgLocal   = g.transform.localPosition;
            c.OgLocal.y = ZeroY;
            c.DesiredY  = Mathf.Round(g.transform.localPosition.y - ZeroY);

            DynValue val = UserData.Create(c);
            envTable.Set(i + 1, val);
        }

        Environment.Globals["plats"] = envTable;

        DoStuff();
    }
예제 #2
0
        public void ShowToast(string message, ToastLength length, PlatformCode usingPlatforms = PlatformCode.All)
        {
            if (!usingPlatforms.HasFlag(PlatformCode.Ios))
            {
                return;
            }

            Utilities.Dispatch(async() => {
                var shouldWait = false;

                do
                {
                    lock (_ToastLock)
                    {
                        shouldWait = _HasToast;
                        _HasToast  = true;
                    }

                    if (shouldWait)
                    {
                        await Task.Delay(DialogConstants.TOAST_CHECK_NEXT_DELAY);
                    }
                }while (shouldWait);

                ShowOrUpdateToast(message, length);

                var toastTime = length == ToastLength.Long ? DialogConstants.TOAST_LONG_LENGTH : DialogConstants.TOAST_SHORT_LENGTH;
                await Task.Delay(toastTime / 2);

                lock (_ToastLock)
                {
                    _HasToast = false;
                }
            });
        }
예제 #3
0
 public static string PlatformName(PlatformCode code, bool extended = true)
 {
     return(code switch
     {
         PlatformCode.MacOSClassic => "Mac OS Classic",
         PlatformCode.MacOSX => "Mac OS X",
         PlatformCode.Windows => "Windows",
         _ => "Unknown" + (extended ? " (" + code.ToString() + ")" : ""),
     });
예제 #4
0
        public DockerGame(DockerGame other)
        {
            this.Arguments   = other.Arguments;
            this.Company     = other.Company;
            this.crc_value   = other.crc_value;
            this.Enabled     = other.Enabled;
            this.ErrorCode   = other.ErrorCode;
            this.Executable  = other.Executable;
            this.FolderName  = other.FolderName;
            this.GUID        = other.GUID;
            this.IGDB_Url    = other.IGDB_Url;
            this.Image       = other.Image;
            this.LastCheck   = other.LastCheck;
            this.Name        = other.Name;
            this.Platform    = other.Platform;
            this.ProductName = other.ProductName;
            this.Uri         = other.Uri;
            this.Version     = other.Version;

            this.PowerProfiles = new Dictionary <Guid, PowerProfile>();
            if (other.PowerProfiles != null)
            {
                foreach (PowerProfile profile in other.PowerProfiles.Values)
                {
                    this.PowerProfiles.Add(profile.ProfileGuid, profile);
                }
            }

            this.Settings = new Dictionary <string, GameSettings>();
            if (other.Settings != null)
            {
                foreach (GameSettings settings in other.Settings.Values)
                {
                    this.Settings.Add(settings.FileName, settings);
                }
            }

            this.PowerSpecific = other.PowerSpecific;

            this.SanityCheck();
        }
예제 #5
0
 public void ShowToast(string message, ToastLength length, PlatformCode platformCode = PlatformCode.All)
 {
     throw new NotImplementedException();
 }