Skip to content

Commit

Permalink
minor changed in app
Browse files Browse the repository at this point in the history
  • Loading branch information
tifv committed Jul 1, 2024
1 parent 27c3efd commit 898bdd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 44 deletions.
14 changes: 7 additions & 7 deletions webconv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ pub fn decode(encoded: &str, params: &DecodeParameters)
serialize::<Exchange<Blueprint, Behavior>>(
load_blueprint(encoded)?,
params ),
InterRepr::Tree(()) =>
serialize::<Exchange<V, V>>(
load_tree(encoded)?
.transpose().ok_or_else(|| JsError::new(
"Blueprint or behavior should not \
be represented with nil" ))?,
params ),
InterRepr::Tree(()) => {
let value = load_tree(encoded)?
.transpose().ok_or_else(|| JsError::new(
"Blueprint or behavior should not \
be represented with nil" ))?;
serialize::<Exchange<V, V>>(value, params)
}
}
}

Expand Down
40 changes: 3 additions & 37 deletions webconv/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ <h5 class="spoiler--heading">Settings</h5>
<label for="inter_repr--tree">Tree</label>
<div class="comment"
>Tree representation will give a more nuanced
look into the structure of a blueprint, but
will fail to decode for various reasons.</div>
look into the structure of a blueprint,
but will generally fail to decode
(for various reasons).</div>
</fieldset>
</div>
</div>
Expand All @@ -82,41 +83,6 @@ <h5 class="spoiler--heading">Settings</h5>
<div class="errors"></div>
<textarea class="contents"></textarea>
</div>
<!-- <div id="game-mode">
<div class="buttons buttons__switch">
<button data-action="goto-ron">Clear and switch to RON</button>
<button data-action="goto-json">Clear and switch to JSON</button>
</div>
<h2>Encoded (blueprint/behavior string)</h2>
<textarea style="min-width: 600px;" rows="15"></textarea>
<div class="buttons">
<button data-action="convert-game-to-ron">Decode to RON</button>
<button data-action="convert-game-to-json">Decode to JSON</button>
</div>
<div class="errors"></div>
</div>
<div id="ron-mode">
<div class="buttons buttons__switch">
<button data-action="goto-game">Clear and switch to blueprint</button>
</div>
<h2>Decoded (RON)</h2>
<textarea style="min-width: 600px;" rows="15"></textarea>
<div class="buttons">
<button data-action="convert-ron-to-game">Encode</button>
</div>
<div class="errors"></div>
</div>
<div id="json-mode">
<div class="buttons buttons__switch">
<button data-action="goto-game">Clear and switch to blueprint</button>
</div>
<h2>Decoded (JSON)</h2>
<textarea style="min-width: 600px;" rows="15"></textarea>
<div class="buttons">
<button data-action="convert-json-to-game">Encode</button>
</div>
<div class="errors"></div>
</div> -->
</div>
</body>
<script type="module" src="./main.js"></script>
Expand Down

0 comments on commit 898bdd3

Please sign in to comment.