chopeks 4 years ago
parent
commit
5fd600c736

+ 2 - 1
.gitignore

@@ -1,4 +1,5 @@
 .gradle/
 .idea/
 build/
-output/
+output/
+GLExtensionsPreProcessor.txt

+ 2 - 1
src/main/kotlin/com/chopeks/glife/GLNpc.kt

@@ -1,4 +1,5 @@
 package com.chopeks.glife
 
-enum class GLNpc {
+enum class GLNpc(val lName: String) {
+  Mom("A29")
 }

+ 1 - 0
src/main/kotlin/com/chopeks/glife/GLifeEnumPreprocessor.kt

@@ -68,6 +68,7 @@ class GLifeEnumPreprocessor : ExternalPreProcessor {
               else -> code.replaceRange(tokens[i - 2]..tokens[j - 1], "\"${clazz.name}\"")
             }
           }
+          GLNpc::class.simpleName -> code.replaceRange(tokens[i - 2]..tokens[i], "\"${GLNpc.valueOf(name).lName}\"")
           else -> {
             try {
               val clazz = Class.forName("com.chopeks.glife." + tokens[i - 2].text).enumConstants as Array<Enum<*>>

+ 5 - 5
src/main/kotlin/com/chopeks/glife/extensions/GLExtensionsPreProcessor.kt

@@ -50,11 +50,11 @@ class GLExtensionsPreProcessor : ExternalPreProcessor {
       val tokens = CommonTokenStream(lexer)
       val parser = KotlinParser(tokens)
 
-      val log = File("GLExtensionsPreProcessor.txt")
-      log.writeText("")
-      for (i in 0 until tokens.numberOfOnChannelTokens) {
-        log.appendText(tokens[i].toString() + '\n')
-      }
+//      val log = File("GLExtensionsPreProcessor.txt")
+//      log.writeText("")
+//      for (i in 0 until tokens.numberOfOnChannelTokens) {
+//        log.appendText(tokens[i].toString() + '\n')
+//      }
 
       ParseTreeWalker().apply {
         walk(ExtensionCallTracker(tokenList), parser.script());parser.reset()

+ 3 - 3
src/main/kotlin/mod/qsrc/Story/mod_chastity_villa_story.kts

@@ -169,7 +169,7 @@ if (`$args`[0] == ModLoc.villa_story.album_first) {
   mod_chastity_busy = 1
   mod_chastity_villa_album_discovered = 1
   ext.clearMainWindow()
-  "You start watching photos in the album. After few pages you see familiar face. It takes you few moments to realize, that she's your ${`$npc_nickname`["A29"]}! And she's locked too!"
+  "You start watching photos in the album. After few pages you see familiar face. It takes you few moments to realize, that she's your ${`$npc_nickname`[GLNpc.Mom]}! And she's locked too!"
   ext.image("mod/chastity/villa/mother/mother1.jpg")
   ext.addArousal(GLArousalAction.voyeur, 5, GLArousalFetish.none)
   ext.endArousal()
@@ -180,8 +180,8 @@ if (`$args`[0] == ModLoc.villa_story.album_first) {
     "\"Sir, may i ask a question?\""
     "\"Sure ${`$pcs_nickname`}, what's up?\" he asks calmly."
     "\"I was cleaning your office, and found this album.\" you asks a bit nervously. \"I'd like to know how do you know this woman.\""
-    "\"Which one?\" You hands him the album pointing to your ${`$npc_nickname`["A29"]} photo. \"This one\""
-    "\"Oh, that's ${`$npc_firstname`["A29"]}. We've met years ago and had good time. Why do you ask?\""
+    "\"Which one?\" You hands him the album pointing to your ${`$npc_nickname`[GLNpc.Mom]} photo. \"This one\""
+    "\"Oh, that's ${`$npc_firstname`[GLNpc.Mom]}. We've met years ago and had good time. Why do you ask?\""
     act("\"That's my mom!\"") {
       ext.clearMainWindow()
       ext.image("mod/chastity/villa/garden.jpg")