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).

1  
set flag hotwire_here.
2  
3  
sclass Standalone_OSWithSplashScreens {
4  
  S programName = "Unknown Program"; // doubles as virtualDirName
5  
  S virtualDirName;
6  
  S backgroundID = #1102649;
7  
  S osID = #1016478; // version of Stefan's OS to use
8  
  S mainIconID = #1102666;
9  
  bool showTopInput = true;
10  
  transient Runnable additionalUnpacking;
11  
  transient bool standalone = true;
12  
  
13  
  S virtualDirName() { ret or2(virtualDirName, programName); }
14  
  
15  
  // name / module lib ID / name / module lib ID / ...
16  
  new LS mainModules;
17  
  LS helperModules = ll("Task Bar", "#1019954/TaskBar_dev");
18  
  
19  
  void run(S[] args) pcall {
20  
    if (standalone && javaXStandalone_init(args, noConsole := true)) {
21  
      print("exiting");
22  
      ret;
23  
    }
24  
  
25  
    autoVMExit();
26  
    try {
27  
      // TODO: shouldn't we call standalone_start2 first? it sets the resource loader which we need for loading the background image!
28  
      temp tempWindow(standardSplashScreen(backgroundID, programName + " Loading"));
29  
      ret if standalone_start2(standalone, programName, osID, virtualDirName());
30  
      
31  
      zip2dir_withPredicate_overwriteIfDifferentSize(getMainJarLocation(),
32  
        actualUserDir("JavaX-Caches/#1002203"),
33  
        //getCacheProgramDir("#1002203"), // x30.hotwire doesn't find this
34  
          s -> regexpMatches(md5Regexp() + "\\.jar", s));
35  
  
36  
      callF(additionalUnpacking);
37  
      
38  
      saveTextFile(stefansOS_backgroundFile(), backgroundID);
39  
      standalone_runOSWithInitialModules(osID,
40  
        concatLists(oddEntries(mainModules), oddEntries(helperModules)),
41  
        osParams := litparams(
42  
          onStart := voidfunc(O os) { setOpt(os, minLoadScreenShowingTime := 20.0); },
43  
          hideFeatures := stefansOS_technicalFeatures(),
44  
          standardModules := mainModules,
45  
          botName := "",
46  
          osName := programName,
47  
          +showTopInput,
48  
          +mainIconID,
49  
          shutdownConsole := r { standardSplashScreen(backgroundID, programName + " Shutting Down") },
50  
      ));
51  
    } catch print e { showConsole(); }
52  
  }
53  
}

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: 1252 / 1702
Version history: 15 change(s)
Referenced in: [show references]