Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

53
LINES

< > BotCompany Repo | #1025011 // Standalone_OSWithSplashScreens

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (13491L/91K).

set flag hotwire_here.

sclass Standalone_OSWithSplashScreens {
  S programName = "Unknown Program"; // doubles as virtualDirName
  S virtualDirName;
  S backgroundID = #1102649;
  S osID = #1016478; // version of Stefan's OS to use
  S mainIconID = #1102666;
  bool showTopInput = true;
  transient Runnable additionalUnpacking;
  transient bool standalone = true;
  
  S virtualDirName() { ret or2(virtualDirName, programName); }
  
  // name / module lib ID / name / module lib ID / ...
  new LS mainModules;
  LS helperModules = ll("Task Bar", "#1019954/TaskBar_dev");
  
  void run(S[] args) pcall {
    if (standalone && javaXStandalone_init(args, noConsole := true)) {
      print("exiting");
      ret;
    }
  
    autoVMExit();
    try {
      // TODO: shouldn't we call standalone_start2 first? it sets the resource loader which we need for loading the background image!
      temp tempWindow(standardSplashScreen(backgroundID, programName + " Loading"));
      ret if standalone_start2(standalone, programName, osID, virtualDirName());
      
      zip2dir_withPredicate_overwriteIfDifferentSize(getMainJarLocation(),
        actualUserDir("JavaX-Caches/#1002203"),
        //getCacheProgramDir("#1002203"), // x30.hotwire doesn't find this
          s -> regexpMatches(md5Regexp() + "\\.jar", s));
  
      callF(additionalUnpacking);
      
      saveTextFile(stefansOS_backgroundFile(), backgroundID);
      standalone_runOSWithInitialModules(osID,
        concatLists(oddEntries(mainModules), oddEntries(helperModules)),
        osParams := litparams(
          onStart := voidfunc(O os) { setOpt(os, minLoadScreenShowingTime := 20.0); },
          hideFeatures := stefansOS_technicalFeatures(),
          standardModules := mainModules,
          botName := "",
          osName := programName,
          +showTopInput,
          +mainIconID,
          shutdownConsole := r { standardSplashScreen(backgroundID, programName + " Shutting Down") },
      ));
    } catch print e { showConsole(); }
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1025011
Snippet name: Standalone_OSWithSplashScreens
Eternal ID of this version: #1025011/16
Text MD5: dc5af47373236face28e190193440f8b
Transpilation MD5: 612749bd826b4111923e1ef2b37c458c
Author: stefan
Category: javax / automation
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-05-24 13:34:52
Source code size: 2069 bytes / 53 lines
Pitched / IR pitched: No / No
Views / Downloads: 1239 / 1684
Version history: 15 change(s)
Referenced in: [show references]