Lua: Add PLATFORM global var to distinguish between desktop and mobile builds
authorWuzzy <Wuzzy2@mail.ru>
Wed, 17 Oct 2018 05:33:02 +0200
changeset 13938 429945a9b8db
parent 13937 7bb60596c27e
child 13939 9c112f2ae02d
Lua: Add PLATFORM global var to distinguish between desktop and mobile builds
ChangeLog.txt
hedgewars/uScript.pas
--- a/ChangeLog.txt	Wed Oct 17 05:34:29 2018 +0300
+++ b/ChangeLog.txt	Wed Oct 17 05:33:02 2018 +0200
@@ -169,6 +169,7 @@
  + New global: MAX_HOG_HEALTH. Maximum possible hedgehog health
  + New global: MAX_TURN_TIME. Maximum possible turn time
  + New global: EXPLForceDraw. Flag for Explode function, forces land removal even with gfSolidLand on
+ + New global: PLATFORM. Platform type. "Desktop" for desktop builds, "Mobile" for mobile device builds
  + New globals: capcolDefault, capcolSetting: Default caption colors
  * Animate library: Remove defunct follow argument for AnimVisualGear
  * Changed global: lfCurrentHog becomes lfCurHogCrate
--- a/hedgewars/uScript.pas	Wed Oct 17 05:34:29 2018 +0300
+++ b/hedgewars/uScript.pas	Wed Oct 17 05:33:02 2018 +0200
@@ -3970,6 +3970,12 @@
 // import some variables
 ScriptSetString(_S'LOCALE', cLocale);
 
+{$IFDEF MOBILE}
+ScriptSetString(_S'PLATFORM', 'Mobile');
+{$ELSE}
+ScriptSetString(_S'PLATFORM', 'Desktop');
+{$ENDIF}
+
 // Add aliases for amDuck and gtDuck because rubber duck was removed.
 // amDuck and gtDuck are deprecated and should be removed later.
 // TODO: Remove these aliases in a later version.